Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter missing if @Parameter is used without @RequestParam #23

Closed
membersound opened this issue Aug 7, 2019 · 1 comment
Closed
Labels
enhancement New feature or request

Comments

@membersound
Copy link

v 1.1.7

The parameter of the first method is shown in swagger-ui, the 2nd method does not have any parameter. Again, the 3rd method shows the parameter.

@RestController
public class PersonServlet {
	@GetMapping(value = "/persons")
	public String persons(@NotBlank String name) {
		return "OK";
	}

	@GetMapping(value = "/persons2")
	public String persons2(@NotBlank @Parameter(description = "persons name") String name) {
		return "OK";
	}

	@GetMapping(value = "/persons3")
	public String persons3(@NotBlank @Parameter(description = "persons name") @RequestParam String name) {
		return "OK";
	}
}

{
   "openapi":"3.0.1",
   "info":{
      "title":"OpenAPI definition",
      "version":"v0"
   },
   "paths":{
      "/persons":{
         "get":{
            "operationId":"persons",
            "parameters":[
               {
                  "name":"name",
                  "in":"query",
                  "required":true,
                  "schema":{
                     "type":"string"
                  }
               }
            ],
            "responses":{
               "200 OK":{
                  "description":"default response",
                  "content":{
                     "*/*":{
                        "schema":{
                           "type":"string"
                        }
                     }
                  }
               }
            }
         }
      },
      "/persons2":{
         "get":{
            "operationId":"persons2",
            "responses":{
               "200 OK":{
                  "description":"default response",
                  "content":{
                     "*/*":{
                        "schema":{
                           "type":"string"
                        }
                     }
                  }
               }
            }
         }
      },
      "/persons3":{
         "get":{
            "operationId":"persons3",
            "parameters":[
               {
                  "name":"name",
                  "in":"query",
                  "description":"persons name",
                  "required":true,
                  "schema":{
                     "type":"string"
                  }
               }
            ],
            "responses":{
               "200 OK":{
                  "description":"default response",
                  "content":{
                     "*/*":{
                        "schema":{
                           "type":"string"
                        }
                     }
                  }
               }
            }
         }
      }
   },
   "components":{

   }
}
@springdoc
Copy link
Collaborator

The right description is Parameter missing if @parameter is used without name!
This feature will be availbale on v1.1.8

@springdoc springdoc added the enhancement New feature or request label Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant