swagger.json not getting created.
See original GitHub issueI am in a spring boot + jersey app, using this version of swagger.
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-jersey2-jaxrs</artifactId>
<version>1.5.6</version>
</dependency>
I have read the docs, and configured swaggers as so:
@Configuration
public class AppConfig {
@Configuration
static class JerseyConfig extends ResourceConfig {
public JerseyConfig() {
register(MyResource.class);
register(HealthCheckResource.class);
configureSwagger();
}
private void configureSwagger() {
register(ApiListingResource.class);
register(SwaggerSerializers.class);
BeanConfig beanConfig = new BeanConfig();
beanConfig.setVersion(1.0);
beanConfig.setSchemes(new String[]{"http"});
beanConfig.setHost("localhost:9000");
beanConfig.setBasePath("/api");
beanConfig.setResourcePackage("com.my.resources");
beanConfig.setPrettyPrint(true);
beanConfig.setScan(true);
}
}
}
I have added @Api to the resource class, and I see swagger reading my resources in the logs. However, swagger.json is never created? Where do I go from here? I don’t see any errors.
Issue Analytics
- State:
- Created 8 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
ASP.NET Core - Swashbuckle not creating swagger.json file
1) Navigate to the localhost:xxxx/swagger · 2) Open Developer tools · 3) Click on the error shown in the console and you will...
Read more >Swagger.json not generated · Issue #470 - GitHub
Swagger.json is all in memory. You'll never see a fire. It appears you're missing app.UseSwagger(); in Configure. You added the UI but not...
Read more >Swagger.json file is not generated - Google Groups
swagger.json file is not generated under http://{localhost:8081}/Test and also not getting any error in console, everything processed properly.
Read more >fetch error not found /swagger/v1/swagger.json - You.com
Your swagger end-point has the wrong Url, hence the 'Not Found' Error. Swagger documents constructed via the default way have their url in...
Read more >Configuring and Using Swagger UI in ASP.NET Core Web API
GET THE BOOK <<. In the Configure() method, let's enable the middleware for serving the generated JSON document and the Swagger UI:.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The swagger.json doesn’t generate a file on your file system. it’s just a resource like any other jax-rs resource you expose via jersey. the basePath doesn’t affect where the swagger.json is located, but it is the context root of your application (
/test
according to what you said?).Based on that info, you should find it at http://localhost:9000/test/swagger.json
I deployed swagger in wildfly server i am not able to see documentation.
Error: not able to read localhost:9090/projectname/swagger-ui.json