Forum Discussion

kushsharma10001's avatar
New Member
4 years ago

Generate swagger ui docs for API exposed in a class if multiple class are available in same package


I have 3 controller classes in my Springboot project exposing APIs. I have a query regarding configuring the SwaggerConfig class. I wish to generate the swagger ui docs for the apis exposed in ISECC class only. Now, I have 2 issues:


1) I have multiple classes exposing APIs within the same package. Hence, I strictly want to generate swagger ui docs for APIs in only 1 class i.e. ISECC class.

2) I have path variables and query variables in my api for which I wish to expose the swagger ui docs. I am not sure is this possible.

GET (ist/v1.0/{tenantID}/capabilities/{capability})
GET (ist/v1.0/{tenantID}/capabilities)
GET (ist/v1.0/capabilities) @RequestParam(capabilityName)

PUT (ist/v1.0/tenants/{tenantId}) @requestbody
GET (ist/v1.0/dependencies)
DELETE (ist/v1.0/tenants/{tenantId})

PUT (ist/v1.0/capabilities) @requestbody
DELETE (ist/v1.0/capabilities) @requestbody
GET (ist/v1.0/capabilities)


How can I achieve this? What should i write in apis() and paths():

public class SawggerConfig {
public Docket databaseApi() {
return new Docket(DocumentationType.SWAGGER_2).select()

No RepliesBe the first to reply