-
-
Notifications
You must be signed in to change notification settings - Fork 590
Nested references are not loaded and the exception is unclear #209
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
my bad, if So there are 2 issues still open for me: |
This may be related to the above or may be down to my misunderstanding but I am hoping someone canoffer a little insight. File parameter_value_obj.json: File results_run.json: Code: json_body = {"name": "6", "parameters": [{"wibble": 23}]} with open(schema_file, "r") as res_file: try: try: I get no exceptions thrown, the schema is accepted and the validation seemingly passes - But it shouldn't, as the object within the "parameters" array is clearly not of type parameter_value_obj. Is this likely to be because I am not properly resolving the referrenced file? Or is this a bug in validation? |
@wadeaa I recommend you to try not to reference this works nicely for me |
Hi Traut, thanks. Yes that is the way I have it now, and it does work. But the documentation is growing and I want to be able to reuse certain objects in multiple schemas. It would make sense to be able to only define them (and also update them) once in their own files. I just can't see how it can be properly loading the reference if it is passing validation, but then I am not getting any SchemaError either. I will keep playing with it. |
@wadeaa if you look around in that repo I referenced, you'll see that I'm reusing some primitives there, referencing them in different (bigger) schemas |
Thanks @traut. I was diving into the code to see if I needed a resolver subclass to get the job done, but this works well for what I'm doing right now. Thanks! |
86f965e Merge pull request #209 from json-schema-org/refactor-format f056cb7 fix: incorrect relative-json-pointer test, closes #208 814eb16 refactor: split format.json to multiple files, closes #162 870b9f7 Merge pull request #207 from json-schema-org/draft-7-ajv 3d9830a feat: test draft-7 with Ajv 9ce7b4c Merge pull request #200 from handrews/draft-07 cf6e663 Apparently descriptions must be < 60 chars 1042cd6 Update draft coverage information 0680b46 Restore regex format test from draft-03 f58637d Basic relative json pointer tests for format 1b43ffa Partial IRI and IRI-reference test suite 9b020b8 Add idn-email and idn-hostname format tests ca342c9 Add tests for "date" and "time" formats 0d64501 Tests for contentMediaType and contentEncoding ea357f3 Update draft coverage information 321db9a Tests for if, then, and else keywords dedd3f1 Unmodified copy of draft6 tests to draft7 git-subtree-dir: json git-subtree-split: 86f965e53dda0b6c57e70ddd726243e1e061cf84
Looking back at this (after ages, apologies), but
This is the same as #274 (comment) and the other duplicates mentioned there -- essentially that's just how relative URIs work, this library is just following the RFC (3986 in this case), but it's similar behavior to what you're all going to be used to from a browser. There's really 2 options:
|
Test case (all files are in the same directory):
File
schema-a.json
File
schema-b.json
:File
schema-c.json
:File
validate.py
:Result:
The text was updated successfully, but these errors were encountered: