Closed dgiwerzew closed 1 year ago
Hi,
we use in our project spring boot 3.0.2 and springdoc-openapi (springdoc-openapi-starter-webmvc-ui) 2.0.2.
Since the springdoc-openapi 2.0.1 there is a following issue. This declaration
@Operation(summary = "test update book", parameters = { @Parameter(name = "id", description = "Id of a book", in = ParameterIn.PATH, example = "1" ) } ) @PutMapping(value = "/{id}", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) public BookDto updateBook( @PathVariable long id, @RequestBody BookEditDto bookEditDto) { return new BookDto(); }
Leads to this api-doc result:
"parameters":[ { "name": "id", "in": "path", "description": "Id of a book", "required": true, "example": 1 }, { "name": "arg0", "in": "path", "required": true, "schema": { "type": "integer", "format": "int64" } } ]
If a @Parameter declaration will be moved to the method definition like this
@Parameter
@Operation( summary = "test update book ) @PutMapping(value = "/{id}", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) public BookDto updateBook( @Parameter(name = "id", description = "Id of a book", in = ParameterIn.PATH, example = "1" ) @PathVariable long id, @RequestBody BookEditDto bookEditDto) { return new BookDto(); }
Then the api-doc result is correct:
"parameters":[ { "name": "id", "in": "path", "description": "Id of a book", "required": true, "schema": { "type": "integer", "format": "int64" }, "example": 1 } ]
The question is: why the @Parameter declaration inside of @Operationdoes not work properly anymore?
@Operation
Thank you in advance!
Kind regards, Dimitri Giwerzew
sorry, it was the wrong repositoriry. I have created a new issue in the springdoc-openapi: https://github.com/springdoc/springdoc-openapi/issues/2081
Hi,
we use in our project spring boot 3.0.2 and springdoc-openapi (springdoc-openapi-starter-webmvc-ui) 2.0.2.
Since the springdoc-openapi 2.0.1 there is a following issue. This declaration
Leads to this api-doc result:
If a
@Parameter
declaration will be moved to the method definition like thisThen the api-doc result is correct:
The question is: why the
@Parameter
declaration inside of@Operation
does not work properly anymore?Thank you in advance!
Kind regards, Dimitri Giwerzew