devexperts / swagger-codegen-ts

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

Support nonEmptyArray for arrays with minItems > 0 for OpenAPI 3.0 #146

Closed mankdev closed 3 years ago

mankdev commented 3 years ago

Hi!

This PR adds generation NonEmptyArray for cases when minItems set and greater than 0.

This behaviour defined in spec

Array Length

You can define the minimum and maximum length of an array like so:

type: array
items:
 type: integer
minItems: 1
maxItems: 10

Without minItems, an empty array is considered valid.

raveclassic commented 3 years ago

Thanks @mankdev, LGTM