alonso_50
alonso_50

Reputation: 1542

Changing Name and Description endpoint in Swagger-ui

I am using Spring boot and Spring Data Rest to implement my Rest API. To document it, I have been using Swagger, with these maven dependencies:

    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger2</artifactId>
        <version>2.6.1</version>
    </dependency>

    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger-ui</artifactId>
        <version>2.6.1</version>
    </dependency>

    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-data-rest</artifactId>
        <version>2.6.1</version>
    </dependency>

I would like to change and customize a bit my Swagger UI page. I want to change the name and the description it appears in the html page, concretely these names highlighted in red in the screenshot, but nothing works.

enter image description here

I've been trying adding the @Api annotation to my entities and repositories classes/interfaces, but nothing works.

Any idea about how to customize it?

Thanks!

Upvotes: 2

Views: 6404

Answers (1)

ppushkar
ppushkar

Reputation: 76

Use the @Api annotation with tags and description.

@Api(description="Device APIs", tags = "Device")

Please note that description is deprecated but it works.

Upvotes: 1

Related Questions