0

We are trying to generate swagger documentation for our project. It's springboot project but it has JAX-RS annotations like @Path, @Get, @Post etc.

We have added modified SpringBootApplication.java file to include swagger configurations like -

@EnableAutoConfiguration
@ComponentScan
@ImportResource({"/spring/context.xml"})
@OpenAPIDefinition(info = @Info(title = "MFSWalletServ API's", version = "1.0", 
    description = "API Information"),
    servers = { @Server(description = "local", url = "http://localhost:8080"),
    @Server(description = "Stage", url = "https://msmaster.qa.paypal.com:12326")})

public class SpringBootApplication extends SpringBootServletInitializer {

    public static void main(String[] args) throws IOException {
          SpringApplication.run(RaptorApplication.class);
    }

}

Swagger page is showing up but no API's are coming up.

Current Swagger page

We might have to add some property or something to tell swagger where(package) to look for API's - but i am not sure where to add them. How can i add swagger documentation for our API's ?

Sanchit Jain
  • 119
  • 3
  • 15
  • Are you using Spring Fox? check [this](https://stackoverflow.com/a/36104935/1442853) answer. – Pablo Jan 27 '22 at 00:40
  • @Pablo: We are using open-api, but have tried springfox too. We looked at it and tried that approach; but it wasn't working for us – Sanchit Jain Jan 27 '22 at 01:05
  • Please update your question with your project structure, a controller code and the pom with the related dependencies – Pablo Jan 27 '22 at 15:58
  • Please consider using `springdoc` instead of `springfox`. Take a look at https://stackoverflow.com/a/70178391/16572295 to find some more details. – João Dias Jan 27 '22 at 19:43

0 Answers0