Springfox:带标题的描述

我们如何在描述中获得多个标题,如下所示:

description: |
The Engine API  ....

# Errors

The API uses standard HTTP status codes ...


# Versioning

Some other text

在上面的示例中,错误和版本控制是两个标头。

当前,我正在添加如下描述:

ApiInfoBuilder().description(" ... ")
longsheng923123 回答:Springfox:带标题的描述

您可以像这样使用markdown:

String description = "# The Engine API  ...\n" +
        "## Errors\n" +
        "The API uses standard HTTP status codes ...\n" +
        "## Versioning\n" +
        "Some other text\n";

\n新行在这里很重要。

或者只是使用纯HTML:

String description = "<h2>The Engine API  ....</h2>" +
        "<h3>Errors</h3>" +
        "<p>The API uses standard HTTP status codes ...</p>" +
        "<h3>Versioning</h3>" +
        "<p>Some other text</p>";

然后将字符串添加到API信息:

ApiInfoBuilder().description(description)
本文链接:https://www.f2er.com/3157955.html

大家都在问