-
Notifications
You must be signed in to change notification settings - Fork 887
feat: add tag and value in validation error details #1760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@Emyrk Would this change impact our frontend behavior? Like here: https://github.com/coder/coder/blob/main/site/src/api/errors.ts#L41 |
New behavior is as follows:
|
@@ -58,7 +58,7 @@ func TestRead(t *testing.T) { | |||
|
|||
var validate toValidate | |||
require.True(t, httpapi.Read(rw, r, &validate)) | |||
require.Equal(t, validate.Value, "hi") | |||
require.Equal(t, "hi", validate.Value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The expected and actual arguments were inverted so I changed them to what they should be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG 👍
Yes it affects the FE, but I think it is still a positive change. Even for the FE |
* add tag and value in validation error details * fix unit tests and linter * add quotes around value * fix unit tests
This PR adds a more details to validation errors from the API.
Subtasks
Fixes #1757