You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to get the JSON schema for a TypedDict, some of the properties have a reference to a "#/definitions/NoneType" and "#/definitions/Str" (which doesn't exist) rather than using "type": "string" or "type": "null".
I assume the problem generalizes to all union types, not just Optionals.
Apparently, this only starts occurring when there are at least 3 fields that are Optionals on the type.
Description
When trying to get the JSON schema for a TypedDict, some of the properties have a reference to a "#/definitions/NoneType" and "#/definitions/Str" (which doesn't exist) rather than using
"type": "string"
or"type": "null"
.I assume the problem generalizes to all union types, not just Optionals.
Apparently, this only starts occurring when there are at least 3 fields that are Optionals on the type.
I have a PR forthcoming which should fix this.
What I Did
Ran the following script:
Output
All three properties should have had the same type:
The text was updated successfully, but these errors were encountered: