swagger ui not working for swagger version 2 - tomcat7

I am currently working on a project involving spring-boot and swagger. I have upgraded my maven spring boot project to the latest Swagger using the link Upgrade to version2.
I am currently using the Swagger-UI which I have configured from the link Swagger-UI with Spring Boot
I try to access the url : localhost:8080/swagger/index.html after deploying the app successfully on my tomcat server. Unfortunately, it does not work and I am unable to view the swagger-ui in my browser. How do I go on about it further?

I think you're mixing the documentation of 2 versions of the library. The second link points to an older version of the springfox library. Please follow the instructions in the latest snapshot of the documentation. If you've configured everything correctly you should see the swagger-ui at http://localhost:8080[/CONTEXT-PATH]/swagger-ui.html. Depending on how you've set your springboot app the context path is optional.

Related

Spring Boot graphiql not working when running a Jar but works on IntelliJ

I have a basic spring boot 2.7 project with graphql.
I can access the /graphiql console from the path http://localhost:8080/graphiql?path=/graphql when running the project on intellij but I get 404 when running a jar file.
GraphiQL is not enabled by default and this needs to be activated using spring.graphql.graphiql.enabled=true.
Your application is probably using devtools, which enables GraphiQL for development purposes. See Spring Boot reference documentation.

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)

Spring Boot -1.5.3.Release Version - Enabled with Security Features?

I use Spring Boot - 1.5.3.Release Version for my project. Simply tested my demo application with Actuator and Dev-tools plugin from spring boot initializer site. (Hence I no longer needed to share my POM, as it is default).When I launch my application and try to hit the metrics End Point URL, I get this 401 Unauthorized status (image given below).
Following Options Tried to Bypass this exception
I excluded the SecurityAutoConfiguration on my main Class.
#SpringBootApplication
#EnableAutoConfiguration(exclude= {org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration.class})
public class MainConfig {
But the above option didn't work.
When I downgrade my Spring-Boot - 1.4.6.RELEASE Version, I didn't get the UnAuthorized Exception. My Application worked like a charm :-)
Questions
Is there any Specific Security Enhancements have been made in the latest release of Spring-Boot (1.5.3.RELEASE Version)?
If at all any enhancements made, let know the community on how to bypass such kind of exceptions?
I also, noticed that when using Spring-boot (1.5.3.RELEASE) it doesn't show any exceptions on startup, even though I have multiple main program in my IDE build path. Is that also an enhancement is spring-boot (1.5.3.RELEASE) version?
Kindly clarify.
From the Spring Boot 1.5 Release Notes:
If you’re upgrading a Spring Boot 1.4 application that doesn’t have dependency on Spring Security and you wish to retain open access to your sensitive endpoints you’ll need to set management.security.enabled to false.

how to deploy Spring boot actuate application in external tomcat server

Im trying to just use the basic endpoints that comes with spring actuate and want to deploy in the external tomcat server without using spring boot. How to achieve this, could anyone help me please. Is there any configuration changes that I need to do. This website gives an idea but it uses older version of spring-boot-actuate. Also EndpointHandlerMapping and EndpointHandlerAdapter doesnt come with newer version of spring boot actuate.
Anyways I get 404 resource not found when deploying to the server.
Check out this question to see if it helps you. The Actuator component is a Spring Boot feature but you can use individual components within an existing application with the right build and configuration setups.

Google app engine compatibility with Spring framework

I have started developing a web app using google app engine and Spring 4. But now i have understood that Spring 4 does't fully support with Google app engine.
Now i need the latest version of Spring framework that fully support with google app engine.
Can someone please help me?
You'll find the list of Spring supported modules and versions in this
link :
Spring MVC
Version 2.5.6
Status COMPATIBLE
Spring ORM
Version 2.5.6
Status COMPATIBLE
Spring Security
Version(s) ?
Status SEMI-COMPATIBLE
To work around a ClassNotFoundException, you can use a re-compiled version of the library which adds a StringInsensitiveComparator class .
For more details check out this link.
Hope it helped, Good luck

Resources