swagger-maven-plugin icon indicating copy to clipboard operation
swagger-maven-plugin copied to clipboard

Tags and other information aren't being generated

Open ozavodny opened this issue 4 years ago • 2 comments

Steps to reproduce: clone https://github.com/kongchen/swagger-maven-example set version in pom to 3.1.7 (3.1.8 not working because of https://github.com/kongchen/swagger-maven-plugin/issues/729)

Then tags aren't generated

  "paths" : {
    "/pet" : {
      "post" : {
        "operationId" : "addPet",
        "consumes" : [ "application/json", "application/xml" ],
        "produces" : [ "application/json", "application/xml" ],
        "responses" : {
          "default" : {
            "description" : "successful operation"
          }
        }
      },

This is how it looks when I change the version to 3.0.1 (the original version in the example)

  "paths" : {
    "/pet" : {
      "post" : {
        "tags" : [ "pet" ],
        "summary" : "Add a new pet to the store",
        "description" : "",
        "operationId" : "addPet",
        "consumes" : [ "application/json", "application/xml" ],
        "produces" : [ "application/xml", "application/json" ],
        "parameters" : [ {
          "in" : "body",
          "name" : "body",
          "description" : "Pet object that needs to be added to the store",
          "required" : true,
          "schema" : {
            "$ref" : "#/definitions/Pet"
          }
        } ],
        "responses" : {
          "405" : {
            "description" : "Invalid input"
          }
        },
        "security" : [ {
          "petstore_auth" : [ "write:pets", "read:pets" ]
        } ]
      },

Is this intended?

ozavodny avatar Jan 06 '21 09:01 ozavodny

Hi , did you find a solution for that @Alddar ?

gklp avatar Jul 26 '21 09:07 gklp

Same problem: Here is an example of the version generated by springfox and this maven plugin (3.1.8)

  • Missing tags
  • @RequestBody, must be required
  • Missing parameter name: pedido
  • Missing consumes: application/json

image

@RestController
@RequestMapping(value = "/pedido")
public class PedidoController {
    
@PostMapping
public ResponseEntity<DetailSuccess> salvarPedido(@RequestBody Pedido pedido) throws ParseException {
 
  return ResponseEntity.status(HttpStatus.OK).body(xxx);
}

ricardojlrufino avatar Aug 09 '22 05:08 ricardojlrufino