-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Why === Welp, a change in pid2 changed the meaning of one of our anyOf enums! We don't want that to keep happening in the future. The real fix would be to have pid2 emit the discriminated unions on its own, but this is a hotfix. What changed ============ This change does two things: * Does the barest minimum attempt at detecting when an anyOf is a oneOf in disguise, and renders the types in a way that includes the discriminator value so that it is stable and will not change even if the lexicographic order of the entries change. Barest minimum since there is ongoing work to improve this. * Also adds the value of the discrimnator as default in the `Field` constructor if the discriminator was renamed (i.e. if it was `$kind`), because mypy cannot fathom you being able to specify a parameter called `$kind` to the constructor, or being able to set that to a `Literal[...]`. It's weirdness all around. Test plan ========= replit/ai-infra#1844 is no longer angry.
- Loading branch information
Showing
1 changed file
with
72 additions
and
2 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