Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add support for referencing subschemas by id. #371
A note on the implementation, I added the
I'd like to add some more tests, but I was a bit lost in the the test structure. Guidance on where / how to add them would be appreciated.
I have to definitely read this carefully -- the one general thing I'd say though is that I definitely want to restrict public changes to the
This sounds likely to be backwards incompatible with what the current thing asks for. But I probably have to read the changes here carefully to understand exactly.
Yeah, sorry bout that :/. The tests for this seem very likely like they'd go in
Hey, haven't forgotten this, just still having some trouble figuring out how much of this is a bug fix and how much is new :/.
It's likely my own fuzzy knowledge of
Still definitely hoping to find some time to think about this PR though. Sorry for the wait.
I should probably have been more proactive with this. I needed to add more tests! Also, looking back at this without rose-tinted glasses, there is as a problem with the implementation. You cannot pass an object for validation against a defined subschema. Instead, you can only validate subschema elements if they are children of root schema instance. This should be resolved before this change is merged.
Ideally, one should be able to pass a string id to the validator with an instance and have it validated against the schema w/ that ID, regardless of whether it is a subschema and root.
Here is an example of how you have to validate instances against subschemas now (Ignore the versions here, just an example).