devexperts / swagger-codegen-ts

Typesafe Swagger API generator for TypeScript
Mozilla Public License 2.0
80 stars 16 forks source link

Support enums with single value #33

Closed mankdev closed 5 years ago

mankdev commented 5 years ago

Now enum with single value leads to error during typescript compilation, because enum generates as io-ts union type, witch should have at least two elements.

According spec it it valid case https://tools.ietf.org/id/draft-fge-json-schema-validation-00.html#rfc.section.5.5.1

The value of this keyword MUST be an array. This array MUST have at least one element. Elements in the array MUST be unique.