(fix): Adds check for discriminator type #40
Reference in New Issue
Block a user
Delete Branch "fix/adds-check-for-discriminator-type"
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 pull request enhances the handling of
oneOfschemas with discriminators in thejamboparser by enforcing that all subfield types must be objects (i.e., subclasses ofBaseModel) when a discriminator is used. It also adds a corresponding test to ensure this validation works as expected.Validation improvements for discriminators
_build_type_one_of_with_discriminatorinoneof_type_parser.pyto check that all subfield types are objects (subclasses ofBaseModel) when a discriminator is present, raising aValueErrorif not.Testing
test_oneof_with_invalid_typesto verify that using non-object types in aoneOfwith a discriminator raises aValueError.⚠️ Please install the
to ensure uploads and comments are reliably processed by Codecov.
Codecov Report
✅ All modified and coverable lines are covered by tests.
📢 Thoughts on this report? Let us know!