javascript - Swagger: first enum value overwrites type -


i using swagger doc generate api app. doc written in yml , in place going define props enum (we use mysql). looks like:

properties:       type:         enum:           - "first"           - "second"           - "example"         type: "string"       title:         type: "string"     ... // , on , on 

i expecting this:

{   "type": "string",   "title": "string", } 

as can see, type field going string defined in config file, receiving 1 instead:

{   "type": "first",   "title": "string", } 

swagger sets first value data type , absolutely incorrect. question how value "string" "type" field.

i have been writing swagger documentation in json. below example of how have "enums" set up. maybe can translate yml better idea.

"parameters":[            {               "name":"userid",               "in":"path",               "description":"to determined.",               "required":true,               "type":"string"            },            {               "name":"embedded",               "in":"query",               "description":"to determined",               "required":false,               "type":"array",               "items":{                  "enum":[                     "address",                     "state"                  ]               },               "collectionformat":"csv"            } 

if @ items see don't use type , works fine.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

android - CollapsingToolbarLayout: position the ExpandedText programmatically -

Listeners to visualise results of load test in JMeter -