Define a StrictJSON Schema
mainA StrictJSON schema is a dictionary where keys are the field names and values define the constraints and types.
Value Formats:
<description>, <datatype>: e.g.,"starting with A, str"<description>, type: <datatype>: e.g.,"between 5 to 12, type: int"<datatype>: e.g.,"str"(no description provided)<description>: e.g.,"Name of party"(datatype defaults toAny)
Supported Datatypes:
- Basic:
str,int,float,bool - Collections:
List[type],Dict[key_type, value_type](Note:listordictwithout brackets default toList[Any]andDict[str, Any]) - Complex:
date,datetime,UUID,Decimal - Special:
Any,None,Optional[type],Union[type1, type2], and PEP 604 syntax (type1 | type2) - Constraints:
Enum['A', 'B', 'C'](limits output to specific values)
Nesting: You can nest schemas using lists of dictionaries, e.g., [{'key': 'type'}] to ensure a list of specific objects.