swagger-codegen icon indicating copy to clipboard operation
swagger-codegen copied to clipboard

[Swift] crash when receiving enum not listed in json schema

Open jaz-ah opened this issue 10 years ago • 0 comments

Swagger Code Generation: v2.1.5 Language: swift XCode7.2 / Swift 2.0

Given a schema: https://gist.github.com/jaz-ah/f6394360065650000c96

That has an enum: "EnumTest": { "type": "string", "enum": [ "abc", "def" ] } If the service sending the enum sends "xyz", then our current Swift code will crash, even if we declare EnumTest to be an optional property.

jaz-ah avatar Jan 27 '16 21:01 jaz-ah