-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
I have following resources in my project (simplified real case):
First one is the base class which has common property for all REST resources in the project.
public class BaseResource {
@ApiParam("The Idendifier of entity")
@PathParam("id")
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}- The Book resource.
@Api(value = "Books", description = "Book management")
@Path("/{id}/v1/books/")
public class BookResource extends BaseResource {
@GET
@Path("{name}")
@Produces("text/plain")
@ApiOperation(value = "Returns book id and name")
@ApiResponses(value = {
@ApiResponse(code = 201, message = "Completed Successfully", response = String.class)})
public String getIt(@ApiParam("The books name") @PathParam("name") final String name) {
return "Hi there " + name + ", id " + getId();
}
}- The Users resource
@Api(value = "Users", description = "Users management")
@Path("/{id}/v1/users/")
public class UserResource extends BaseResource {
@GET
@Path("{name}")
@ApiOperation(value = "Returns user id and name")
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Completed Successfully", response = String.class)})
public String getName(@ApiParam("User name") @PathParam("name") final String name) {
return "Hello user " + name + ", id " + getId();
}
}I would expect to see the {id} parameter in Swagger-UI, while it skipped and not presented, as well there is no such parameter in generated swagger.json. In previous versions of Swagger 1.2 and 1.1 it worked as expected.
This is how it looks like:
Swagger version I'm using is:
<dependency>
<groupId>com.wordnik</groupId>
<artifactId>swagger-jersey-jaxrs</artifactId>
<version>1.5.3-M1</version>
</dependency>