You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The way the code works (as I see it), it works it's way in on the JSON being validated and the schema in tandem. So it dives in to a child property together and always has the JSON and schema paired.
I have a need outside that. I need to randomly get the type of a property in the JSON. So if I have the following JSON:
{"rectangle":{"a":-5,"b":"asd"}}
And I need to get the ObjectSchema for "a", is there a way in the existing library to basically say give me the ObjectSchema for "rectangle/a"?
If not, this is very easy to implement, I just don't want to duplicate existing code.
If I do need to write it myself, would you like the created method submitted as a pull request? And if so, any preference for the class it is in and/or the method name?
thanks - dave
The text was updated successfully, but these errors were encountered:
I'm not sure which version of the code you are looking at. The current git HEAD revision of the master branch heavily diverged from the source code of the latest release (174 commits added since version 1.5.1). These changes contain mostly 2 improvements
one is supporting the latest (draft 6) version of the json schema spec, which was published in April
the other one is tracking the location of sub-schemas and including them in the ValidationExceptions (and SchemaExceptions) - this is the information you need. So you can obtain this pointer using Schema#getSchemaLocation() if you use the HEAD revision.
I plan to publish a new release in the upcoming days, since yesterday I could make the library pass the draft v6 tests of the test suite. So if you can wait a few days then the best thing to do is probably waiting for the release. If need it more urgently, then you can start using the current HEAD.
The way the code works (as I see it), it works it's way in on the JSON being validated and the schema in tandem. So it dives in to a child property together and always has the JSON and schema paired.
I have a need outside that. I need to randomly get the type of a property in the JSON. So if I have the following JSON:
{"rectangle":{"a":-5,"b":"asd"}}
And I need to get the ObjectSchema for "a", is there a way in the existing library to basically say give me the ObjectSchema for "rectangle/a"?
If not, this is very easy to implement, I just don't want to duplicate existing code.
If I do need to write it myself, would you like the created method submitted as a pull request? And if so, any preference for the class it is in and/or the method name?
thanks - dave
The text was updated successfully, but these errors were encountered: