Skip to content
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

Feature request: JSON error offset in ValidationError #14

Closed
juliaogris opened this issue Aug 29, 2018 · 2 comments
Closed

Feature request: JSON error offset in ValidationError #14

juliaogris opened this issue Aug 29, 2018 · 2 comments
Assignees

Comments

@juliaogris
Copy link

juliaogris commented Aug 29, 2018

It would be amazing to be able to give feedback to the enduser where their JSON input failed to validate against the schema, so I guess an Offset field similiar to the field in json.SyntaxError would be great.

@santhosh-tekuri
Copy link
Owner

during validation, we get the json-path at which validation has failed.

computing offset for given json-path is not trivial.

also we support validation given map:
func (s *Schema) ValidateInterface(doc interface{}) (err error)
in this case offset field does not make sense

@santhosh-tekuri
Copy link
Owner

WON'T FIX

json parser in std library does not provide offset for json tokens.
so it is not trivial supporting this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants