I have a spring boot application that has swagger documentation enabled using springdoc-openapi. For some reason there is an endpoint called /application.wadl is getting created automatically without adding any logic. Is there any way to disable wadl endpoints? I didn't add specific Wadl configuration in application.yml file as well
I managed to find a workaround after looking into the springdoc-openapi documentation. We can use springdoc.packages-to-scan property to scan only controller package as shown below
springdoc:
packages-to-scan:
- com.test.appName.controller
Related
I am using spring boot in which I wanted to dynamically generate open api 3 specification by uploading json/yml and view in swagger ui
upload json/yml
dynamically generate swagger /open api specification
3.view in swagger ui
Is there any approach /plugin available to implement this?
similar implementation as swagger Interceptor but our workstation does not allow to use interceptor. so we are generating our own tool
After migration of Spring Boot to version 3.1 and springdoc-openapi libraries to 1.4.1:
springdoc-openapi-ui
springdoc-openapi-security
springdoc-openapi-data-rest
I faced issue ClassNotFoundException: org.springframework.data.rest.webmvc.support.DefaultedPageable
Also now on Swagger UI page controllers and schemas for #Entity are generated, however earlier there were only endpoints from #RestController, request and response DTOs. Are there any way to disable it?
From your description, you don't need to load springdoc-openapi-data-rest. (You will load unecessary beans related to spring-data-rest)
If you just need to enable the support of Pageable, you can just add the following line:
SpringDocUtils.getConfig().replaceWithClass(org.springframework.data.domain.Pageable.class, Pageable.class);
This is explained here: https://springdoc.org/
Section [Spring Data Rest support]
Or, if you want to depend on spring-boot-starter-data-rest, then add the dependency.
I have a springboot application with springfox swagger 2.9.2, for one of my microservice the swagger base url generated in the swagger docs is appending "/v2/api-docs" at the end, for seemingly no apparent reason.
Here is what my application properties file looks like
spring.profiles.active=dev
server.contextPath=/xxxxxxxxxxxx-enterprise/v2/sas
server.port=8070
I have a feeling I am missing something silly.
Because this is the swagger service descriptions default path
From Springfox documentation: https://springfox.github.io/springfox/docs/snapshot/#customizing-the-swagger-endpoints
This can be customized by overriding "springfox.documentation.swagger.v2.path" property
I am using apache camel REST DSL using springboot. All the configuration works fine. Now I want to add REST documentation using camel swagger java component. The REST DSL and swagger java, works out of the box. I can see the JSON output of the exposed REST services.
Now Question, what steps I need to follow, such that i can view camel REST documentation using swagger-ui?
I searched for answers, however the only solution was to download swagger-ui from github and "copy" <dist> folder to project, this doesn't seems to work, getting 404. URL i am using is localhost:8081\rest\index.html.
I liked the spring-fox swagger2, is it something can be supported in camel?
See this example which includes swagger ui.
https://github.com/apache/camel/tree/master/examples/camel-example-swagger-xml
The index.html file has more details how to access the swagger ui when the application runs.
I'm using Spring Boot in STS to build a simple REST API.
I have some basic security requirements, similar to the ones described in the original post here: RESTful Authentication via Spring
The accepted answer above seems like a valid solution but does not translate to Spring Boot due to the lack of XML configuration.
How would I configure my Spring Boot application in the same manner?
You can use the same code as in that post if you want (are you sure that's what you want?) with #Configuration. The HttpSecurity builder has methods addFilter(), addFilterBefore(), addFilterAfter(), so you use those instead of the <custom-filter/> element in XML. Most (if not all) XML elements translate pretty directly into Java config.