Great explanation, thanks! I in fact face a scenario I don't know how to tackle neatly (with or without Pydantic), perhaps you can help. I want to define my data model once, but just the structure for parsing purposes, so no constraints or validation (note all fields would be optional here). Then I want to use this data model in two different applications, each of which has different validation requirements to impose on the structure, and therefore their own validation functions. How would you go about this?
Great explanation, thanks!
I in fact face a scenario I don't know how to tackle neatly (with or without Pydantic), perhaps you can help.
I want to define my data model once, but just the structure for parsing purposes, so no constraints or validation (note all fields would be optional here). Then I want to use this data model in two different applications, each of which has different validation requirements to impose on the structure, and therefore their own validation functions.
How would you go about this?