Python
There are special use-cases that each language supports; this document pertains to Python models.
Generate Pydantic models
In some cases you might want to use pydantic data validation and settings management using Python type hints for the models.
You can find an example of its use here
Generate models with JSON Serializer and Deserializer methods
Using the preset PYTON_JSON_SERIALIZER
, you can generate serializeToJson
method to convert model instance to JSON and deserializeFromJson
method to convert JSON to model instance.
Limitations
- Above preset doesn't unwrap properties of type
ConstrainedDictionaryModel
withserialilzationType = unwrap
- The serialized JSON object will have the same property names as defined in the model object.
Check out this example for a live demonstration.