'How to migrate Springfox' @Api to Springdoc's @Tag?
Manual just says replace @Api
-> @Tag
. But @Api
has produces
and consumes
parameters, while @Tag
has obligatory name
parameter. How to migrate
@Api(produces = MediaType.APPLICATION_JSON_VALUE,
consumes = MediaType.APPLICATION_JSON_VALUE)
then?
Solution 1:[1]
Produces and Consumes should be set at the API-level not only for the documentation. Springdoc deduces the same from the controller-mapping annotation for the method.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Debargha Roy |