Skip to content

Commit 326ae72

Browse files
authored
Merge branch 'OpenAPITools:master' into go-types
2 parents 34e6216 + 4c08ff8 commit 326ae72

File tree

1,118 files changed

+69138
-8838
lines changed

Some content is hidden

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

1,118 files changed

+69138
-8838
lines changed

.github/workflows/openapi-generator.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ jobs:
142142
path: modules/openapi-generator-cli/target
143143
- name: Delete samples that are entirely generated
144144
run: |
145+
rm -rf samples/client/petstore/csharp/generichost/latest/HelloWorld
145146
rm -rf samples/client/petstore/csharp/generichost/latest/Tags
146147
147148
rm -rf samples/client/petstore/csharp/generichost/net8/AllOf

.github/workflows/samples-dotnet9.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
matrix:
2525
sample:
2626
- samples/client/petstore/csharp/generichost/latest/Tags
27+
- samples/client/petstore/csharp/generichost/latest/HelloWorld
2728
- samples/client/petstore/csharp/generichost/net9/AllOf
2829
- samples/client/petstore/csharp/generichost/net9/AnyOf
2930
- samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare

.github/workflows/samples-java-client-jdk11.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ jobs:
6161
- samples/client/petstore/java/webclient-swagger2
6262
- samples/client/petstore/java/webclient-useSingleRequestParameter
6363
- samples/client/petstore/java/vertx
64+
- samples/client/petstore/java/vertx-no-nullable
65+
- samples/client/petstore/java/vertx-supportVertxFuture
6466
- samples/client/petstore/java/jersey2-java8-localdatetime
6567
- samples/client/petstore/java/google-api-client
6668
- samples/client/petstore/java/rest-assured
@@ -74,6 +76,7 @@ jobs:
7476
- samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter
7577
- samples/client/petstore/java/apache-httpclient
7678
- samples/client/petstore/java/feign
79+
- samples/client/petstore/java/feign-hc5
7780
- samples/client/petstore/java/feign-no-nullable
7881
- samples/client/petstore/java/okhttp-gson-awsv4signature
7982
- samples/openapi3/client/petstore/java/jersey2-java8-special-characters

.github/workflows/samples-julia.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
# Using develop mode to install package so that it is easier to modify the package test files
3131
julia -e "using Pkg; Pkg.develop(\"OpenAPI\");"
3232
cd ~/.julia/dev/OpenAPI
33-
git checkout v0.1.25
33+
git checkout v0.2.0
3434
cd $currdir
3535
rm -rf ~/.julia/dev/OpenAPI/test/client/openapigenerator_petstore_v3/petstore
3636
rm -rf ~/.julia/dev/OpenAPI/test/server/openapigenerator_petstore_v3/petstore
+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Samples Scala/sbt (JDK8)
2+
3+
on:
4+
push:
5+
paths:
6+
- 'samples/server/petstore/scala-finch/**'
7+
pull_request:
8+
paths:
9+
- 'samples/server/petstore/scala-finch/**'
10+
jobs:
11+
build:
12+
name: Build scala-finch servers
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
sample:
18+
# servers
19+
- samples/server/petstore/scala-finch # cannot be tested with jdk11
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-java@v4
23+
with:
24+
distribution: 'temurin'
25+
java-version: 8
26+
- name: Setup sbt launcher
27+
uses: sbt/setup-sbt@v1
28+
- name: Cache maven dependencies
29+
uses: actions/cache@v4
30+
env:
31+
cache-name: maven-repository
32+
with:
33+
path: |
34+
~/.ivy2
35+
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/build.sbt') }}
36+
- name: Build and test
37+
working-directory: ${{ matrix.sample }}
38+
run: sbt -v +test

.github/workflows/samples-scala.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,26 @@ jobs:
2020
matrix:
2121
sample:
2222
# clients
23-
- 'samples/client/petstore/java/okhttp-gson'
23+
- samples/client/petstore/java/okhttp-gson
2424
- samples/client/petstore/scalaz
2525
- samples/client/petstore/scala-pekko
2626
- samples/client/petstore/scala-http4s
27-
#- samples/client/petstore/scala-sttp # won't pass while the same tests in circleci pass
27+
#- samples/client/petstore/scala-sttp
28+
#- samples/client/petstore/scala-sttp-circe
2829
# servers
2930
- samples/server/petstore/scala-lagom-server
3031
- samples/server/petstore/scala-play-server
3132
- samples/server/petstore/scala-akka-http-server
3233
- samples/server/petstore/scala-pekko-http-server
3334
- samples/server/petstore/scalatra
34-
- samples/server/petstore/scala-finch # cannot be tested with jdk11
3535
- samples/server/petstore/scala-http4s-server
3636
- samples/server/petstore/scala-cask
3737
steps:
3838
- uses: actions/checkout@v4
3939
- uses: actions/setup-java@v4
4040
with:
4141
distribution: 'temurin'
42-
java-version: 8
42+
java-version: 11
4343
- name: Setup sbt launcher
4444
uses: sbt/setup-sbt@v1
4545
- name: Cache maven dependencies

CI/circle_parallel.sh

+1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ else
122122

123123
(cd samples/client/petstore/scala-akka && mvn integration-test)
124124
(cd samples/client/petstore/scala-sttp && mvn integration-test)
125+
(cd samples/client/petstore/scala-sttp-circe && mvn integration-test)
125126
(cd samples/client/petstore/scala-sttp4 && mvn integration-test)
126127
(cd samples/client/petstore/clojure && mvn integration-test)
127128
(cd samples/client/petstore/java/jersey2-java8 && mvn integration-test)

appveyor.yml

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ build_script:
4343
#- dotnet build samples\client\petstore\csharp\OpenAPIClient-ConditionalSerialization\Org.OpenAPITools.sln
4444

4545
test_script:
46+
- dotnet test samples\client\petstore\csharp\generichost\latest\Tags\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
47+
- dotnet test samples\client\petstore\csharp\generichost\latest\HelloWorld\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
48+
4649
- dotnet test samples\client\petstore\csharp\generichost\net9\AllOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
4750
- dotnet test samples\client\petstore\csharp\generichost\net9\AnyOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
4851
- dotnet test samples\client\petstore\csharp\generichost\net9\AnyOfNoCompare\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# for csharp generichost
2+
generatorName: csharp
3+
outputDir: samples/client/petstore/csharp/generichost/latest/HelloWorld
4+
inputSpec: modules/openapi-generator/src/test/resources/3_1/csharp/hello-world.yaml
5+
templateDir: modules/openapi-generator/src/main/resources/csharp
6+
additionalProperties:
7+
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
8+
modelPropertySorting: alphabetical
9+
operationParameterSorting: alphabetical

bin/configs/java-feign-hc5.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
generatorName: java
2+
outputDir: samples/client/petstore/java/feign-hc5
3+
library: feign-hc5
4+
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
5+
templateDir: modules/openapi-generator/src/main/resources/Java
6+
additionalProperties:
7+
booleanGetterPrefix: is
8+
artifactId: petstore-feign-hc5
9+
hideGenerationTimestamp: "true"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
generatorName: java
2+
outputDir: samples/client/petstore/java/vertx-supportVertxFuture
3+
library: vertx
4+
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
5+
templateDir: modules/openapi-generator/src/main/resources/Java
6+
additionalProperties:
7+
artifactId: petstore-vertx-supportvertxfuture
8+
hideGenerationTimestamp: "true"
9+
dateLibrary: java8
10+
supportVertxFuture: "true"

bin/configs/protobuf-schema-config.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ additionalProperties:
1010
wrapComplexType: false
1111
supportMultipleResponses: false
1212
aggregateModelsName: data
13+
customOptionsApi: |
14+
option java_multiple_files = true;
15+
option java_package = "com.example.tutorial.protos.api";
16+
option java_outer_classname = "ExampleProtos";
17+
customOptionsModel: |
18+
option java_multiple_files = false;
19+
option java_package = "com.example.tutorial.protos.model";
20+
option java_outer_classname = "ExampleProtos";
21+
useSimplifiedEnumNames: true
1322
typeMappings:
1423
object: "google.protobuf.Struct"
1524
importMappings:

bin/configs/scala-sttp-circe.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
generatorName: scala-sttp
2+
outputDir: samples/client/petstore/scala-sttp-circe
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/scala/petstore.yaml
4+
templateDir: modules/openapi-generator/src/main/resources/scala-sttp
5+
nameMappings:
6+
_type: "`underscoreType`"
7+
type_: "`typeWithUnderscore`"
8+
http_debug_operation: "`httpDebugOperation`"
9+
parameterNameMappings:
10+
_type: underscoreType
11+
type_: typeWithUnderscore
12+
http_debug_operation: httpDebugOperation
13+
additionalProperties:
14+
artifactId: scala-sttp-petstore
15+
jsonLibrary: circe

docs/customization.md

+7
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,13 @@ Example:
601601
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/enableKeepOnlyFirstTagInOperation_test.yaml -o /tmp/java-okhttp/ --openapi-normalizer REMOVE_X_INTERNAL=true
602602
```
603603
604+
- `NORMALIZER_CLASS`: Set to full classname of a class extending the default org.openapitools.codegen.OpenAPINormalizer. It allows customization of the default normalizer.
605+
606+
Example:
607+
```
608+
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/required-properties.yaml -o /tmp/java-okhttp/ --openapi-normalizer NORMALIZER_CLASS=org.openapitools.codegen.OpenAPINormalizerTest$RemoveRequiredNormalizer
609+
```
610+
604611
- `FILTER`
605612
606613
The `FILTER` parameter allows selective inclusion of API operations based on specific criteria. It applies the `x-internal: true` property to operations that do **not** match the specified values, preventing them from being generated.

docs/generators/java-microprofile.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
6262
|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null|
6363
|invokerPackage|root package for generated code| |org.openapitools.client|
6464
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
65-
|library|library template (sub-template) to use|<dl><dt>**jersey2**</dt><dd>HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.17.1</dd><dt>**jersey3**</dt><dd>HTTP client: Jersey client 3.1.1. JSON processing: Jackson 2.17.1</dd><dt>**feign**</dt><dd>HTTP client: OpenFeign 13.2.1. JSON processing: Jackson 2.17.1 or Gson 2.10.1</dd><dt>**okhttp-gson**</dt><dd>[DEFAULT] HTTP client: OkHttp 4.11.0. JSON processing: Gson 2.10.1. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.</dd><dt>**retrofit2**</dt><dd>HTTP client: OkHttp 4.11.0. JSON processing: Gson 2.10.1 (Retrofit 2.5.0) or Jackson 2.17.1. Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)</dd><dt>**resttemplate**</dt><dd>HTTP client: Spring RestTemplate 5.3.33 (6.1.5 if `useJakartaEe=true`). JSON processing: Jackson 2.17.1</dd><dt>**webclient**</dt><dd>HTTP client: Spring WebClient 5.1.18. JSON processing: Jackson 2.17.1</dd><dt>**restclient**</dt><dd>HTTP client: Spring RestClient 6.1.6. JSON processing: Jackson 2.17.1</dd><dt>**resteasy**</dt><dd>HTTP client: Resteasy client 4.7.6. JSON processing: Jackson 2.17.1</dd><dt>**vertx**</dt><dd>HTTP client: VertX client 3.5.2. JSON processing: Jackson 2.17.1</dd><dt>**google-api-client**</dt><dd>HTTP client: Google API client 2.2.0. JSON processing: Jackson 2.17.1</dd><dt>**rest-assured**</dt><dd>HTTP client: rest-assured 5.3.2. JSON processing: Gson 2.10.1 or Jackson 2.17.1. Only for Java 8</dd><dt>**native**</dt><dd>HTTP client: Java native HttpClient. JSON processing: Jackson 2.17.1. Only for Java11+</dd><dt>**microprofile**</dt><dd>HTTP client: Microprofile client 2.0 (default, set desired version via `microprofileRestClientVersion=x.x.x`). JSON processing: JSON-B 1.0.2 or Jackson 2.17.1</dd><dt>**apache-httpclient**</dt><dd>HTTP client: Apache httpclient 5.2.1. JSON processing: Jackson 2.17.1</dd></dl>|okhttp-gson|
65+
|library|library template (sub-template) to use|<dl><dt>**jersey2**</dt><dd>HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.17.1</dd><dt>**jersey3**</dt><dd>HTTP client: Jersey client 3.1.1. JSON processing: Jackson 2.17.1</dd><dt>**feign**</dt><dd>HTTP client: OpenFeign 13.2.1. JSON processing: Jackson 2.17.1 or Gson 2.10.1</dd><dt>**feign-hc5**</dt><dd>HTTP client: OpenFeign 13.2.1/HttpClient5 5.4.2. JSON processing: Jackson 2.17.1 or Gson 2.10.1</dd><dt>**okhttp-gson**</dt><dd>[DEFAULT] HTTP client: OkHttp 4.11.0. JSON processing: Gson 2.10.1. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.</dd><dt>**retrofit2**</dt><dd>HTTP client: OkHttp 4.11.0. JSON processing: Gson 2.10.1 (Retrofit 2.5.0) or Jackson 2.17.1. Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)</dd><dt>**resttemplate**</dt><dd>HTTP client: Spring RestTemplate 5.3.33 (6.1.5 if `useJakartaEe=true`). JSON processing: Jackson 2.17.1</dd><dt>**webclient**</dt><dd>HTTP client: Spring WebClient 5.1.18. JSON processing: Jackson 2.17.1</dd><dt>**restclient**</dt><dd>HTTP client: Spring RestClient 6.1.6. JSON processing: Jackson 2.17.1</dd><dt>**resteasy**</dt><dd>HTTP client: Resteasy client 4.7.6. JSON processing: Jackson 2.17.1</dd><dt>**vertx**</dt><dd>HTTP client: VertX client 3.5.2. JSON processing: Jackson 2.17.1</dd><dt>**google-api-client**</dt><dd>HTTP client: Google API client 2.2.0. JSON processing: Jackson 2.17.1</dd><dt>**rest-assured**</dt><dd>HTTP client: rest-assured 5.3.2. JSON processing: Gson 2.10.1 or Jackson 2.17.1. Only for Java 8</dd><dt>**native**</dt><dd>HTTP client: Java native HttpClient. JSON processing: Jackson 2.17.1. Only for Java11+</dd><dt>**microprofile**</dt><dd>HTTP client: Microprofile client 2.0 (default, set desired version via `microprofileRestClientVersion=x.x.x`). JSON processing: JSON-B 1.0.2 or Jackson 2.17.1</dd><dt>**apache-httpclient**</dt><dd>HTTP client: Apache httpclient 5.2.1. JSON processing: Jackson 2.17.1</dd></dl>|okhttp-gson|
6666
|licenseName|The name of the license| |Unlicense|
6767
|licenseUrl|The URL of the license| |http://unlicense.org|
6868
|microprofileFramework|Framework for microprofile. Possible values &quot;kumuluzee&quot;| |null|
@@ -87,6 +87,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
8787
|sourceFolder|source folder for generated code| |src/main/java|
8888
|supportStreaming|Support streaming endpoint (beta)| |false|
8989
|supportUrlQuery|Generate toUrlQueryString in POJO (default to true). Available on `native`, `apache-httpclient` libraries.| |false|
90+
|supportVertxFuture|Also generate api methods that return a vertx Future instead of taking a callback. Only `vertx` supports this option. Requires vertx 4 or greater.| |false|
9091
|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi|
9192
|useAbstractionForFiles|Use alternative types instead of java.io.File to allow passing bytes without a file on disk. Available on resttemplate, webclient, restclient, libraries| |false|
9293
|useBeanValidation|Use BeanValidation API annotations| |false|

0 commit comments

Comments
 (0)