how to ensure completeness of Swagger documentation in spring project. - validation

I am using swagger for documentation in my spring project for Rest.
Is there a way to check completeness of this documentation when a new code or end point is introduced ?

Related

Upgrade from SpringFox2.x to SpringFox3.0 open API

We are trying upgrade SPringFox2.0 to 3.0 Open API Specification. But when we generate open doc using '' url it is showing version as 2.0. Not sure why the version still pointing to old version.
We are using Springboot application
I followed the below steps to upgrade as per spring fox documentation
[http://springfox.github.io/springfox/docs/current/][1]
"2.1.3. Migrating from existing 2.x version"
Spring Boot Applications
1.Remove library inclusions of earlier releases. Specifically remove springfox-swagger2 and springfox-swagger-ui inclusions.
2.Remove the #EnableSwagger2 annotations
3.Add the springfox-boot-starter
4.Springfox 3.x removes dependencies on guava and other 3rd party libraries (not zero dep yet! depends on spring plugin and open api libraries for annotations and models) so if you used guava predicates/functions those will need to transition to java 8 function interfaces
I followed all the steps above, 'http://localhost:XXXX/api/v1/api-docs?group=API_Version_1' it got generated but version is showing 2.0
{"swagger":"2.0","info":{ ........
And also I modified in SwaggerConfig: DocumentationType.SWAGGER_2 TO DocumentationType.OAS_30 (it is not mentioned documentation, I guess they missed it)
I believe still some thing is missing, Spring Fox documentation is still out of date and poor coverage of 3.0 aspects.
I am wondering any one having same problem?
Try to use /v3/api-docs or /api/v3/api-docs in your case.
That did not work.
As per Spring fox documentation:
"The /v2/api-docs URL is the default that SpringFox uses for documentation. The v2 does not refer to your API's documentation version (which can be changed in the Docket configuration), but the version of the Swagger specification being used..."
springfox.documentation.swagger.v2.path=/my/docs (path of yours)

How to generate swagger document for functional variant of webflux

How to generate swagger documents for functional variant of Webflux
which defines routes like
RouterFunctions.route(POST("/createEmployee")...).andRoute(GET("/getAllEmployee")...)
I have tried the Spring Boot 2.0.4.RELEASE and Springfox 3.0.0-SNAPSHOT. But it doesn't recognize the endpoints.
As far as I know this is not supported yet. See https://github.com/springfox/springfox/issues/2632
It seems that now is possible, take a look on this https://springdoc.org/

Correct guide about spring Oauth 2

I'm studying in details the use of spring security (not only oauth), so I'm following this official guide: https://docs.spring.io/spring-security/site/docs/current/reference/htmlsingle.
This guide have Oauth section and following it I got everything works. But after another research in internet a found a another guide (from pivotal too): https://spring.io/guides/tutorials/spring-boot-oauth2/.
This second guide use others classes that don't exist in first guide, and other way to configure spring Oauth.
I'm very confused what guide should I follow and what is "more correct".
Both guides are correct.
The first guide you mentioned (https://docs.spring.io/spring-security/site/docs/current/reference/htmlsingle) uses the newer OAuth 2.0 functionality in the Spring Security project, so it's recommended you use that one.
To give you some background, functionality from the Spring Security OAuth project is being migrated to core Spring Security.
The first guide you mentioned uses core Spring Security, and the second guide uses the Spring Security OAuth project.
For more information on the features available in the various projects, as well as FAQs, you can check out the OAuth 2.0 Features Matrix.

using apache camel REST DSL using restlet adding swagger

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.

Apache Wink integration with Swagger

I am trying to use Swagger in the existing Wink restful web services. I have done all the annotations as mentioned in the swagger documentation but now I need to integrate the rest of the stuff. E.g. configuring the swagger UI, setting up the swagger configurations during server startup etc. Can any one point me to any documentation or provide some steps to follow?
I have just made a project for Apache Wink. You can find it below
https://github.com/zouzias/swagger-jaxrs-wink
I will push it to the swagger-core samples collections asap as well.

Resources