-
Notifications
You must be signed in to change notification settings - Fork 14
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
Schema representation - 'importing' types #64
Comments
I've raised a PR to provide this here: #66 |
Sorry about the noise - I've added a fix for nested Refs (where a schema depends on another that depends on another), and re-opened the PR. Added a test for this as well. The goal here is ultimately to support interop with schema registries where each schema is stored independently of other schemata in the registry. I haven't changed the current functionality (Schema::canonical_form()), EXCEPT, you'll notice a change in the two test cases:
In both cases, the 'expected' canonical form was (I believe) incorrect, as they both include two (duplicate) definitions for a type. |
#66 has been merged! |
The specification states the following:
This means that the following schema is valid (the A type is defined in b_field_one and the type is not defined with b_field_two):
This crate makes it easy to load a schemata in the form of a sequence (Schema::parse_list) of schema where:
However I can't find a way to output an individual schema in a schemata that is 'complete' (ie does not depend on other schemas, and otherwise complies with the rules). For example:
Gives the following canonical schemas (for A I think this is OK, B is problematic as there is no definition for A):
I believe the canonical form for B should actually be:
Do we have a way of producing this 'correct' form? This is necessary for fingerprint calculation and some schema registry interactions.
The text was updated successfully, but these errors were encountered: