Generating REST API doc using swagger 0.9.1 for Spring MVC project - rest

For my project,I want to generate REST API doc using swagger.I found one example app here
But this example is using 0.5.2 version of swagger-springmvc.
This version is not compatible with my Spring project.
could someone please guide me about how to integrate swagger 0.9.1 in spring MVC?
Note : Mine is not a spring boot app.

Adrian, one of the contributors to swagger-springmvc, has a repository with sample projects.
You can find the repository here - https://github.com/adrianbk/swagger-springmvc-demo.
By the way, the link to that is available at the main README of the swagger-springmvc project.

Related

What is the difference between Spring Tool Suite 3 and 4?

I want to study Spring. In the case of STS (Spring Tool Suite) 3, there is "Spring legacy Project". 4 has a "Spring Starter Project", is it the same?
When I asked the Internet, people say "just use version 3".
What is the difference between version 3 and version 4?
Is "Spring Starter Project" and "Spring Legacy Project" the same thing?
1.What is the difference between version 3 and version 4?
Version 4.0 is the latest major release of the Spring Framework and the first to fully support Java 8 and few new features.[more]
Is "Spring Starter Project" and "Spring Legacy Project" the same thing?
Technically both are same spring project's. But they have some difference in configuration and build areas.
Spring Starter Project- Helps to create the spring boot project.(Spring Boot is basically an extension of the Spring framework which eliminated the boilerplate configurations required for setting up a Spring application.)
Spring Legacy Project - Helps to create the spring maven project. In which all the required configuration like servlet context,web,.. need to be configured manually either by using xml file or java classes.
Take a look at this page to know more about the difference between spring vs spring boot
If you are going to start learning spring from beginning, my suggestion is use Spring Starter Project because in Spring boot project setup is so simple, you can start coding with zero manual configuration.
For a more detailed introduction of the Spring Tools 4, please take a look at the blog post from the initial GA release of the Spring Tools 4:
https://spring.io/blog/2018/09/25/spring-tools-4-ga-released
There is no direct relation between the version numbers of the Spring Framework itself and the Spring Tools. In general, the Spring Tools 4 as well as the older Spring Tool Suite 3 support various Spring versions, ranging from Spring Framework 3 up to Spring Framework 5.2 and beyond.
I would strongly recommend to start with learning Spring by starting with Spring Boot, not the Spring Legacy projects. This is the way modern Spring applications are being built nowadays... :-)

API Testing with BDD

We are using Cucumber in Java with Maven. I am looking to build the framework for Rest Api's with BDD. Can you please help me and share any existing framework for API testing
Why don't you take a look at Ginkgo4j. This is a Java BDD framework based on Ruby's RSpec. Can be combined with library's like RestAssured to test REST APIs.

CRUD using Grails 3.1.x Spring Security with Rest

Trying to develop a web CRUD application using Grails 3.1.X Spring Security with REST.
Any tutorials with examples would help me.
The Spring Security Core plugin (http://grails-plugins.github.io/grails-spring-security-core/v3/index.html) is a good place to start.

Spring MVC - GWT integration Using Spring STS

I have a spring mvc-based application using spring STS.
I want to integrate it with GWT , so I can build nice UI.
I saw this.
From this thread
But they weren't using spring sts, and the post is almost 5 years old.
My question is:
Should I stay in my spring mvc project, or should I open a GWT project?
In case I can stay with my spring mvc project, what are the steps I need to do, to perform a connection between my GWT client and my spring Service tier?
Any code example or tutorials will be great!
You can integrate GWT with Spring MVC using Spring MVC REST and GWT JavaScriptObjects.
Take a look at the following GitHub code.
For a more "complicated" example of using JavaScriptObject, look here.

Spring installation with Eclipse

I have downloaded and installed Spring STS for Eclipse...
But when I've Created a Spring Project I can't to
import org.springframework.context.ApplicationContext;
So I tried to add library like spring.jar but I couldn't find this jar.(properties-->java build path-->libraries)
What's wrong with this setting? Or my installation is not ended?
Spring STS is only a Eclipse plugin which helps the developer managing spring beans. It is not mandatory for developing a spring-based application.
So your second approach was the right one to add the spring library. You can download spring here: Spring Downloads and then add it as a library to your project.
But serious... I would encourage you to do a tutorial first: http://www.springsource.org/tutorials
Plugins does not includes library of spring.
Plugin is only to manage the reference of configuration in your project build in eclipse.
Libraries are actual jar file which is required at compile as well as run time.
If you skip the plugin installation then your code will work if your configuration is correct
But if you skip spring library installation or download then your code will not compile of run.
Please go through step by step tutorial by following these tutorial
Spring Step By Step Tutorial