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

Access subschema from error context? #622

Open
adjenks opened this issue Mar 20, 2020 · 3 comments
Open

Access subschema from error context? #622

adjenks opened this issue Mar 20, 2020 · 3 comments

Comments

@adjenks
Copy link

adjenks commented Mar 20, 2020

Schemas can have title properties, as well as description. When an error is returned, I would like to get access to the title and possibly also the description field of that subschema where the error was identified. Is this possible? Currently we get the property, pointer, message and constraint. However, in a nested schema, the pointer doesn't really tell you where to look within the schema itself, so it's difficult to recover the descriptive properties, or extended ("x-property") properties, of a schema. Is there a way to access these in the context of an error that I'm just not noticing?

@erayd
Copy link
Collaborator

erayd commented Mar 21, 2020

Can you give an example schema where the pointer is inadequate?

@adjenks
Copy link
Author

adjenks commented Mar 21, 2020

Every schema. The pointer is a pointer for the data structure, not the schema itself.
I want the properties from 9.1 and possibly other properties from the subschema that contains an error. So, when you get an error, how do you inspect the schema, not the data, at the point the error was identified?

@erayd
Copy link
Collaborator

erayd commented Mar 22, 2020

Gotcha - I don't think we currently have a mechanism for that. You're welcome to submit a PR that implements it though.

Please note that if you do this, performance is a consideration.

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

2 participants