Skip to content

Commit 879439e

Browse files
committed
update samples
1 parent 60780a1 commit 879439e

10 files changed

Lines changed: 64 additions & 135 deletions

File tree

bin/configs/spring-boot-byte-format-edge-cases-reactive.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ additionalProperties:
77
snapshotVersion: "true"
88
hideGenerationTimestamp: "true"
99
reactive: true
10+
interfaceOnly: "true"
11+
requestMappingMode: "none"

bin/configs/spring-boot-byte-format-edge-cases.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ additionalProperties:
66
artifactId: springboot
77
snapshotVersion: "true"
88
hideGenerationTimestamp: "true"
9+
interfaceOnly: "true"
10+
requestMappingMode: "none"
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
README.md
22
pom.xml
3-
src/main/java/org/openapitools/OpenApiGeneratorApplication.java
4-
src/main/java/org/openapitools/RFC3339DateFormat.java
53
src/main/java/org/openapitools/api/ApiUtil.java
64
src/main/java/org/openapitools/api/CoverageApi.java
75
src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java
8-
src/main/java/org/openapitools/configuration/HomeController.java
96
src/main/java/org/openapitools/model/FormParamsRequest.java
107
src/main/java/org/openapitools/model/MultipartMixedRequestMarker.java
118
src/main/java/org/openapitools/model/MultipartMixedStatus.java
12-
src/main/resources/application.properties
13-
src/main/resources/openapi.yaml
14-
src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
1-
# OpenAPI generated server
21

3-
Spring Boot Server
2+
# OpenAPI generated API stub
43

5-
## Overview
6-
This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
7-
By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
8-
This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework.
4+
Spring Framework stub
95

106

11-
The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org).
12-
Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes.
13-
The specification is available to download using the following url:
14-
http://localhost:8080/v3/api-docs/
7+
## Overview
8+
This code was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
9+
By using the [OpenAPI-Spec](https://openapis.org), you can easily generate an API stub.
10+
This is an example of building API stub interfaces in Java using the Spring framework.
1511

16-
Start your server as a simple java application
12+
The stubs generated can be used in your existing Spring-MVC or Spring-Boot application to create controller endpoints
13+
by adding ```@Controller``` classes that implement the interface. Eg:
14+
```java
15+
@Controller
16+
public class PetController implements PetApi {
17+
// implement all PetApi methods
18+
}
19+
```
1720

18-
You can view the api documentation in swagger-ui by pointing to
19-
http://localhost:8080/swagger-ui.html
21+
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:
22+
```java
23+
@FeignClient(name="pet", url="http://petstore.swagger.io/v2")
24+
public interface PetClient extends PetApi {
2025

21-
Change default port value in application.properties
26+
}
27+
```

samples/server/petstore/springboot-byte-format-edge-cases-reactive/pom.xml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,16 @@
2323
<sourceDirectory>src/main/java</sourceDirectory>
2424
<plugins>
2525
<plugin>
26-
<groupId>org.springframework.boot</groupId>
27-
<artifactId>spring-boot-maven-plugin</artifactId>
28-
<configuration>
29-
</configuration>
26+
<groupId>org.apache.maven.plugins</groupId>
27+
<artifactId>maven-source-plugin</artifactId>
28+
<executions>
29+
<execution>
30+
<id>attach-sources</id>
31+
<goals>
32+
<goal>jar</goal>
33+
</goals>
34+
</execution>
35+
</executions>
3036
</plugin>
3137
</plugins>
3238
</build>

samples/server/petstore/springboot-byte-format-edge-cases-reactive/src/main/java/org/openapitools/api/CoverageApiController.java

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
README.md
22
pom.xml
3-
src/main/java/org/openapitools/OpenApiGeneratorApplication.java
4-
src/main/java/org/openapitools/RFC3339DateFormat.java
53
src/main/java/org/openapitools/api/ApiUtil.java
64
src/main/java/org/openapitools/api/CoverageApi.java
75
src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java
8-
src/main/java/org/openapitools/configuration/HomeController.java
9-
src/main/java/org/openapitools/configuration/SpringDocConfiguration.java
106
src/main/java/org/openapitools/model/FormParamsRequest.java
117
src/main/java/org/openapitools/model/MultipartMixedRequestMarker.java
128
src/main/java/org/openapitools/model/MultipartMixedStatus.java
13-
src/main/resources/application.properties
14-
src/main/resources/openapi.yaml
15-
src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
1-
# OpenAPI generated server
21

3-
Spring Boot Server
2+
# OpenAPI generated API stub
43

5-
## Overview
6-
This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
7-
By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
8-
This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework.
4+
Spring Framework stub
95

106

11-
The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org).
12-
Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes.
13-
The specification is available to download using the following url:
14-
http://localhost:8080/v3/api-docs/
7+
## Overview
8+
This code was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
9+
By using the [OpenAPI-Spec](https://openapis.org), you can easily generate an API stub.
10+
This is an example of building API stub interfaces in Java using the Spring framework.
1511

16-
Start your server as a simple java application
12+
The stubs generated can be used in your existing Spring-MVC or Spring-Boot application to create controller endpoints
13+
by adding ```@Controller``` classes that implement the interface. Eg:
14+
```java
15+
@Controller
16+
public class PetController implements PetApi {
17+
// implement all PetApi methods
18+
}
19+
```
1720

18-
You can view the api documentation in swagger-ui by pointing to
19-
http://localhost:8080/swagger-ui.html
21+
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:
22+
```java
23+
@FeignClient(name="pet", url="http://petstore.swagger.io/v2")
24+
public interface PetClient extends PetApi {
2025

21-
Change default port value in application.properties
26+
}
27+
```

samples/server/petstore/springboot-byte-format-edge-cases/pom.xml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,16 @@
2323
<sourceDirectory>src/main/java</sourceDirectory>
2424
<plugins>
2525
<plugin>
26-
<groupId>org.springframework.boot</groupId>
27-
<artifactId>spring-boot-maven-plugin</artifactId>
28-
<configuration>
29-
</configuration>
26+
<groupId>org.apache.maven.plugins</groupId>
27+
<artifactId>maven-source-plugin</artifactId>
28+
<executions>
29+
<execution>
30+
<id>attach-sources</id>
31+
<goals>
32+
<goal>jar</goal>
33+
</goals>
34+
</execution>
35+
</executions>
3036
</plugin>
3137
</plugins>
3238
</build>

samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/CoverageApiController.java

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)