Skip to content

Commit 9ffe338

Browse files
committed
add samples to compile check
1 parent 70461c0 commit 9ffe338

119 files changed

Lines changed: 17926 additions & 206 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/samples-jdk17.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
- samples/client/petstore/java/microprofile-rest-client-outer-enum/**
1515
# servers
1616
- samples/openapi3/server/petstore/springboot-3/**
17+
- samples/openapi3/server/petstore/springboot-3-include-http-request-context/**
1718
- samples/server/petstore/java-camel/**
1819
- samples/server/petstore/java-helidon-server/v3/mp/**
1920
- samples/server/petstore/java-helidon-server/v3/se/**
@@ -31,6 +32,7 @@ on:
3132
- samples/client/petstore/java/microprofile-rest-client-outer-enum/**
3233
# servers
3334
- samples/openapi3/server/petstore/springboot-3/**
35+
- samples/openapi3/server/petstore/springboot-3-include-http-request-context/**
3436
- samples/server/petstore/java-camel/**
3537
- samples/server/petstore/java-helidon-server/v3/mp/**
3638
- samples/server/petstore/java-helidon-server/v3/se/**
@@ -54,6 +56,7 @@ jobs:
5456
- samples/client/petstore/java/microprofile-rest-client-outer-enum
5557
# servers
5658
- samples/openapi3/server/petstore/springboot-3
59+
- samples/openapi3/server/petstore/springboot-3-include-http-request-context/**
5760
- samples/server/petstore/java-camel/
5861
- samples/server/petstore/java-helidon-server/v3/mp/
5962
- samples/server/petstore/java-helidon-server/v3/se

.github/workflows/samples-spring.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
- samples/server/petstore/spring-boot-nullable-set
4545
- samples/server/petstore/spring-boot-defaultInterface-unhandledExcp
4646
- samples/server/petstore/springboot
47+
- samples/server/petstore/springboot-include-http-request-context
4748
- samples/server/petstore/springboot-beanvalidation
4849
- samples/server/petstore/springboot-builtin-validation
4950
- samples/server/petstore/springboot-delegate
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
generatorName: spring
2+
outputDir: samples/openapi3/server/petstore/springboot-3-include-http-request-context
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
4+
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
5+
additionalProperties:
6+
groupId: org.openapitools.openapi3
7+
documentationProvider: springdoc
8+
artifactId: springboot
9+
snapshotVersion: "true"
10+
useSpringBoot3: true
11+
useBeanValidation: true
12+
withXml: true
13+
hideGenerationTimestamp: "true"
14+
generateConstructorWithAllArgs: true
15+
generateBuilders: true
16+
includeHttpRequestContext: "true"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
generatorName: spring
2+
outputDir: samples/server/petstore/springboot-include-http-request-context
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
4+
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
5+
additionalProperties:
6+
documentationProvider: springfox
7+
artifactId: springboot
8+
snapshotVersion: "true"
9+
hideGenerationTimestamp: "true"
10+
camelCaseDollarSign: "true"
11+
modelNameSuffix: 'Dto'
12+
includeHttpRequestContext: "true"

bin/configs/spring-boot-reactive-noResponseEntity.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ additionalProperties:
1010
hideGenerationTimestamp: "true"
1111
delegatePattern: "true"
1212
useResponseEntity: "false"
13+
includeHttpRequestContext: "false"
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.openapi-generator-ignore
2+
README.md
3+
pom.xml
4+
src/main/java/org/openapitools/OpenApiGeneratorApplication.java
5+
src/main/java/org/openapitools/RFC3339DateFormat.java
6+
src/main/java/org/openapitools/api/ApiUtil.java
7+
src/main/java/org/openapitools/api/PetApi.java
8+
src/main/java/org/openapitools/api/PetApiController.java
9+
src/main/java/org/openapitools/api/StoreApi.java
10+
src/main/java/org/openapitools/api/StoreApiController.java
11+
src/main/java/org/openapitools/api/UserApi.java
12+
src/main/java/org/openapitools/api/UserApiController.java
13+
src/main/java/org/openapitools/configuration/HomeController.java
14+
src/main/java/org/openapitools/configuration/SpringDocConfiguration.java
15+
src/main/java/org/openapitools/model/Category.java
16+
src/main/java/org/openapitools/model/ModelApiResponse.java
17+
src/main/java/org/openapitools/model/Order.java
18+
src/main/java/org/openapitools/model/Pet.java
19+
src/main/java/org/openapitools/model/Tag.java
20+
src/main/java/org/openapitools/model/User.java
21+
src/main/resources/application.properties
22+
src/main/resources/openapi.yaml
23+
src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.20.0-SNAPSHOT
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# OpenAPI generated server
2+
3+
Spring Boot Server
4+
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.
9+
10+
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/
15+
16+
Start your server as a simple java application
17+
18+
You can view the api documentation in swagger-ui by pointing to
19+
http://localhost:8080/swagger-ui.html
20+
21+
Change default port value in application.properties
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
<groupId>org.openapitools.openapi3</groupId>
4+
<artifactId>springboot</artifactId>
5+
<packaging>jar</packaging>
6+
<name>springboot</name>
7+
<version>1.0.0-SNAPSHOT</version>
8+
<properties>
9+
<java.version>17</java.version>
10+
<maven.compiler.source>${java.version}</maven.compiler.source>
11+
<maven.compiler.target>${java.version}</maven.compiler.target>
12+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13+
<springdoc.version>2.6.0</springdoc.version>
14+
<swagger-ui.version>5.17.14</swagger-ui.version>
15+
</properties>
16+
<parent>
17+
<groupId>org.springframework.boot</groupId>
18+
<artifactId>spring-boot-starter-parent</artifactId>
19+
<version>3.1.3</version>
20+
<relativePath/> <!-- lookup parent from repository -->
21+
</parent>
22+
23+
<repositories>
24+
<repository>
25+
<id>repository.spring.milestone</id>
26+
<name>Spring Milestone Repository</name>
27+
<url>https://repo.spring.io/milestone</url>
28+
</repository>
29+
</repositories>
30+
<pluginRepositories>
31+
<pluginRepository>
32+
<id>spring-milestones</id>
33+
<url>https://repo.spring.io/milestone</url>
34+
</pluginRepository>
35+
</pluginRepositories>
36+
37+
<build>
38+
<sourceDirectory>src/main/java</sourceDirectory>
39+
<plugins>
40+
<plugin>
41+
<groupId>org.springframework.boot</groupId>
42+
<artifactId>spring-boot-maven-plugin</artifactId>
43+
<configuration>
44+
</configuration>
45+
</plugin>
46+
</plugins>
47+
</build>
48+
<dependencies>
49+
<dependency>
50+
<groupId>org.springframework.boot</groupId>
51+
<artifactId>spring-boot-starter-web</artifactId>
52+
</dependency>
53+
<dependency>
54+
<groupId>org.springframework.data</groupId>
55+
<artifactId>spring-data-commons</artifactId>
56+
</dependency>
57+
<!--SpringDoc dependencies -->
58+
<dependency>
59+
<groupId>org.springdoc</groupId>
60+
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
61+
<version>${springdoc.version}</version>
62+
</dependency>
63+
<!-- @Nullable annotation -->
64+
<dependency>
65+
<groupId>com.google.code.findbugs</groupId>
66+
<artifactId>jsr305</artifactId>
67+
<version>3.0.2</version>
68+
</dependency>
69+
<dependency>
70+
<groupId>com.fasterxml.jackson.dataformat</groupId>
71+
<artifactId>jackson-dataformat-yaml</artifactId>
72+
</dependency>
73+
<!-- XML processing: Jackson -->
74+
<dependency>
75+
<groupId>jakarta.xml.bind</groupId>
76+
<artifactId>jakarta.xml.bind-api</artifactId>
77+
</dependency>
78+
<dependency>
79+
<groupId>com.fasterxml.jackson.dataformat</groupId>
80+
<artifactId>jackson-dataformat-xml</artifactId>
81+
</dependency>
82+
<dependency>
83+
<groupId>com.fasterxml.jackson.datatype</groupId>
84+
<artifactId>jackson-datatype-jsr310</artifactId>
85+
</dependency>
86+
<dependency>
87+
<groupId>org.openapitools</groupId>
88+
<artifactId>jackson-databind-nullable</artifactId>
89+
<version>0.2.8</version>
90+
</dependency>
91+
<!-- Bean Validation API support -->
92+
<dependency>
93+
<groupId>org.springframework.boot</groupId>
94+
<artifactId>spring-boot-starter-validation</artifactId>
95+
</dependency>
96+
<dependency>
97+
<groupId>com.fasterxml.jackson.core</groupId>
98+
<artifactId>jackson-databind</artifactId>
99+
</dependency>
100+
<dependency>
101+
<groupId>org.springframework.boot</groupId>
102+
<artifactId>spring-boot-starter-test</artifactId>
103+
<scope>test</scope>
104+
</dependency>
105+
</dependencies>
106+
</project>

0 commit comments

Comments
 (0)