Skip to content

Commit

Permalink
Java generators: use codegen fields in mustable
Browse files Browse the repository at this point in the history
  • Loading branch information
jpfinne committed Jun 14, 2024
1 parent 24ca32a commit 1fdeca5
Showing 1 changed file with 45 additions and 18 deletions.
63 changes: 45 additions & 18 deletions samples/openapi3/client/petstore/spring-cloud-3/README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,53 @@
# OpenAPI generated API stub
# spring-cloud-oas3

Spring Framework stub
## Requirements

Building the API client library requires [Maven](https://maven.apache.org/) to be installed.

## 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.
## Installation

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
}
To install the API client library to your local Maven repository, simply execute:

```shell
mvn install
```

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

```shell
mvn deploy
```

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 {
Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information.

}
### Maven users

Add this dependency to your project's POM:

```xml
<dependency>
<groupId>org.openapitools.openapi3</groupId>
<artifactId>spring-cloud-oas3</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
```

### Gradle users

Add this dependency to your project's build file:

```groovy
compile "org.openapitools.openapi3:spring-cloud-oas3:1.0.0"
```

### Others

At first generate the JAR by executing:

mvn package

Then manually install the following JARs:

* target/spring-cloud-oas3-1.0.0.jar
* target/lib/*.jar

0 comments on commit 1fdeca5

Please sign in to comment.