2

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!

alonso_50
  • 1,442
  • 13
  • 16
  • Could you add an example from what you've tried? – jmattheis Feb 17 '17 at 13:39
  • 1
    In my entity object I tried with the next annotation: `@Entity @Api(value="activity Name", description="activity Description") public class Activity ` but it didn't worked. I did the same in Respository Rest interfaces, but it didn't work as well. – alonso_50 Feb 20 '17 at 15:01

1 Answers1

1

Use the @Api annotation with tags and description.

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

Please note that description is deprecated but it works.

muescha
  • 1,544
  • 2
  • 12
  • 22
ppushkar
  • 76
  • 2