Forum Discussion
Hi rajiadi ,
I believe the best docs are still here: https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-Jersey-2.X-Project-Setup-1.5
I'm not sure if you can configure the `/swagger.json` path, but you can change the path of where your API will be exposed (and swagger.json would be at the root of that path).
And as for the warnings.. swagger 2.0 is the oldest supported version of the specification in SwaggerUI. The is also OpenAPI 3.0 and (soon support for the latest) OpenAPI 3.1.
Swagger Core's does support both Swagger 2.0 and OpenAPI 3.0, so you should be able to use that in your Jersey 2.x
Hi ponelat, thanks for the response. But in this document, it asks us to configure the swagger url with /rest/ . Is there any way I can use something else instead of rest in the path? say /api/? It doesn't work if there is no /rest/ in the path
- ponelat2 years agoStaff
rajiadi sounds like you're looking to change the `basePath`.
You can do so via web.xml, see: https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-Jersey-2.X-Project-Setup-1.5#using-swaggers-servlet-in-the-webxml
Replace
<param-value>http://localhost:8080/api</param-value>
With the value you need, perhaps: `http://localhost/rest`?
Or you can change it via beanConfig, see: https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-Jersey-2.X-Project-Setup-1.5#using-swaggers-beanconfig
beanConfig.setBasePath("/rest");
Related Content
- 4 years ago
- 2 years ago
- 3 years ago