Héctor
Héctor

Reputation: 26034

Swagger is not generating @Api resources

I'm trying to integrate Swagger to document my REST API. I have followed this tutorial verbatim: http://jakubstas.com/spring-jersey-swagger-configuration/ and it works peroperly. I see:

{
    apiVersion: "1.0",
    swaggerVersion: "1.2"
}

Now, I want to register one endpoint:

@Path("endpoint")
@Api(value = "/endpoint", description = "My first documented endpoint")
public class MyEndpoint {
  //METHODS
}

But when I navigate to api-doc URL, it still returns the same:

{
    apiVersion: "1.0",
    swaggerVersion: "1.2"
}

My endpoint resource is inside the correct package. What am I doing wrong?

Thanks.

Upvotes: 0

Views: 578

Answers (1)

Héctor
Héctor

Reputation: 26034

Solved. I have added an @ApiOperationon my @GET method and it is working now. It is needed at least one operation so that Swagger can document it.

Upvotes: 1

Related Questions