Api annotation's description is deprecated

前端 未结 5 774
南方客
南方客 2021-01-31 07:12

In Swagger, the @Api annotation\'s description element is deprecated.

Deprecated. Not used in 1.5.X, kept for legacy support.

5条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-31 08:01

    I too wondered what to do about uses of the deprecated description (showing up as warnings in my IDE).

    Well, on closer inspection it turned out that description is not used anywhere in Swagger UI. After that the solution (in our case*) became clear: simply remove those descriptions.

    (*In our codebase, with clean class and method names etc, there was certainly no need for such "API descriptions" for the reader of the code. I would have tolerated having these bits of Swagger-related noise in the codebase if they added some value in Swagger UI, but since they didn't, the only sensible thing was to throw them away.)

提交回复
热议问题