[FEATURE] Implements OneOf #37
Reference in New Issue
Block a user
Delete Branch "feature/implements-one-of"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR is based on the commits from PR #33 by @thommann, with some minor fixes and additions.
Kudos to @thommann!
This pull request adds support for the
oneOftype in JSON Schema parsing and validation, along with comprehensive documentation and integration into the parser system. The key changes introduce a newOneOfTypeParserthat ensures data matches exactly one of the specified schemas, and provides clear usage examples.Support for
oneOftype:OneOfTypeParserinjambo/parser/oneof_type_parser.pythat validates data against exactly one schema from a list, including discriminator support and custom validation logic.OneOfTypeParserin the parser module's imports and__all__list injambo/parser/__init__.py. [1] [2]Documentation:
usage.oneof.rstwith detailed explanations and examples for using theoneOftype, including overlapping constraints and discriminator-based schemas.⚠️ Please install the
to ensure uploads and comments are reliably processed by Codecov.
Codecov Report
❌ Patch coverage is
97.91667%with1 linein your changes missing coverage. Please review.📢 Thoughts on this report? Let us know!
This PR raises the question if we question if thediscriminatorkeyword should be supported even thought it is not a official JsonSchema Spec.If that is the case the
discriminatorkeyword will have to be implemented in theallOfandanyOftype parser.discriminatoris only valid in theoneOfkeyword