apiaryio / fury-adapter-swagger

Swagger 2.0 parser adapter for Fury.js
MIT License
11 stars 12 forks source link

Discard invalid enumerations inside a parameter #176

Closed kylef closed 6 years ago

kylef commented 6 years ago

When a parameter has no valid enumerations defined in an enum, we will now discard the enumeration in the parse result. Previously the parser would create an malformed enumeration element which causes Minim serialiser to trip up. It was producing an enum element with empty content which was contained within another enum element as content inside an array. This is not valid.

I think the best case is to discard this at the parser level as it is invalid specification. The user already receives warnings regarding the case.

Also to note in JSON Schema it says enum should have at least one element.

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