elasticio / odata2openapi

OData to OpenAPI Converter
https://www.elastic.io
MIT License
34 stars 23 forks source link

Empty required is not valid Open API spec #4

Closed josephearl closed 8 years ago

josephearl commented 8 years ago

According to the Swagger validator a definition is not allowed to have "required": [], instead the required property should be omitted completely.

The error from the validator is:

Object
code: "ARRAY_LENGTH_SHORT"
 params: Array [2]
0: 0
1: 1
message: "Array is too short (0), minimum 1"
 path: Array [3]
0: "definitions"
1: "A.Definition"
2: "required"
schemaId: "http://swagger.io/v2/schema.json#"