Open cmcarthur opened 5 years ago
json schema trivially supports enums with:
{ "type": "string", "enum": ["option_one", "option_two"] }
and the same syntax can be leveraged for literals:
{ "type": "string", "enum": ["only_one_possible_value"] }
however, in Python we have to convert our simple list "enums" into python Enums to get this behavior.
it'd be nice to have a shorthand for generating capital-E Enums from our list "enums" (and to also use it for simple literal values)
json schema trivially supports enums with:
and the same syntax can be leveraged for literals:
however, in Python we have to convert our simple list "enums" into python Enums to get this behavior.
it'd be nice to have a shorthand for generating capital-E Enums from our list "enums" (and to also use it for simple literal values)