-
-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Allow schemas to reference other schemas #360
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
Conversation
This allows us to reference external schemas to avoid duplication. They can be referenced like ``` "$ref": "file://uptime-results.v1.schema.json#/definitions/CheckResult" ``` The handler assumes all schemas will be located in out `schemas` directory.
|
I think that we likely need to do something to support this in rust as well - the tests seem less comprehensive there, so although they passed I doubt this works. Any thoughts on this @untitaker? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(for both rust/python) how does get_schema behave? I think it will have to resolve all file refs and return a self-contained schema. it is used in consumers to validate.
Python works after my changes - #361 has an example. I manually tested dropping fields from the examples and it validates successfully (ie test_examples fails if the schema is invalid). I'll try get a test going in rust |
|
@wedamija my bad, yeah i think if we can get some tests in rust that load all schemas like we have in python we'd be golden. |
63bee63 to
42f1a81
Compare
aba7341 to
ba6598f
Compare
a9a128c to
ba6598f
Compare
8b717c9 to
be3510d
Compare
9268c1f to
b8f5f77
Compare
This allows us to reference external schemas to avoid duplication. They can be referenced like
The handler assumes all schemas will be located in out
schemasdirectory.Usage example here: #361