ADR 0011 and 0014 were referenced in the README list but their files were absent from the repository. Reconstruct them from available context: - 0011: go-playground/validator selection (already implemented in go.mod) - 0014: gRPC adoption strategy (evaluated and deferred/rejected) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
37 lines
1.3 KiB
Markdown
37 lines
1.3 KiB
Markdown
# 11. Validation Library Selection
|
|
|
|
* Status: Accepted
|
|
* Deciders: Gabriel Radureau, AI Agent
|
|
* Date: 2026-04-05
|
|
* Implementation Date: 2026-04-05
|
|
|
|
## Context and Problem Statement
|
|
|
|
The dance-lessons-coach application needs input validation for API request bodies and configuration values. We need a library that integrates well with Go structs and provides clear error messages.
|
|
|
|
## Decision Drivers
|
|
|
|
* Struct-tag-based validation to avoid boilerplate
|
|
* Good error messages with field-level detail
|
|
* Active maintenance and wide adoption
|
|
* Compatibility with existing interface-based design
|
|
|
|
## Considered Options
|
|
|
|
* `github.com/go-playground/validator/v10` — struct-tag driven, widely adopted
|
|
* `github.com/asaskevich/govalidator` — tag-based but less expressive
|
|
* Manual validation — full control, no dependency, high boilerplate
|
|
|
|
## Decision Outcome
|
|
|
|
Chosen option: **`go-playground/validator/v10`** because it is the de-facto standard in the Go ecosystem, supports struct-tag annotations, provides field-level error detail, and integrates cleanly with our interface-based design.
|
|
|
|
## Implementation
|
|
|
|
`github.com/go-playground/validator/v10 v10.30.2` is present in `go.mod`.
|
|
The `pkg/validation/` package wraps the validator for reuse across handlers.
|
|
|
|
## Links
|
|
|
|
* [go-playground/validator GitHub](https://github.com/go-playground/validator)
|