what causes Expected Union[definition-ref, bool]
but got JsonSchemaObject
- serialized value may not be as expected?
#1417
Replies: 3 comments
-
Experiencing same issue with no apparent cause or interpretable error message. I'm not even sure if there's an actual error or potential serialization problem. |
Beta Was this translation helpful? Give feedback.
-
This isn't super informative, but as an update I worked on this more and it seems to be related to nested / unlabelled entries. It seems that datamodel-code-gen will auto-generate classes for nested objects. I reduced / fixed the problem in my code by applying the code discussed in the following: YousefED/typescript-json-schema#554 Particularly, I replaced repeated / nested structures with their top-level references. This seems to have reduced or eliminated the number of repeats and thus removed the warning. If you're building your JSON schema not automatically (mine is being generated from typescript) it may help to either set the title and add the --use-title-as-name flag) or by moving the nested structures to top level references. |
Beta Was this translation helpful? Give feedback.
-
This warning comes from the pydantic side. I escalated the issue to pydantic team. |
Beta Was this translation helpful? Give feedback.
-
Didn't know where else to post this, but what causes
Expected `Union[definition-ref, bool]` but got `JsonSchemaObject` - serialized value may not be as expected
exactly? I'm trying to convert typescript -> JSON Schema -> Pydantic so maybe it has something to do with unsupported type annotation?Beta Was this translation helpful? Give feedback.
All reactions