Replies: 3 comments
-
Related discussion here, since being able to add arbitrary annotations might solve one piece of this fable-compiler/Fable.Python#48 |
Beta Was this translation helpful? Give feedback.
-
Since it would be difficult to get things like discriminated unions and string enums working with pedantic, I'm going a different route for now of generating the json schema using a myriad plugin. |
Beta Was this translation helpful? Give feedback.
-
I think this is a great idea that we should explore. I don't have the capacity right now, but I'll keep it in mind. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there any pattern for generating a type that is annotated in a way that is usable by pydantic. Some libraries rely on it for generating a schema by calling
model_json_schema
on the type. Pydantic defines its own dataclasses, but the docs say that it has some compatibility with stdlib dataclasses:https://docs.pydantic.dev/latest/concepts/dataclasses/#usage-of-stdlib-dataclasses-with-basemodel
I've tried a few combinations to generate a class that it likes, but haven't yet been able to get it to recognize its properties.
Beta Was this translation helpful? Give feedback.
All reactions