-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Enhancement - Return Full Request JSON With Validation Errors #338
Comments
Hey @trvsysadmin for As for I can see how it would be useful to send just the so to try and answer your questions: Is there anything else or any other questions I can attempt to answer? |
Nope that is all, thank you very much for your reply and thanks for your library! Team here agrees 1 is subjective and may not be the job of the core library. Will try to submit a PR for as an example. In general for 2, we also found out that for cases like
is what we can get now but we would like to get:
|
Thanks for your feedback about the evaluation result, I’ll definitely try and think of a way to incorporate that in the results if it makes sense :) |
Package version eg. v8, v9:
v9
Issue, Question or Enhancement:
I have two clarification-question / suggestions:
We like to send back an error message to front-end-client the full details of the validation errors that occurred in a nested struct. After changing the namespace from the struct namespace to a json tag, invoking
FieldError.Namespace()
gives usorchestra.group_one.violin_small
. We end up using another library called gabs to generate a combined nested json. I have put the sample code below and the sample output in json. It is pure luck I found gabs after a bit of googling as I was planning to write a json generator and inserter and that would have taken some time.Question is a) am I doing the right thing (does this library provide this functionality out of the box) and b) maybe it could be helpful to provide this kind of code as an example of how you might return jsoni-fied responses of validation errors.
EDIT: Found that
FieldError.Param()
is what I was looking for. But weird that Param would return only the last of anOR
operator (e.g.a|b|c
->c
).ORIGINAL: Both FieldError.Tag() and FieldError.ActualTag() return only
eq
but noteq=something
. But it does return a fulleq=a|eq=b
if I put the|
operator. Is there anyway to return what its supposed to be equal to?Code sample, to showcase or reproduce:
The text was updated successfully, but these errors were encountered: