Closed andyndang closed 3 years ago
As a workaround, I was able to redundantly add a path parameter annotation to remove the extra body parameter.
@Post("/nouns/{noun_id}/link")
// Parameter is redundant, but cannot remove until the below bug is fixed
// https://github.com/micronaut-projects/micronaut-openapi/issues/402
fun linkNoun(@Parameter(`in` = ParameterIn.PATH) @PathVariable("noun_id") nounId: String): HttpResponse<Unit> {
return HttpResponse.ok()
}
Thanks for reporting an issue, please review the task list below before submitting the issue. Your issue report will be closed if the issue is incomplete and the below tasks not completed.
NOTE: If you are unsure about something and the issue is more of a question a better place to ask questions is on Stack Overflow (https://stackoverflow.com/tags/micronaut) or Gitter (https://gitter.im/micronautfw/). DO NOT use the issue tracker to ask questions.
Task List
Steps to Reproduce
Create a Post API with a single parameter and without any request body
Expected Behaviour
API should look like this:
Actual Behaviour
requestBody
is addedEnvironment Information
Example Application
https://github.com/andyndang/micronaut-swagger-yml-bug/tree/89b20c9451f333e8fb17678cff0ca6ac063a415f
2.1.0 YAML: https://github.com/andyndang/micronaut-swagger-yml-bug/blob/89b20c9451f333e8fb17678cff0ca6ac063a415f/schema_2.1.0.yml
2.2.0 YAML: https://github.com/andyndang/micronaut-swagger-yml-bug/blob/89b20c9451f333e8fb17678cff0ca6ac063a415f/schema_2.2.0.yml