mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
feat: add tag and value in validation error details (#1760)
* add tag and value in validation error details * fix unit tests and linter * add quotes around value * fix unit tests
This commit is contained in:
@ -104,7 +104,7 @@ func Read(rw http.ResponseWriter, r *http.Request, value interface{}) bool {
|
||||
for _, validationError := range validationErrors {
|
||||
apiErrors = append(apiErrors, Error{
|
||||
Field: validationError.Field(),
|
||||
Detail: validationError.Tag(),
|
||||
Detail: fmt.Sprintf("Validation failed for tag %q with value: \"%v\"", validationError.Tag(), validationError.Value()),
|
||||
})
|
||||
}
|
||||
Write(rw, http.StatusBadRequest, Response{
|
||||
|
Reference in New Issue
Block a user