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

Inclusion of InstanceLocation for required and additionalProperties errors #50

Open
sazzer opened this issue Nov 30, 2021 · 2 comments
Open

Comments

@sazzer
Copy link

sazzer commented Nov 30, 2021

I've just come across this and it's working great :) However, one thing I've noticed that's a bit awkward is - any errors caused by a violation of a required or additionalProperties rule doesn't tell you where in the JSON the violation occurred.

For everything else I get an InstanceLocation that is the JSON Pointer to the property that was invalid. For these two I just get "", so I can't have my service indicate which property was either missing but required, or was unexpectedly present.

I do get this come through in the Message so the validator obviously knows which property it is, but it just doesn't actually return it to the client.

Cheers

@santhosh-tekuri
Copy link
Owner

i guess instanceLocation should point to some thing that is present in the input json document.

if a required property is missing, the instanceLocation pointing to that missing property when evaluated on input document it evaluates to nothing.

@handrews
Copy link

The instance location for required should be the object that's supposed to contain the required properties, rather than individual properties. The actual missing properties would have to be listed in the message.

The instance location for additionalProperties should be the instance object that failed against the subschema. At least I'm pretty sure of that — I'm not an expert on the output requirements.

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

No branches or pull requests

3 participants