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

Consumes = "" generated from yaml file after version 2.3.0

Open cstechfoodie opened this issue 8 years ago • 0 comments

Description

In Get or Delete method, the "consumes" in @RequestMapping is not generated correctly, which will result a compile error if I run the app. When regenerated by version 2.2.3 or below, the mapping works fine.

Swagger-codegen version

2.3.0 && 2.3.1

Swagger declaration file content or url

In Get,

"consumes":[  
        "*/*"
    ],

it will produce

consumes = ""

In Delete,

"consumes":[  
        "*/*"
    ],
"produces":[  
        "*/*"
    ],

it will generate

produces = "*/*",
consumes = ""

In this case, "produces" works fine, but "consumes" doesn't.

Command line used for generation

java -jar swagger-codegen-cli-2.3.1.jar generate -i userprefs-api.json -l spring -o server

Suggest a fix/enhancement

Please compare it with older version 2.2.3

cstechfoodie avatar Jun 08 '18 17:06 cstechfoodie