Closed BilliAlpha closed 3 years ago
Does the OpenAPI spec require enum values to be strings? Or, can it be any valid scalar value? Should we check for this?
Does the OpenAPI spec require enum values to be strings? Or, can it be any valid scalar value? Should we check for this?
The JSON Schema definition of the enum field is:
The value of this keyword MUST be an array. This array SHOULD have at least one element. Elements in the array SHOULD be unique.
Elements in the array MAY be of any type, including null.
An instance validates successfully against this keyword if its value is equal to one of the elements in this keyword's array value.
This PR adds the
enum
field on the Schema object (as explained in #231)I also added some tests to make sure the field appeared in the resulting openapi specs.