Api annotation's description is deprecated

前端 未结 5 782
南方客
南方客 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 07:58

    The reason why it's deprecated is that previous Swagger versions (1.x) used the @Api description annotation to group operations.

    In the Swagger 2.0 specification, the notion of tags was created and made a more flexible grouping mechanism. To be API compliant, the description field was retained so upgrades would be easy, but the correct way to add a description is though the tags attribute, which should reference a @Tag annotation. The @Tag allows you to provide a description and also external links, etc.

提交回复
热议问题