steven_wang
09/29/2023, 9:37 PMth.StringType
or th.ObjectType
Is there some syntax like:
th.Property('value',[th.ObjectType(), th.StringType])
edgar_ramirez_mondragon
09/29/2023, 10:10 PM>>> th.CustomType({"type": ["object", "string"], "properties": {}}).to_json()
'{"type": ["object", "string"], "properties": {}}'
https://json-schema.org/understanding-json-schema/reference/type.html#type-specific-keywords
oneOf
>>> th.OneOf(th.ObjectType(), th.StringType()).to_json()
'{"oneOf": [{"type": "object", "properties": {}}, {"type": ["string"]}]}'
https://json-schema.org/understanding-json-schema/reference/combining.html#oneof
I think targets tend to have better support for the first form.steven_wang
10/06/2023, 10:36 AM