-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add discriminated union support (v2) (#5051)
* Add support for discriminated unions * Fix issue with duplicate schemas in oneOf * Address TODOs * Remove print statement * Remove unwanted debug change * Massively broken, but pushing as a checkpoint and reminder that this still needs more work * Rework discriminated union to use a class-based approach to better handle recursion * Fix 3.7 tests * Make Json/HashableJson private * Add a docstring to the final method in _ApplyInferredDiscriminator * Fix discriminated union test from test_forward_ref.py * Add test ensuring that literal enums produce valid JSON schema * Get to 100% code coverage * Improve comment * Fix failing tests * Convert __root__ tests to use Validator
- Loading branch information
Showing
7 changed files
with
1,988 additions
and
555 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.