JavaSpring.libraries.spring-boot.README.mustache Maven / Gradle / Ivy
{{^interfaceOnly}}# OpenAPI generated server
Spring Boot Server
## Overview
This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework.
{{#springFoxDocumentationProvider}}
The underlying library integrating OpenAPI to Spring Boot is [springfox](https://github.com/springfox/springfox).
Springfox will generate an OpenAPI v2 (fka Swagger RESTful API Documentation Specification) specification based on the
generated Controller and Model classes. The specification is available to download using the following url:
http://localhost:{{serverPort}}/v2/api-docs/
**HEADS-UP**: Springfox is deprecated for removal in version 6.0.0 of openapi-generator. The project seems to be no longer
maintained (last commit is of Oct 14, 2020). It works with Spring Boot 2.5.x but not with 2.6. Spring Boot 2.5 is
supported until 2022-05-19. Users of openapi-generator should migrate to the springdoc documentation provider which is,
as an added bonus, OpenAPI v3 compatible.
{{/springFoxDocumentationProvider}}
{{#springDocDocumentationProvider}}
The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org).
Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes.
The specification is available to download using the following url:
http://localhost:{{serverPort}}/v3/api-docs/
{{/springDocDocumentationProvider}}
{{#sourceDocumentationProvider}}
The OpenAPI specification used to generate this project is available to download using the following url:
http://localhost:{{serverPort}}/openapi.json
{{/sourceDocumentationProvider}}
Start your server as a simple java application
{{#useSwaggerUI}}
You can view the api documentation in swagger-ui by pointing to
http://localhost:{{serverPort}}/swagger-ui.html
{{/useSwaggerUI}}
Change default port value in application.properties{{/interfaceOnly}}{{#interfaceOnly}}
# OpenAPI generated API stub
Spring Framework stub
## Overview
This code was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
By using the [OpenAPI-Spec](https://openapis.org), you can easily generate an API stub.
This is an example of building API stub interfaces in Java using the Spring framework.
The stubs generated can be used in your existing Spring-MVC or Spring-Boot application to create controller endpoints
by adding ```@Controller``` classes that implement the interface. Eg:
```java
@Controller
public class PetController implements PetApi {
// implement all PetApi methods
}
```
You can also use the interface to create [Spring-Cloud Feign clients](http://projects.spring.io/spring-cloud/spring-cloud.html#spring-cloud-feign-inheritance).Eg:
```java
@FeignClient(name="pet", url="http://petstore.swagger.io/v2")
public interface PetClient extends PetApi {
}
```
{{/interfaceOnly}}
{{#virtualService}}
## Virtualan :
You can view Virtualan UI by pointing to
http://localhost:8080//virtualan-ui.html
How to use guide available in the Virtualan wiki
https://github.com/virtualansoftware/virtualan/wiki
{{/virtualService}}