Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3637

Showing nothing in api-docs while creating Swagger API documentation

$
0
0

The problem is that api-docs is being generated when I don't add .type() and .outType() but the format of the post request is not there. After adding them just like in the below statement api-docs is not being generated when I hit http://localhost:8080/api-docs URL.

rest("/accor")       .post("/hotel/details")       .consumes("application/json")       .type(SearchParam.class)       .outType(SearchParam.class)       .to(URI);

My Camel configuration is as shown below:

private RestConfiguration createRestConfiguration(CamelContext camelContext) throws Exception {    RestConfiguration restConfiguration = new RestConfiguration();    return new RestConfigurationDefinition()            .component("jetty")            .scheme(serverConfiguration.getScheme())            .host(serverConfiguration.getHost())            .port(serverConfiguration.getPort())            .bindingMode(RestBindingMode.off)            .enableCORS(true)            .apiContextPath("/api-docs") // Swagger API docs path            .apiProperty("api.title", "ACCOR Rest API")            .apiProperty("api.version", "1.0")            .asRestConfiguration(camelContext, restConfiguration);}

I am attaching the images of the api-docs in both the scenarios.

Below images is when I have added the lines for the output format.

This image is when I have added the lines for the output format

This image is when I removed those lines

Below I have added in the pom.xml file for Swagger.

<dependency><groupId>org.apache.camel</groupId><artifactId>camel-openapi-java</artifactId><version>${camel.version}</version> <!-- Replace with your Camel version --></dependency>

I am using Spring Boot 2 and OpenAPI version 3.14.


Viewing all articles
Browse latest Browse all 3637

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>