-
Notifications
You must be signed in to change notification settings - Fork 485
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent Illegal Look-Around for OneOf in JSONSchema (#897)
Fixes #823 This comment details the issues error: #823 (comment) The reproduction code provided results in a json schema with `OneOf[pets]`: ``` class Model(BaseModel): pet: Union[Cat, Dog] = Field(..., discriminator='pet_type') ``` Before this PR: `OneOf` uses negative lookaheads to assert that only one schema member is included. This is illegal in `interegular`, more details available here: #456 After `OneOf` uses or-joined non-capturing groups which don't have the same issues with `interegular`.
- Loading branch information
Showing
2 changed files
with
29 additions
and
10 deletions.
There are no files selected for viewing
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