-
-
Notifications
You must be signed in to change notification settings - Fork 590
How can I resolve all references in a schema? #542
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
Comments
Will respond with more detail but probably related to #419 (and the latter is "doable" but not as easy as it should be so yeah definitely up for improvements here) |
@Zac-HD if you don't specifically need it to be in Python, you might take a look at JSON Schema Ref Parser. |
Hmm, but this can't be doable for recursive references, right? |
Depends on your perspective - Python containers can contain themselves, so it would be perfectly possible to represent recursive schemas without an explicit It's probably more ergonomic to only resolve the non-recursive references though, since that would make it trivial to construct a DOS attack against naive code. Recursive references are also - while not especially rare - less common than simple references, so non-recursive resolution would still be very helpful incremental step 😄 |
Closing in favor of python-jsonschema/hypothesis-jsonschema#28, since the canonicalisation I want isn't really useful for validators. |
060caae0d Merge pull request #467 from gene-hightower/strict-rfc-grammar 995932c74 Additional RFC-5321 Mailbox tests 637f0ac3e Merge pull request #542 from jdesrosiers/dyanmicref-no-bookending 87944e52e Merge pull request #543 from jdesrosiers/update-vocabulary-for-draft-next 07b90e3b5 Merge pull request #544 from frawa/list-typed-json 365349adc list typed-json in new Scala section 9d1efc27e Update vocabulary tests for draft-next 89f59caad Update dynamicRef tests for bookenending removal git-subtree-dir: json git-subtree-split: 060caae0dd58e34af0449baec1103606a0ef4977
I would like to take a schema that may have local or remote references, and return an equivalent schema that does not use any references at all. This would be really useful for
hypothesis-jsonschema
, but I have no idea how to do it withRefResolver
- I can't tell from the docs whether this is even something it should do.Maybe related to python-jsonschema/referencing#3? Any advice would be appreciated - I'd also be happy to e.g. ban remote references or local ids if that would help. I sketched an idea for the quick-and-dirty on python-jsonschema/hypothesis-jsonschema#6 but would prefer an upstream implementation if possible 😄
The text was updated successfully, but these errors were encountered: