mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2026-03-22 09:30:02 +00:00
Compare commits
143 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b240a067d | ||
|
|
b05d7762b5 | ||
|
|
7510ed3d5a | ||
|
|
8786ffcc35 | ||
|
|
d13eecd661 | ||
|
|
e0df52a5d6 | ||
|
|
739d1edd6b | ||
|
|
c073b146d4 | ||
|
|
f9913734fc | ||
|
|
54cedcb0c2 | ||
|
|
4603cc90bf | ||
|
|
8ef4a480cb | ||
|
|
b3244e93bf | ||
|
|
3e0a9f7ace | ||
|
|
276d69075e | ||
|
|
e3826f0491 | ||
|
|
39765e6fca | ||
|
|
5b8d04248e | ||
|
|
c6a3073162 | ||
|
|
fe4dc03504 | ||
|
|
eaa79e29a3 | ||
|
|
274510c6b5 | ||
|
|
1a09c7abd3 | ||
|
|
d8afb229fa | ||
|
|
a2fd144758 | ||
|
|
a04b9a5960 | ||
|
|
1462933d01 | ||
|
|
dc4155051d | ||
|
|
a7eedd9df5 | ||
|
|
44bc527f8b | ||
|
|
067c9b2897 | ||
|
|
0a5f5a87e3 | ||
|
|
325dd614d6 | ||
|
|
6804ceaece | ||
|
|
0d2ff8c69b | ||
|
|
cca5dda026 | ||
|
|
5a168266f8 | ||
|
|
6cf78e789b | ||
|
|
33a4456a05 | ||
|
|
07fa852fe2 | ||
|
|
401ae651ab | ||
|
|
b13e9080af | ||
|
|
5c6ab3eb63 | ||
|
|
3f76a05174 | ||
|
|
5e913233bc | ||
|
|
f151c4640e | ||
|
|
c0a76525c4 | ||
|
|
c08597440e | ||
|
|
99a857fb28 | ||
|
|
2d82875882 | ||
|
|
4d83cfecdf | ||
|
|
054af0e0aa | ||
|
|
1778c1ba4d | ||
|
|
68dc149fa1 | ||
|
|
86b3529f3e | ||
|
|
19f57501fb | ||
|
|
2eaa15a53b | ||
|
|
c7db8cf651 | ||
|
|
94fcce533f | ||
|
|
e0fbba641e | ||
|
|
8b8013dc7c | ||
|
|
cdf22acb54 | ||
|
|
e6304a8db2 | ||
|
|
bbc1cf4c66 | ||
|
|
f255c24480 | ||
|
|
16250e5f09 | ||
|
|
a648392a39 | ||
|
|
50d55f7400 | ||
|
|
5944d8e50e | ||
|
|
b7a6df9ae8 | ||
|
|
c1b0782373 | ||
|
|
7a8903fae6 | ||
|
|
16f5c8b7ac | ||
|
|
87ded7275e | ||
|
|
80d16e7d2a | ||
|
|
df992150f5 | ||
|
|
6e57564d2c | ||
|
|
538587f05c | ||
|
|
80f2d7f74d | ||
|
|
6d335cd96d | ||
|
|
3972c65a2a | ||
|
|
1283d1bf0f | ||
|
|
cbdee19f87 | ||
|
|
0869cad083 | ||
|
|
845386ec9c | ||
|
|
dedd2fc280 | ||
|
|
d9dd07aeac | ||
|
|
d11bc86748 | ||
|
|
3deee65ee4 | ||
|
|
9afa74a3cb | ||
|
|
536016bcb7 | ||
|
|
910caaae92 | ||
|
|
c2c7c34dcb | ||
|
|
8515f5ed0c | ||
|
|
a761136234 | ||
|
|
47226436fa | ||
|
|
a2e2df1246 | ||
|
|
fbb99d2d15 | ||
|
|
4bf4637169 | ||
|
|
c3c17bb985 | ||
|
|
92cf4b2d1b | ||
|
|
3c20b2089b | ||
|
|
132a0226e3 | ||
|
|
5b89b47846 | ||
|
|
20b18ad828 | ||
|
|
bfe5ca84ce | ||
|
|
df4a1d63e0 | ||
|
|
4462f699d7 | ||
|
|
1674c72f86 | ||
|
|
b93035759b | ||
|
|
584bf22b3a | ||
|
|
7970d4b401 | ||
|
|
b32faa0a24 | ||
|
|
22e1d6aa78 | ||
|
|
2f35b81909 | ||
|
|
4538d95025 | ||
|
|
e01fdee81e | ||
|
|
a2b7776d20 | ||
|
|
7b59bdd54e | ||
|
|
e5d40f4258 | ||
|
|
e438e15b09 | ||
|
|
27cced51c0 | ||
|
|
a5e2fdf667 | ||
|
|
905b930144 | ||
|
|
8fcb2e0d8b | ||
|
|
5e45db9a02 | ||
|
|
17a28ebad2 | ||
|
|
86a42dc700 | ||
|
|
4bffc1ad8e | ||
|
|
8c70c33e8c | ||
|
|
f4b64c4e5a | ||
|
|
4f00a34df6 | ||
|
|
1894a07c2c | ||
|
|
7cb6256bef | ||
|
|
c698c9fb3a | ||
|
|
c76700fcf4 | ||
|
|
d6c29051e3 | ||
|
|
6df3c420b0 | ||
|
|
e76e744a7a | ||
|
|
99d42520a9 | ||
|
|
1c49d5c342 | ||
|
|
3252fcf619 | ||
|
|
9432aaf4a3 |
64
.geminiignore
Normal file
64
.geminiignore
Normal file
@@ -0,0 +1,64 @@
|
||||
# .geminiignore
|
||||
# This file specifies intentionally untracked files that Gemini CLI should ignore.
|
||||
# It uses the same pattern matching rules as .gitignore.
|
||||
|
||||
# Build artifacts
|
||||
target/
|
||||
build/
|
||||
*.jar
|
||||
*.war
|
||||
*.ear
|
||||
*.class
|
||||
*.log
|
||||
|
||||
# IDE and editor files
|
||||
.idea/
|
||||
.vscode/
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
|
||||
# Maven/Gradle wrapper directories
|
||||
.mvn/wrapper/
|
||||
.gradle/
|
||||
|
||||
# Node.js dependencies for website
|
||||
website/node_modules/
|
||||
website/build/
|
||||
|
||||
# Generated sources by OpenAPI Generator (usually not to be touched directly)
|
||||
# This includes sample outputs which are generated code for various languages.
|
||||
samples/
|
||||
|
||||
# Temporary files
|
||||
tmp/
|
||||
.DS_Store
|
||||
# Eclipse
|
||||
.classpath
|
||||
.project
|
||||
.settings
|
||||
|
||||
# IntelliJ IDEA
|
||||
.idea/
|
||||
*.iml
|
||||
*.iws
|
||||
*.iwp
|
||||
.vscode/
|
||||
|
||||
# MacOS
|
||||
.DS_Store
|
||||
|
||||
# ReSharper
|
||||
*.resharper
|
||||
|
||||
# Visual Studio
|
||||
.vs/
|
||||
*.user
|
||||
*.suo
|
||||
*.sln.docstates
|
||||
|
||||
# Other
|
||||
*.bak
|
||||
*.swp
|
||||
*~
|
||||
.#*
|
||||
6
.github/workflows/docker-release.yml
vendored
6
.github/workflows/docker-release.yml
vendored
@@ -31,11 +31,11 @@ jobs:
|
||||
|
||||
# docker workflow
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
uses: docker/setup-qemu-action@v4
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@v4
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
4
.github/workflows/gradle-plugin-tests.yaml
vendored
4
.github/workflows/gradle-plugin-tests.yaml
vendored
@@ -14,10 +14,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- name: Set up JDK 11
|
||||
- name: Set up JDK 21
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
java-version: 11
|
||||
java-version: 21
|
||||
distribution: 'temurin'
|
||||
cache: gradle
|
||||
- name: Cache maven dependencies
|
||||
|
||||
6
.github/workflows/linux.yaml
vendored
6
.github/workflows/linux.yaml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
java: [11, 17]
|
||||
java: [11, 17, 21, 25]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
@@ -62,7 +62,7 @@ jobs:
|
||||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
|
||||
|
||||
- name: Upload Maven build artifact
|
||||
uses: actions/upload-artifact@v6
|
||||
uses: actions/upload-artifact@v7
|
||||
if: matrix.java == '11' && matrix.os == 'ubuntu-latest'
|
||||
with:
|
||||
name: artifact
|
||||
@@ -98,7 +98,7 @@ jobs:
|
||||
maven-version: 3.8.8
|
||||
cache: gradle
|
||||
- name: Download build artifact
|
||||
uses: actions/download-artifact@v7
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: artifact
|
||||
- name: Run Ensures Script
|
||||
|
||||
8
.github/workflows/openapi-generator.yaml
vendored
8
.github/workflows/openapi-generator.yaml
vendored
@@ -42,7 +42,7 @@ jobs:
|
||||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
|
||||
- run: ls -la modules/openapi-generator-cli/target
|
||||
- name: Upload openapi-generator-cli.jar artifact
|
||||
uses: actions/upload-artifact@v6
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: openapi-generator-cli.jar
|
||||
path: modules/openapi-generator-cli/target/openapi-generator-cli.jar
|
||||
@@ -81,7 +81,7 @@ jobs:
|
||||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
|
||||
- name: Publish unit test reports
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v6
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: surefire-test-results
|
||||
path: '**/surefire-reports/TEST-*.xml'
|
||||
@@ -99,7 +99,7 @@ jobs:
|
||||
java-version: 11
|
||||
distribution: 'temurin'
|
||||
- name: Download openapi-generator-cli.jar artifact
|
||||
uses: actions/download-artifact@v7
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: openapi-generator-cli.jar
|
||||
path: modules/openapi-generator-cli/target
|
||||
@@ -138,7 +138,7 @@ jobs:
|
||||
java-version: 11
|
||||
distribution: 'temurin'
|
||||
- name: Download openapi-generator-cli.jar artifact
|
||||
uses: actions/download-artifact@v7
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: openapi-generator-cli.jar
|
||||
path: modules/openapi-generator-cli/target
|
||||
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
- samples/server/petstore/aspnet/fastendpoints-useValidators
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-dotnet@v5.1.0
|
||||
- uses: actions/setup-dotnet@v5.2.0
|
||||
with:
|
||||
dotnet-version: '8.0.x'
|
||||
- name: Build
|
||||
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
- samples/client/petstore/csharp/restsharp/standard2.0/Petstore/
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-dotnet@v5.1.0
|
||||
- uses: actions/setup-dotnet@v5.2.0
|
||||
with:
|
||||
dotnet-version: '7.0.x'
|
||||
- name: Build
|
||||
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
# - samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-dotnet@v5.1.0
|
||||
- uses: actions/setup-dotnet@v5.2.0
|
||||
with:
|
||||
dotnet-version: 3.1.*
|
||||
- name: Build
|
||||
|
||||
2
.github/workflows/samples-dotnet10.yaml
vendored
2
.github/workflows/samples-dotnet10.yaml
vendored
@@ -48,7 +48,7 @@ jobs:
|
||||
# - samples/client/petstore/csharp/unityWebRequest/net10/Petstore
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-dotnet@v5.1.0
|
||||
- uses: actions/setup-dotnet@v5.2.0
|
||||
with:
|
||||
dotnet-version: '10.x'
|
||||
- name: Build
|
||||
|
||||
@@ -25,7 +25,7 @@ jobs:
|
||||
- samples/server/petstore/aspnetcore-6.0-useSwashBuckle
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-dotnet@v5.1.0
|
||||
- uses: actions/setup-dotnet@v5.2.0
|
||||
with:
|
||||
dotnet-version: '6.0.x'
|
||||
- name: Build
|
||||
|
||||
2
.github/workflows/samples-dotnet7-client.yml
vendored
2
.github/workflows/samples-dotnet7-client.yml
vendored
@@ -43,7 +43,7 @@ jobs:
|
||||
- samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-dotnet@v5.1.0
|
||||
- uses: actions/setup-dotnet@v5.2.0
|
||||
with:
|
||||
dotnet-version: '7.0.x'
|
||||
- name: Build
|
||||
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
- samples/client/echo_api/csharp/restsharp/net8/EchoApi
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-dotnet@v5.1.0
|
||||
- uses: actions/setup-dotnet@v5.2.0
|
||||
with:
|
||||
dotnet-version: '8.0.x'
|
||||
- name: Run echo server
|
||||
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
- samples/client/petstore/csharp/restsharp/net8/useVirtualForHooks/
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-dotnet@v5.1.0
|
||||
- uses: actions/setup-dotnet@v5.2.0
|
||||
with:
|
||||
dotnet-version: '8.0.x'
|
||||
- name: Build
|
||||
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
- samples/server/petstore/aspnetcore-8.0-use-centralized-package-version-management
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-dotnet@v5.1.0
|
||||
- uses: actions/setup-dotnet@v5.2.0
|
||||
with:
|
||||
dotnet-version: '8.0.x'
|
||||
- name: Build
|
||||
|
||||
2
.github/workflows/samples-dotnet8.yaml
vendored
2
.github/workflows/samples-dotnet8.yaml
vendored
@@ -34,7 +34,7 @@ jobs:
|
||||
- samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-dotnet@v5.1.0
|
||||
- uses: actions/setup-dotnet@v5.2.0
|
||||
with:
|
||||
dotnet-version: '8.0.x'
|
||||
- name: Build
|
||||
|
||||
2
.github/workflows/samples-dotnet9.yaml
vendored
2
.github/workflows/samples-dotnet9.yaml
vendored
@@ -41,7 +41,7 @@ jobs:
|
||||
#- samples/client/petstore/csharp/unityWebRequest/net9/Petstore
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-dotnet@v5.1.0
|
||||
- uses: actions/setup-dotnet@v5.2.0
|
||||
with:
|
||||
dotnet-version: '9.0.x'
|
||||
- name: Build
|
||||
|
||||
@@ -4,6 +4,7 @@ on:
|
||||
push:
|
||||
paths:
|
||||
- samples/client/petstore/java/resttemplate-jakarta/**
|
||||
- samples/client/petstore/java/resttemplate-springBoot4-*/**
|
||||
- samples/client/petstore/java/webclient-jakarta/**
|
||||
- samples/client/petstore/java/restclient-*/**
|
||||
- samples/client/others/java/webclient-sealedInterface/**
|
||||
@@ -13,6 +14,7 @@ on:
|
||||
pull_request:
|
||||
paths:
|
||||
- samples/client/petstore/java/resttemplate-jakarta/**
|
||||
- samples/client/petstore/java/resttemplate-springBoot4-*/**
|
||||
- samples/client/petstore/java/webclient-jakarta/**
|
||||
- samples/client/petstore/java/restclient-*/**
|
||||
- samples/client/others/java/webclient-sealedInterface/**
|
||||
@@ -29,14 +31,19 @@ jobs:
|
||||
sample:
|
||||
# clients
|
||||
- samples/client/petstore/java/resttemplate-jakarta
|
||||
- samples/client/petstore/java/resttemplate-springBoot4-jackson2
|
||||
- samples/client/petstore/java/resttemplate-springBoot4-jackson3
|
||||
- samples/client/petstore/java/webclient-jakarta
|
||||
- samples/client/petstore/java/restclient
|
||||
- samples/client/petstore/java/restclient-nullable-arrays
|
||||
- samples/client/petstore/java/restclient-springBoot4-jackson2
|
||||
- samples/client/petstore/java/restclient-springBoot4-jackson3
|
||||
- samples/client/petstore/java/restclient-swagger2
|
||||
- samples/client/petstore/java/restclient-useSingleRequestParameter
|
||||
- samples/client/petstore/java/restclient-useSingleRequestParameter-static
|
||||
- samples/client/others/java/webclient-sealedInterface
|
||||
- samples/client/others/java/webclient-sealedInterface_3_1
|
||||
- samples/client/petstore/java/webclient-springBoot4-jackson3
|
||||
- samples/client/petstore/java/webclient-useSingleRequestParameter
|
||||
- samples/client/others/java/restclient-enum-in-multipart
|
||||
steps:
|
||||
|
||||
3
.github/workflows/samples-jdk17.yaml
vendored
3
.github/workflows/samples-jdk17.yaml
vendored
@@ -14,6 +14,7 @@ on:
|
||||
- samples/client/petstore/java/microprofile-rest-client-outer-enum/**
|
||||
# servers
|
||||
- samples/openapi3/server/petstore/springboot-3/**
|
||||
- samples/openapi3/server/petstore/springboot-3-include-http-request-context/**
|
||||
- samples/server/petstore/springboot-x-implements-skip/**
|
||||
- samples/server/petstore/java-camel/**
|
||||
- samples/server/petstore/java-helidon-server/v3/mp/**
|
||||
@@ -32,6 +33,7 @@ on:
|
||||
- samples/client/petstore/java/microprofile-rest-client-outer-enum/**
|
||||
# servers
|
||||
- samples/openapi3/server/petstore/springboot-3/**
|
||||
- samples/openapi3/server/petstore/springboot-3-include-http-request-context/**
|
||||
- samples/server/petstore/springboot-x-implements-skip/**
|
||||
- samples/server/petstore/java-camel/**
|
||||
- samples/server/petstore/java-helidon-server/v3/mp/**
|
||||
@@ -56,6 +58,7 @@ jobs:
|
||||
- samples/client/petstore/java/microprofile-rest-client-outer-enum
|
||||
# servers
|
||||
- samples/openapi3/server/petstore/springboot-3
|
||||
- samples/openapi3/server/petstore/springboot-3-include-http-request-context
|
||||
- samples/server/petstore/springboot-x-implements-skip
|
||||
- samples/server/petstore/java-camel/
|
||||
- samples/server/petstore/java-helidon-server/v3/mp/
|
||||
|
||||
3
.github/workflows/samples-kotlin-client.yaml
vendored
3
.github/workflows/samples-kotlin-client.yaml
vendored
@@ -11,6 +11,7 @@ on:
|
||||
- 'samples/client/petstore/kotlin*/**'
|
||||
- 'samples/client/others/kotlin-jvm-okhttp-parameter-tests/**'
|
||||
- samples/client/others/kotlin-integer-enum/**
|
||||
- samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/**
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -47,6 +48,7 @@ jobs:
|
||||
- samples/client/petstore/kotlin-default-values-jvm-okhttp4
|
||||
- samples/client/petstore/kotlin-default-values-jvm-retrofit2
|
||||
- samples/client/petstore/kotlin-default-values-multiplatform
|
||||
- samples/client/petstore/kotlin-enum-integers-multiplatform
|
||||
- samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4
|
||||
- samples/client/petstore/kotlin-array-simple-string-multiplatform
|
||||
- samples/client/petstore/kotlin-bigdecimal-default-multiplatform
|
||||
@@ -70,6 +72,7 @@ jobs:
|
||||
- samples/client/others/kotlin-integer-enum
|
||||
- samples/client/petstore/kotlin-allOf-discriminator-kotlinx-serialization
|
||||
- samples/client/others/kotlin-oneOf-discriminator-kotlinx-serialization
|
||||
- samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-java@v5
|
||||
|
||||
@@ -10,6 +10,7 @@ on:
|
||||
- 'samples/server/petstore/kotlin-springboot-*/**'
|
||||
- 'samples/server/petstore/kotlin-server-required-and-nullable-properties/**'
|
||||
- 'samples/server/petstore/kotlin-spring-declarative*/**'
|
||||
- 'samples/server/petstore/kotlin-spring-sealed-interfaces/**'
|
||||
# comment out due to gradle build failure
|
||||
# - samples/server/petstore/kotlin-spring-default/**
|
||||
pull_request:
|
||||
@@ -21,11 +22,12 @@ on:
|
||||
- 'samples/server/petstore/kotlin-springboot-*/**'
|
||||
- 'samples/server/petstore/kotlin-server-required-and-nullable-properties/**'
|
||||
- 'samples/server/petstore/kotlin-spring-declarative*/**'
|
||||
- 'samples/server/petstore/kotlin-spring-sealed-interfaces/**'
|
||||
# comment out due to gradle build failure
|
||||
# - samples/server/petstore/kotlin-spring-default/**
|
||||
|
||||
env:
|
||||
GRADLE_VERSION: '8.10'
|
||||
GRADLE_VERSION: '8.14'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -46,17 +48,20 @@ jobs:
|
||||
- samples/server/petstore/kotlin-springboot-additionalproperties
|
||||
- samples/server/petstore/kotlin-springboot-delegate-nodefaults
|
||||
- samples/server/petstore/kotlin-springboot-request-cookie
|
||||
- samples/server/petstore/kotlin-springboot-4
|
||||
- samples/server/petstore/kotlin-server/jaxrs-spec
|
||||
- samples/server/petstore/kotlin-server/jaxrs-spec-mutiny
|
||||
- samples/server/petstore/kotlin-server/javalin
|
||||
- samples/server/petstore/kotlin-server/javalin-6
|
||||
- samples/server/petstore/kotlin-server/ktor
|
||||
- samples/server/petstore/kotlin-server/ktor2
|
||||
- samples/server/petstore/kotlin-server-modelMutable
|
||||
- samples/server/petstore/kotlin-misk
|
||||
- samples/server/petstore/kotlin-spring-declarative-interface
|
||||
- samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines
|
||||
- samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped
|
||||
- samples/server/petstore/kotlin-spring-declarative-interface-wrapped
|
||||
- samples/server/petstore/kotlin-spring-sealed-interfaces
|
||||
# comment out due to gradle build failure
|
||||
# - samples/server/petstore/kotlin-spring-default/
|
||||
steps:
|
||||
|
||||
@@ -13,7 +13,7 @@ on:
|
||||
- 'samples/server/petstore/kotlin-server-required-and-nullable-properties/**'
|
||||
|
||||
env:
|
||||
GRADLE_VERSION: '8.10'
|
||||
GRADLE_VERSION: '8.14'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
2
.github/workflows/samples-kotlin-server.yaml
vendored
2
.github/workflows/samples-kotlin-server.yaml
vendored
@@ -42,11 +42,9 @@ jobs:
|
||||
- samples/server/petstore/kotlin-springboot-springfox
|
||||
- samples/server/petstore/kotlin-springboot-x-kotlin-implements
|
||||
- samples/server/petstore/kotlin-springboot-include-http-request-context-delegate
|
||||
- samples/server/petstore/kotlin-server/ktor
|
||||
- samples/server/petstore/kotlin-server/ktor2
|
||||
- samples/server/petstore/kotlin-server/jaxrs-spec
|
||||
- samples/server/petstore/kotlin-server/jaxrs-spec-mutiny
|
||||
- samples/server/petstore/kotlin-server-modelMutable
|
||||
- samples/server/petstore/kotlin-server/javalin
|
||||
- samples/server/others/kotlin-server/jaxrs-spec
|
||||
- samples/server/others/kotlin-server/jaxrs-spec-array-response
|
||||
|
||||
8
.github/workflows/samples-ocaml.yaml
vendored
8
.github/workflows/samples-ocaml.yaml
vendored
@@ -7,12 +7,16 @@ on:
|
||||
- 'samples/client/petstore/ocaml-fake-petstore/**'
|
||||
- 'samples/client/petstore/ocaml-oneOf-primitive/**'
|
||||
- 'samples/client/petstore/ocaml-additional-properties/**'
|
||||
- 'samples/client/petstore/ocaml-enum-in-composed-schema/**'
|
||||
- 'samples/client/petstore/ocaml-recursion-test/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'samples/client/petstore/ocaml/**'
|
||||
- 'samples/client/petstore/ocaml-fake-petstore/**'
|
||||
- 'samples/client/petstore/ocaml-oneOf-primitive/**'
|
||||
- 'samples/client/petstore/ocaml-additional-properties/**'
|
||||
- 'samples/client/petstore/ocaml-enum-in-composed-schema/**'
|
||||
- 'samples/client/petstore/ocaml-recursion-test/**'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -26,12 +30,14 @@ jobs:
|
||||
- 'samples/client/petstore/ocaml-fake-petstore/'
|
||||
- 'samples/client/petstore/ocaml-oneOf-primitive/'
|
||||
- 'samples/client/petstore/ocaml-additional-properties/'
|
||||
- 'samples/client/petstore/ocaml-enum-in-composed-schema/'
|
||||
- 'samples/client/petstore/ocaml-recursion-test/'
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- name: Set-up OCaml
|
||||
uses: ocaml/setup-ocaml@v3
|
||||
with:
|
||||
ocaml-compiler: 5
|
||||
ocaml-compiler: 5.3
|
||||
- name: Install
|
||||
run: opam install . --deps-only --with-test
|
||||
working-directory: ${{ matrix.sample }}
|
||||
|
||||
50
.github/workflows/samples-spring-jdk17.yaml
vendored
50
.github/workflows/samples-spring-jdk17.yaml
vendored
@@ -3,32 +3,32 @@ name: Samples Java Spring (JDK17)
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- samples/openapi3/client/petstore/spring-cloud-3-with-optional
|
||||
- samples/openapi3/client/petstore/spring-cloud-4-with-optional
|
||||
- samples/client/petstore/spring-http-interface-springboot-4
|
||||
- samples/openapi3/server/petstore/springboot-3
|
||||
- samples/openapi3/server/petstore/springboot-4
|
||||
- samples/server/petstore/springboot-api-response-examples
|
||||
- samples/server/petstore/springboot-lombok-data
|
||||
- samples/server/petstore/springboot-lombok-tostring
|
||||
- samples/server/petstore/springboot-file-delegate-optional
|
||||
- samples/server/petstore/springboot-petstore-with-api-response-examples
|
||||
- samples/server/petstore/spring-boot-oneof-sealed
|
||||
- samples/openapi3/server/petstore/spring-boot-oneof-interface
|
||||
- samples/openapi3/client/petstore/spring-cloud-3-with-optional/**
|
||||
- samples/openapi3/client/petstore/spring-cloud-4-with-optional/**
|
||||
- samples/client/petstore/spring-http-interface-springboot-4/**
|
||||
- samples/openapi3/server/petstore/springboot-3/**
|
||||
- samples/openapi3/server/petstore/springboot-4/**
|
||||
- samples/server/petstore/springboot-api-response-examples/**
|
||||
- samples/server/petstore/springboot-lombok-data/**
|
||||
- samples/server/petstore/springboot-lombok-tostring/**
|
||||
- samples/server/petstore/springboot-file-delegate-optional/**
|
||||
- samples/server/petstore/springboot-petstore-with-api-response-examples/**
|
||||
- samples/openapi3/server/petstore/spring-boot-oneof-sealed/**
|
||||
- samples/openapi3/server/petstore/spring-boot-oneof-interface/**
|
||||
pull_request:
|
||||
paths:
|
||||
- samples/openapi3/client/petstore/spring-cloud-3-with-optional
|
||||
- samples/openapi3/client/petstore/spring-cloud-4-with-optional
|
||||
- samples/client/petstore/spring-http-interface-springboot-4
|
||||
- samples/openapi3/server/petstore/springboot-3
|
||||
- samples/openapi3/server/petstore/springboot-4
|
||||
- samples/server/petstore/springboot-api-response-examples
|
||||
- samples/server/petstore/springboot-lombok-data
|
||||
- samples/server/petstore/springboot-lombok-tostring
|
||||
- samples/server/petstore/springboot-file-delegate-optional
|
||||
- samples/server/petstore/springboot-petstore-with-api-response-examples
|
||||
- samples/server/petstore/spring-boot-oneof-sealed
|
||||
- samples/openapi3/server/petstore/spring-boot-oneof-interface
|
||||
- samples/openapi3/client/petstore/spring-cloud-3-with-optional/**
|
||||
- samples/openapi3/client/petstore/spring-cloud-4-with-optional/**
|
||||
- samples/client/petstore/spring-http-interface-springboot-4/**
|
||||
- samples/openapi3/server/petstore/springboot-3/**
|
||||
- samples/openapi3/server/petstore/springboot-4/**
|
||||
- samples/server/petstore/springboot-api-response-examples/**
|
||||
- samples/server/petstore/springboot-lombok-data/**
|
||||
- samples/server/petstore/springboot-lombok-tostring/**
|
||||
- samples/server/petstore/springboot-file-delegate-optional/**
|
||||
- samples/server/petstore/springboot-petstore-with-api-response-examples/**
|
||||
- samples/openapi3/server/petstore/spring-boot-oneof-sealed/**
|
||||
- samples/openapi3/server/petstore/spring-boot-oneof-interface/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build Java Spring (JDK17)
|
||||
@@ -49,7 +49,7 @@ jobs:
|
||||
- samples/server/petstore/springboot-lombok-tostring
|
||||
- samples/server/petstore/springboot-file-delegate-optional
|
||||
- samples/server/petstore/springboot-petstore-with-api-response-examples
|
||||
- samples/server/petstore/spring-boot-oneof-sealed
|
||||
- samples/openapi3/server/petstore/spring-boot-oneof-sealed
|
||||
- samples/openapi3/server/petstore/spring-boot-oneof-interface
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
1
.github/workflows/samples-spring.yaml
vendored
1
.github/workflows/samples-spring.yaml
vendored
@@ -44,6 +44,7 @@ jobs:
|
||||
- samples/server/petstore/spring-boot-nullable-set
|
||||
- samples/server/petstore/spring-boot-defaultInterface-unhandledExcp
|
||||
- samples/server/petstore/springboot
|
||||
- samples/server/petstore/springboot-include-http-request-context
|
||||
- samples/server/petstore/springboot-beanvalidation
|
||||
- samples/server/petstore/springboot-builtin-validation
|
||||
- samples/server/petstore/springboot-delegate
|
||||
|
||||
@@ -5,6 +5,7 @@ on:
|
||||
paths:
|
||||
- samples/server/petstore/typescript-nestjs-server/**
|
||||
- .github/workflows/samples-typescript-nestjs-server.yaml
|
||||
- .github/workflows/samples-typescript-nestjs-server-parameters.yaml
|
||||
jobs:
|
||||
build:
|
||||
name: Test TypeScript NestJS Server
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -304,6 +304,8 @@ samples/client/petstore/ocaml/_build/
|
||||
samples/client/petstore/ocaml-fake-petstore/_build/
|
||||
samples/client/petstore/ocaml-oneOf-primitive/_build/
|
||||
samples/client/petstore/ocaml-additional-properties/_build/
|
||||
samples/client/petstore/ocaml-enum-in-composed-schema/_build/
|
||||
samples/client/petstore/ocaml-recursion-test/_build/
|
||||
|
||||
# jetbrain http client
|
||||
samples/client/jetbrains/adyen/checkout71/http/client/Apis/http-client.private.env.json
|
||||
|
||||
19
README.md
19
README.md
@@ -15,7 +15,7 @@
|
||||
|
||||
<div align="center">
|
||||
|
||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.20.0`):
|
||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.21.0`):
|
||||
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
|
||||
[](https://app.bitrise.io/app/4a2b10a819d12b67)
|
||||
|
||||
@@ -76,6 +76,7 @@ If you find OpenAPI Generator useful for work, please consider asking your compa
|
||||
[<img src="https://openapi-generator.tech/img/companies/savetwt.jpg" width="128" height="128">](https://savetwt.com/?utm_source=openapi-generator&utm_medium=sponsorship&utm_campaign=oss-sponsorship)
|
||||
[<img src="https://openapi-generator.tech/img/companies/serpapi.png" width="128" height="128">](https://serpapi.com/?utm_source=openapi-generator&utm_medium=sponsorship&utm_campaign=oss-sponsorship)
|
||||
[<img src="https://openapi-generator.tech/img/companies/socialwick.png" width="128" height="128">](https://socialwick.com/?utm_source=openapi-generator&utm_medium=sponsorship&utm_campaign=oss-sponsorship)
|
||||
[<img src="https://openapi-generator.tech/img/companies/fbpostlikes.png" width="128" height="128">](https://fbpostlikes.com/?utm_source=openapi-generator&utm_medium=sponsorship&utm_campaign=oss-sponsorship)
|
||||
|
||||
#### Thank you GoDaddy for sponsoring the domain names, Linode for sponsoring the VPS, Checkly for sponsoring the API monitoring and Gradle for sponsoring Develocity
|
||||
|
||||
@@ -149,8 +150,8 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
|
||||
|
||||
| OpenAPI Generator Version | Release Date | Notes |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- |
|
||||
| 7.20.0 (upcoming minor release) [SNAPSHOT](https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-to-test-with-the-latest-master-of-openapi-generator) | 20.02.2026 | Minor release with breaking changes (with fallback) |
|
||||
| [7.19.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.19.0) (latest stable release) | 20.01.2026 | Minor release with breaking changes (with fallback) |
|
||||
| 7.21.0 (upcoming minor release) [SNAPSHOT](https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-to-test-with-the-latest-master-of-openapi-generator) | 20.03.2026 | Minor release with breaking changes (with fallback) |
|
||||
| [7.20.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.20.0) (latest stable release) | 16.02.2026 | Minor release with breaking changes (with fallback) |
|
||||
| [6.6.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v6.6.0) | 11.05.2023 | Minor release with breaking changes (with fallback) |
|
||||
| [5.4.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.4.0) | 31.01.2022 | Minor release with breaking changes (with fallback) |
|
||||
| [4.3.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.3.1) | 06.05.2020 | Patch release (enhancements, bug fixes, etc) |
|
||||
@@ -213,16 +214,16 @@ See the different versions of the [openapi-generator-cli](https://search.maven.o
|
||||
<!-- RELEASE_VERSION -->
|
||||
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 11 runtime at a minimum):
|
||||
|
||||
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.19.0/openapi-generator-cli-7.19.0.jar`
|
||||
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.20.0/openapi-generator-cli-7.20.0.jar`
|
||||
|
||||
For **Mac/Linux** users:
|
||||
```sh
|
||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.19.0/openapi-generator-cli-7.19.0.jar -O openapi-generator-cli.jar
|
||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.20.0/openapi-generator-cli-7.20.0.jar -O openapi-generator-cli.jar
|
||||
```
|
||||
|
||||
For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.
|
||||
```
|
||||
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.19.0/openapi-generator-cli-7.19.0.jar
|
||||
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.20.0/openapi-generator-cli-7.20.0.jar
|
||||
```
|
||||
|
||||
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
|
||||
@@ -457,7 +458,7 @@ openapi-generator-cli version
|
||||
To use a specific version of "openapi-generator-cli"
|
||||
|
||||
```sh
|
||||
openapi-generator-cli version-manager set 7.19.0
|
||||
openapi-generator-cli version-manager set 7.20.0
|
||||
```
|
||||
|
||||
Or install it as dev-dependency:
|
||||
@@ -481,7 +482,7 @@ pip install openapi-generator-cli
|
||||
|
||||
To install a specific version
|
||||
```
|
||||
pip install openapi-generator-cli==7.19.0
|
||||
pip install openapi-generator-cli==7.20.0
|
||||
```
|
||||
|
||||
You can also install with [jdk4py](https://github.com/activeviam/jdk4py) instead of java binary. (python>=3.10 is required)
|
||||
@@ -507,7 +508,7 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat
|
||||
(if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php -o c:\temp\php_api_client`)
|
||||
|
||||
<!-- RELEASE_VERSION -->
|
||||
You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.19.0/openapi-generator-cli-7.19.0.jar)
|
||||
You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.20.0/openapi-generator-cli-7.20.0.jar)
|
||||
<!-- /RELEASE_VERSION -->
|
||||
|
||||
To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate`
|
||||
|
||||
@@ -4,6 +4,7 @@ inputSpec: modules/openapi-generator/src/test/resources/2_0/c/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/C-libcurl
|
||||
additionalProperties:
|
||||
useJsonUnformatted: true
|
||||
declareNumberBooleanWithoutPointer: true
|
||||
modelNameMappings:
|
||||
another_model: MappedModel
|
||||
another_property: mappedProperty
|
||||
|
||||
10
bin/configs/java-restclient-springBoot4-jackson2.yaml
Normal file
10
bin/configs/java-restclient-springBoot4-jackson2.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
generatorName: java
|
||||
outputDir: samples/client/petstore/java/restclient-springBoot4-jackson2
|
||||
library: restclient
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-addpet-only.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/Java
|
||||
additionalProperties:
|
||||
artifactId: petstore-restclient
|
||||
hideGenerationTimestamp: "true"
|
||||
containerDefaultToNull: "true"
|
||||
useSpringBoot4: true
|
||||
12
bin/configs/java-restclient-springBoot4-jackson3.yaml
Normal file
12
bin/configs/java-restclient-springBoot4-jackson3.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
generatorName: java
|
||||
outputDir: samples/client/petstore/java/restclient-springBoot4-jackson3
|
||||
library: restclient
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-addpet-only.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/Java
|
||||
additionalProperties:
|
||||
artifactId: petstore-restclient
|
||||
hideGenerationTimestamp: "true"
|
||||
containerDefaultToNull: "true"
|
||||
useSpringBoot4: true
|
||||
useJackson3: true
|
||||
openApiNullable: false
|
||||
12
bin/configs/java-resttemplate-springBoot4-jackson2.yaml
Normal file
12
bin/configs/java-resttemplate-springBoot4-jackson2.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
generatorName: java
|
||||
outputDir: samples/client/petstore/java/resttemplate-springBoot4-jackson2
|
||||
library: resttemplate
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-addpet-only.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/Java
|
||||
additionalProperties:
|
||||
artifactId: petstore-resttemplate
|
||||
hideGenerationTimestamp: "true"
|
||||
containerDefaultToNull: "true"
|
||||
useJakartaEe: true
|
||||
useSpringBoot4: true
|
||||
|
||||
13
bin/configs/java-resttemplate-springBoot4-jackson3.yaml
Normal file
13
bin/configs/java-resttemplate-springBoot4-jackson3.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
generatorName: java
|
||||
outputDir: samples/client/petstore/java/resttemplate-springBoot4-jackson3
|
||||
library: resttemplate
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-addpet-only.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/Java
|
||||
additionalProperties:
|
||||
artifactId: petstore-resttemplate
|
||||
hideGenerationTimestamp: "true"
|
||||
containerDefaultToNull: "true"
|
||||
useJakartaEe: true
|
||||
useSpringBoot4: true
|
||||
useJackson3: true
|
||||
openApiNullable: false
|
||||
12
bin/configs/java-webclient-springBoot4-jackson3.yaml
Normal file
12
bin/configs/java-webclient-springBoot4-jackson3.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
generatorName: java
|
||||
outputDir: samples/client/petstore/java/webclient-springBoot4-jackson3
|
||||
library: webclient
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-addpet-only.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/Java
|
||||
additionalProperties:
|
||||
artifactId: petstore-webclient
|
||||
hideGenerationTimestamp: "true"
|
||||
containerDefaultToNull: "true"
|
||||
useSpringBoot4: true
|
||||
useJackson3: true
|
||||
openApiNullable: false
|
||||
9
bin/configs/kotlin-enum-integers-multiplatform.yaml
Normal file
9
bin/configs/kotlin-enum-integers-multiplatform.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
generatorName: kotlin
|
||||
outputDir: samples/client/petstore/kotlin-enum-integers-multiplatform
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_21204_enum_integers.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/kotlin-client
|
||||
additionalProperties:
|
||||
artifactId: kotlin-enum-integers-multiplatform
|
||||
library: multiplatform
|
||||
dateLibrary: kotlinx-datetime
|
||||
sortParamsByRequiredFlag: false
|
||||
@@ -1,7 +1,8 @@
|
||||
generatorName: kotlin
|
||||
outputDir: samples/client/petstore/kotlin-gson
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/kotlin-client
|
||||
additionalProperties:
|
||||
serializationLibrary: gson
|
||||
artifactId: kotlin-petstore-gson
|
||||
companionObject: true
|
||||
|
||||
12
bin/configs/kotlin-oneOf-anyOf-kotlinx-serialization.yaml
Normal file
12
bin/configs/kotlin-oneOf-anyOf-kotlinx-serialization.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
generatorName: kotlin
|
||||
outputDir: samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/oneof-anyof-non-discriminator.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/kotlin-client
|
||||
additionalProperties:
|
||||
artifactId: kotlin-oneOf-anyOf-kotlinx-serialization
|
||||
serializableModel: "false"
|
||||
dateLibrary: java8
|
||||
library: jvm-retrofit2
|
||||
enumUnknownDefaultCase: true
|
||||
serializationLibrary: kotlinx_serialization
|
||||
generateOneOfAnyOfWrappers: true
|
||||
16
bin/configs/kotlin-spring-boot-4.yaml
Normal file
16
bin/configs/kotlin-spring-boot-4.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
generatorName: kotlin-spring
|
||||
outputDir: samples/server/petstore/kotlin-springboot-4
|
||||
library: spring-boot
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/kotlin-spring
|
||||
additionalProperties:
|
||||
documentationProvider: none
|
||||
annotationLibrary: none
|
||||
useSwaggerUI: "false"
|
||||
serviceImplementation: "true"
|
||||
serializableModel: "true"
|
||||
beanValidations: "true"
|
||||
useSpringBoot4: "true"
|
||||
useJackson3: "true"
|
||||
requestMappingMode: api_interface
|
||||
gradleBuildFile: "true"
|
||||
11
bin/configs/kotlin-spring-sealed-interfaces.yaml
Normal file
11
bin/configs/kotlin-spring-sealed-interfaces.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
generatorName: kotlin-spring
|
||||
outputDir: samples/server/petstore/kotlin-spring-sealed-interfaces
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/kotlin-spring
|
||||
additionalProperties:
|
||||
useSealedResponseInterfaces: true
|
||||
interfaceOnly: true
|
||||
dateLibrary: java8
|
||||
useSpringBoot3: true
|
||||
reactive: false
|
||||
documentationProvider: none
|
||||
6
bin/configs/ocaml-enum-in-composed-schema.yaml
Normal file
6
bin/configs/ocaml-enum-in-composed-schema.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
generatorName: ocaml
|
||||
outputDir: samples/client/petstore/ocaml-enum-in-composed-schema
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/ocaml/enum-in-composed-schema.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/ocaml
|
||||
additionalProperties:
|
||||
packageName: petstore_client
|
||||
6
bin/configs/ocaml-recursion-test.yaml
Normal file
6
bin/configs/ocaml-recursion-test.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
generatorName: ocaml
|
||||
outputDir: samples/client/petstore/ocaml-recursion-test
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/ocaml/direct-recursion.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/ocaml
|
||||
additionalProperties:
|
||||
packageName: recursion_test
|
||||
17
bin/configs/spring-boot-3-include-http-request-context.yaml
Normal file
17
bin/configs/spring-boot-3-include-http-request-context.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
generatorName: spring
|
||||
outputDir: samples/openapi3/server/petstore/springboot-3-include-http-request-context
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
|
||||
additionalProperties:
|
||||
groupId: org.openapitools.openapi3
|
||||
documentationProvider: springdoc
|
||||
artifactId: springboot
|
||||
snapshotVersion: "true"
|
||||
useSpringBoot3: true
|
||||
useBeanValidation: true
|
||||
withXml: true
|
||||
hideGenerationTimestamp: "true"
|
||||
generateConstructorWithAllArgs: true
|
||||
generateBuilders: true
|
||||
includeHttpRequestContext: "true"
|
||||
delegatePattern: true
|
||||
12
bin/configs/spring-boot-include-http-request-context.yaml
Normal file
12
bin/configs/spring-boot-include-http-request-context.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
generatorName: spring
|
||||
outputDir: samples/server/petstore/springboot-include-http-request-context
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
|
||||
additionalProperties:
|
||||
documentationProvider: springfox
|
||||
artifactId: springboot
|
||||
snapshotVersion: "true"
|
||||
hideGenerationTimestamp: "true"
|
||||
camelCaseDollarSign: "true"
|
||||
modelNameSuffix: 'Dto'
|
||||
includeHttpRequestContext: "true"
|
||||
@@ -10,3 +10,4 @@ additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
delegatePattern: "true"
|
||||
useResponseEntity: "false"
|
||||
includeHttpRequestContext: "false"
|
||||
|
||||
@@ -3,6 +3,7 @@ outputDir: samples/server/petstore/springboot-x-implements-skip
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-x-implements.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
|
||||
additionalProperties:
|
||||
additionalNotNullAnnotations: true
|
||||
documentationProvider: springfox
|
||||
artifactId: springboot
|
||||
snapshotVersion: "true"
|
||||
@@ -12,4 +13,4 @@ additionalProperties:
|
||||
xImplementsSkip: [ com.custompackage.InterfaceToSkip ]
|
||||
schemaImplements:
|
||||
Foo: [ com.custompackage.WithBar, com.custompackage.WithDefaultMethod ]
|
||||
Animal: com.custompackage.WithColor
|
||||
Animal: com.custompackage.WithColor
|
||||
|
||||
6
bin/configs/typescript-nestjs-server-parameters.yaml
Normal file
6
bin/configs/typescript-nestjs-server-parameters.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
generatorName: typescript-nestjs-server
|
||||
outputDir: samples/server/petstore/typescript-nestjs-server/builds/parameters
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/parameter-test-spec.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/typescript-nestjs-server
|
||||
additionalProperties:
|
||||
"useSingleRequestParameter" : true
|
||||
@@ -19,6 +19,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
| Option | Description | Values | Default |
|
||||
| ------ | ----------- | ------ | ------- |
|
||||
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
||||
|declareNumberBooleanWithoutPointer|Declare number, boolean types without pointer using model-body, model-header templates from OpenAPI Generator v7.20.0.| |false|
|
||||
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|
||||
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
||||
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|
||||
|
||||
@@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|equalityCheckMethod|Specify equality check method. Takes effect only in case if serializationLibrary is json_serializable.|<dl><dt>**default**</dt><dd>[DEFAULT] Built in hash code generation method</dd><dt>**equatable**</dt><dd>Uses equatable library for equality checking</dd></dl>|default|
|
||||
|finalProperties|Whether properties are marked as final when using Json Serializable for serialization| |true|
|
||||
|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|
|
||||
|patchOnly|Only apply Optional<T> to PATCH operation request bodies (requires useOptional=true)| |false|
|
||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||
|pubAuthor|Author name in generated pubspec| |Author|
|
||||
|pubAuthorEmail|Email address of the author in generated pubspec| |author@homepage|
|
||||
@@ -42,6 +43,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
||||
|sourceFolder|source folder for generated code| |src|
|
||||
|useEnumExtension|Allow the 'x-enum-values' extension for enums| |false|
|
||||
|useOptional|Use Optional<T> to distinguish absent, null, and present for optional fields (Dart 3+)| |false|
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
@@ -58,6 +60,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
## LANGUAGE PRIMITIVES
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>Object</li>
|
||||
<li>String</li>
|
||||
<li>bool</li>
|
||||
<li>double</li>
|
||||
|
||||
@@ -23,6 +23,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
||||
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|
||||
|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|
|
||||
|patchOnly|Only apply Optional<T> to PATCH operation request bodies (requires useOptional=true)| |false|
|
||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||
|pubAuthor|Author name in generated pubspec| |Author|
|
||||
|pubAuthorEmail|Email address of the author in generated pubspec| |author@homepage|
|
||||
@@ -38,6 +39,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
||||
|sourceFolder|source folder for generated code| |src|
|
||||
|useEnumExtension|Allow the 'x-enum-values' extension for enums| |false|
|
||||
|useOptional|Use Optional<T> to distinguish absent, null, and present for optional fields (Dart 3+)| |false|
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
@@ -54,6 +56,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
## LANGUAGE PRIMITIVES
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>Object</li>
|
||||
<li>String</li>
|
||||
<li>bool</li>
|
||||
<li>double</li>
|
||||
|
||||
@@ -20,6 +20,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
| ------ | ----------- | ------ | ------- |
|
||||
|additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null|
|
||||
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null|
|
||||
|additionalNotNullAnnotations|Add @NotNull to path variables (required by default) and requestBody.| |false|
|
||||
|additionalOneOfTypeAnnotations|Additional annotations for oneOf interfaces(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null|
|
||||
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
||||
|annotationLibrary|Select the complementary documentation annotation library.|<dl><dt>**none**</dt><dd>Do not annotate Model and Api with complementary annotations.</dd><dt>**swagger1**</dt><dd>Annotate Model and Api using the Swagger Annotations 1.x library.</dd><dt>**swagger2**</dt><dd>Annotate Model and Api using the Swagger Annotations 2.x library.</dd></dl>|swagger2|
|
||||
@@ -68,6 +69,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|
|
||||
|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false|
|
||||
|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|
|
||||
|includeHttpRequestContext|Whether to include HttpServletRequest (blocking) or ServerWebExchange (reactive) as additional parameter in generated methods. Defaults to 'true' for reactive and 'false' for blocking.| |true (reactive) / false (blocking)|
|
||||
|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false|
|
||||
|invokerPackage|root package for generated code| |org.openapitools.api|
|
||||
|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>|false|
|
||||
|
||||
@@ -64,7 +64,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|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|
|
||||
|invokerPackage|root package for generated code| |org.openapitools.client|
|
||||
|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|
|
||||
|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|
|
||||
|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.2.x if `useJakartaEe=true`, 7.x.x if `useSpringBoot4=true`). JSON processing: Jackson 2.x (3.x if `useJackson3=true`)</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|
|
||||
|licenseName|The name of the license| |Unlicense|
|
||||
|licenseUrl|The URL of the license| |http://unlicense.org|
|
||||
|microprofileFramework|Framework for microprofile. Possible values "kumuluzee"| |null|
|
||||
@@ -97,6 +97,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|useBeanValidation|Use BeanValidation API annotations| |false|
|
||||
|useEnumCaseInsensitive|Use `equalsIgnoreCase` when String for enum comparison| |false|
|
||||
|useGzipFeature|Send gzip-encoded requests| |false|
|
||||
|useJackson3|Set it in order to use jackson 3 dependencies (only allowed when `useSpringBoot4` is set and incompatible with `openApiNullable`).| |false|
|
||||
|useJakartaEe|whether to use Jakarta EE namespace instead of javax| |false|
|
||||
|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped. Only jersey2, jersey3, native, okhttp-gson support this option.| |false|
|
||||
|useOneOfInterfaces|whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface| |false|
|
||||
@@ -107,6 +108,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|useRxJava3|Whether to use the RxJava3 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false|
|
||||
|useSealedOneOfInterfaces|Generate the oneOf interfaces as sealed interfaces. Only supported for WebClient and RestClient.| |false|
|
||||
|useSingleRequestParameter|Setting this property to "true" will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY native, jersey2, jersey3, okhttp-gson, microprofile, Spring RestClient, Spring WebClient support this option. Setting this property to "static" does the same as "true", but also makes the generated arguments class static with single parameter instantiation.| |false|
|
||||
|useSpringBoot4|Generate code and provide dependencies for use with Spring Boot 4.x.| |false|
|
||||
|useUnaryInterceptor|If true it will generate ResponseInterceptors using a UnaryOperator. This can be usefull for manipulating the request before it gets passed, for example doing your own decryption| |false|
|
||||
|webclientBlockingOperations|Making all WebClient operations blocking(sync). Note that if on operation 'x-webclient-blocking: false' then such operation won't be sync| |false|
|
||||
|withAWSV4Signature|whether to include AWS v4 signature support (only available for okhttp-gson library)| |false|
|
||||
|
||||
@@ -64,7 +64,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|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|
|
||||
|invokerPackage|root package for generated code| |org.openapitools.client|
|
||||
|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|
|
||||
|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|
|
||||
|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.2.x if `useJakartaEe=true`, 7.x.x if `useSpringBoot4=true`). JSON processing: Jackson 2.x (3.x if `useJackson3=true`)</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|
|
||||
|licenseName|The name of the license| |Unlicense|
|
||||
|licenseUrl|The URL of the license| |http://unlicense.org|
|
||||
|microprofileFramework|Framework for microprofile. Possible values "kumuluzee"| |null|
|
||||
@@ -97,6 +97,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|useBeanValidation|Use BeanValidation API annotations| |false|
|
||||
|useEnumCaseInsensitive|Use `equalsIgnoreCase` when String for enum comparison| |false|
|
||||
|useGzipFeature|Send gzip-encoded requests| |false|
|
||||
|useJackson3|Set it in order to use jackson 3 dependencies (only allowed when `useSpringBoot4` is set and incompatible with `openApiNullable`).| |false|
|
||||
|useJakartaEe|whether to use Jakarta EE namespace instead of javax| |false|
|
||||
|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped. Only jersey2, jersey3, native, okhttp-gson support this option.| |false|
|
||||
|useOneOfInterfaces|whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface| |false|
|
||||
@@ -107,6 +108,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|useRxJava3|Whether to use the RxJava3 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false|
|
||||
|useSealedOneOfInterfaces|Generate the oneOf interfaces as sealed interfaces. Only supported for WebClient and RestClient.| |false|
|
||||
|useSingleRequestParameter|Setting this property to "true" will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY native, jersey2, jersey3, okhttp-gson, microprofile, Spring RestClient, Spring WebClient support this option. Setting this property to "static" does the same as "true", but also makes the generated arguments class static with single parameter instantiation.| |false|
|
||||
|useSpringBoot4|Generate code and provide dependencies for use with Spring Boot 4.x.| |false|
|
||||
|useUnaryInterceptor|If true it will generate ResponseInterceptors using a UnaryOperator. This can be usefull for manipulating the request before it gets passed, for example doing your own decryption| |false|
|
||||
|webclientBlockingOperations|Making all WebClient operations blocking(sync). Note that if on operation 'x-webclient-blocking: false' then such operation won't be sync| |false|
|
||||
|withAWSV4Signature|whether to include AWS v4 signature support (only available for okhttp-gson library)| |false|
|
||||
|
||||
@@ -27,6 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|autoXSpringPaginated|Automatically add x-spring-paginated to operations that have 'page', 'size', and 'sort' query parameters. When enabled, operations with all three parameters will have Pageable support automatically applied. Operations with x-spring-paginated explicitly set to false will not be auto-detected.| |false|
|
||||
|basePackage|base package (invokerPackage) for generated code| |org.openapitools|
|
||||
|beanQualifiers|Whether to add fully-qualifier class names as bean qualifiers in @Component and @RestController annotations. May be used to prevent bean names clash if multiple generated libraries (contexts) added to single project.| |false|
|
||||
|companionObject|Whether to generate companion objects in data classes, enabling companion extensions.| |false|
|
||||
|configPackage|configuration package for generated code| |org.openapitools.configuration|
|
||||
|declarativeInterfaceReactiveMode|What type of reactive style to use in Spring Http declarative interface|<dl><dt>**coroutines**</dt><dd>Use kotlin-idiomatic 'suspend' functions</dd><dt>**reactor**</dt><dd>Use reactor return wrappers 'Mono' and 'Flux'</dd></dl>|coroutines|
|
||||
|delegatePattern|Whether to generate the server files using the delegate pattern| |false|
|
||||
@@ -58,8 +59,11 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|useBeanValidation|Use BeanValidation API annotations to validate data types| |true|
|
||||
|useFeignClientUrl|Whether to generate Feign client with url parameter.| |true|
|
||||
|useFlowForArrayReturnType|Whether to use Flow for array/collection return types when reactive is enabled. If false, will use List instead.| |true|
|
||||
|useJackson3|Use Jackson 3 dependencies (tools.jackson package). Only available with `useSpringBoot4`. Defaults to true when `useSpringBoot4` is enabled. Incompatible with `openApiNullable`.| |false|
|
||||
|useResponseEntity|Whether (when false) to return actual type (e.g. List<Fruit>) and handle non-happy path responses via exceptions flow or (when true) return entire ResponseEntity (e.g. ResponseEntity<List<Fruit>>). If disabled, method are annotated using a @ResponseStatus annotation, which has the status of the first response declared in the Api definition| |true|
|
||||
|useSealedResponseInterfaces|Generate sealed interfaces for endpoint responses that all possible response types implement. Allows controllers to return any valid response type in a type-safe manner (e.g., sealed interface CreateUserResponse implemented by User, ConflictResponse, ErrorResponse)| |false|
|
||||
|useSpringBoot3|Generate code and provide dependencies for use with Spring Boot ≥ 3 (use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.| |false|
|
||||
|useSpringBoot4|Generate code and provide dependencies for use with Spring Boot 4.x. Enabling this option will also enable `useJakartaEe`.| |false|
|
||||
|useSwaggerUI|Open the OpenApi specification in swagger-ui. Will also import and configure needed dependencies| |true|
|
||||
|useTags|Whether to use tags for creating interface and controller class names| |false|
|
||||
|xKotlinImplementsFieldsSkip|A list of fields per schema name that should NOT be created with `override` keyword despite their presence in vendor extension `x-kotlin-implements-fields` for the schema. Example: yaml `xKotlinImplementsFieldsSkip: Pet: [photoUrls]` skips `override` for `photoUrls` in schema `Pet`| |empty map|
|
||||
|
||||
@@ -23,11 +23,12 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|artifactId|Generated artifact id (name of jar).| |kotlin-client|
|
||||
|artifactVersion|Generated artifact's package version.| |1.0.0|
|
||||
|collectionType|Option. Collection type to use|<dl><dt>**array**</dt><dd>kotlin.Array</dd><dt>**list**</dt><dd>kotlin.collections.List</dd></dl>|list|
|
||||
|companionObject|Whether to generate companion objects in data classes, enabling companion extensions.| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**threetenbp-localdatetime**</dt><dd>Threetenbp - Backport of JSR310 (jvm only, for legacy app only)</dd><dt>**kotlinx-datetime**</dt><dd>kotlinx-datetime (preferred for multiplatform)</dd><dt>**string**</dt><dd>String</dd><dt>**java8-localdatetime**</dt><dd>Java 8 native JSR310 (jvm only, for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (jvm only, preferred for jdk 1.8+)</dd><dt>**threetenbp**</dt><dd>Threetenbp - Backport of JSR310 (jvm only, preferred for jdk < 1.8)</dd></dl>|java8|
|
||||
|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |original|
|
||||
|explicitApi|Generates code with explicit access modifiers to comply with Kotlin Explicit API Mode.| |false|
|
||||
|failOnUnknownProperties|Fail Jackson de-serialization on unknown properties| |false|
|
||||
|generateOneOfAnyOfWrappers|Generate oneOf, anyOf schemas as wrappers. Only `jvm-retrofit2`(library), `gson`(serializationLibrary) support this option.| |false|
|
||||
|generateOneOfAnyOfWrappers|Generate oneOf, anyOf schemas as wrappers. Only `jvm-retrofit2`(library) with `gson` or `kotlinx_serialization`(serializationLibrary) support this option.| |false|
|
||||
|generateRoomModels|Generate Android Room database models in addition to API models (JVM Volley library only)| |false|
|
||||
|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools|
|
||||
|idea|Add IntelliJ Idea plugin and mark Kotlin main and test folders as source folders.| |false|
|
||||
@@ -49,6 +50,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|sourceFolder|source folder for generated code| |src/main/kotlin|
|
||||
|supportAndroidApiLevel25AndBelow|[WARNING] This flag will generate code that has a known security vulnerability. It uses `kotlin.io.createTempFile` instead of `java.nio.file.Files.createTempFile` in order to support Android API level 25 and below. For more info, please check the following links https://github.com/OpenAPITools/openapi-generator/security/advisories/GHSA-23x4-m842-fmwf, https://github.com/OpenAPITools/openapi-generator/pull/9284| |false|
|
||||
|useCoroutines|Whether to use the Coroutines adapter with the retrofit2 library.| |false|
|
||||
|useJackson3|Use Jackson 3 dependencies (tools.jackson package). Not yet supported for kotlin-client; reserved for future use.| |false|
|
||||
|useNonAsciiHeaders|Allow to use non-ascii headers with the okhttp library| |false|
|
||||
|useResponseAsReturnType|When using retrofit2 and coroutines, use `Response`<`T`> as return type instead of `T`.| |true|
|
||||
|useRxJava3|Whether to use the RxJava3 adapter with the retrofit2 library.| |false|
|
||||
|
||||
@@ -11,7 +11,7 @@ title: Documentation for the ocaml Generator
|
||||
| generator type | CLIENT | |
|
||||
| generator language | OCaml | |
|
||||
| generator default templating engine | mustache | |
|
||||
| helpTxt | Generates an OCaml client library (beta). | |
|
||||
| helpTxt | Generates an OCaml client library. | |
|
||||
|
||||
## CONFIG OPTIONS
|
||||
These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.
|
||||
|
||||
@@ -55,7 +55,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>List</li>
|
||||
<li>UUID</li>
|
||||
<li>bool</li>
|
||||
<li>bytearray</li>
|
||||
<li>bytes</li>
|
||||
<li>date</li>
|
||||
<li>datetime</li>
|
||||
|
||||
@@ -20,6 +20,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
| ------ | ----------- | ------ | ------- |
|
||||
|additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null|
|
||||
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null|
|
||||
|additionalNotNullAnnotations|Add @NotNull to path variables (required by default) and requestBody.| |false|
|
||||
|additionalOneOfTypeAnnotations|Additional annotations for oneOf interfaces(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null|
|
||||
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
||||
|annotationLibrary|Select the complementary documentation annotation library.|<dl><dt>**none**</dt><dd>Do not annotate Model and Api with complementary annotations.</dd><dt>**swagger1**</dt><dd>Annotate Model and Api using the Swagger Annotations 1.x library.</dd><dt>**swagger2**</dt><dd>Annotate Model and Api using the Swagger Annotations 2.x library.</dd></dl>|swagger2|
|
||||
@@ -61,6 +62,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|
|
||||
|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false|
|
||||
|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|
|
||||
|includeHttpRequestContext|Whether to include HttpServletRequest (blocking) or ServerWebExchange (reactive) as additional parameter in generated methods. Defaults to 'true' for reactive and 'false' for blocking.| |true (reactive) / false (blocking)|
|
||||
|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false|
|
||||
|invokerPackage|root package for generated code| |org.openapitools.api|
|
||||
|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>|false|
|
||||
|
||||
@@ -47,6 +47,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|useSquareBracketsInArrayNames|Setting this property to true will add brackets to array attribute names, e.g. my_values[].| |false|
|
||||
|validationAttributes|Setting this property to true will generate the validation attributes of model properties.| |false|
|
||||
|withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false|
|
||||
|withRequestOptsInInterface|Setting this property to true will include *RequestOpts methods in the API interface declarations. Set to false to keep them only on the class.| |true|
|
||||
|withoutRuntimeChecks|Setting this property to true will remove any runtime checks on the request and response payloads. Payloads will be casted to their expected types.| |false|
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
@@ -40,14 +40,14 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false|
|
||||
|paramNaming|Naming convention for parameters: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
|
||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||
|rxjsVersion|The version of RxJS compatible with Angular (see ngVersion option).| |null|
|
||||
|rxjsVersion|The version of RxJS.| |null|
|
||||
|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false|
|
||||
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|
||||
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
||||
|stringEnums|Generate string enums instead of objects for enum values.| |false|
|
||||
|supportsES6|Generate code that conforms to ES6.| |false|
|
||||
|taggedUnions|Use discriminators to create tagged unions instead of extending interfaces.| |false|
|
||||
|tsVersion|The version of typescript compatible with Angular (see ngVersion option).| |null|
|
||||
|tsVersion|The version of typescript.| |null|
|
||||
|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.| |false|
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
6
flake.lock
generated
6
flake.lock
generated
@@ -20,11 +20,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1737989155,
|
||||
"narHash": "sha256-TFJAGK7tt/jj1v747xNOzopxZ4odBIeDi6EJlYDg/bI=",
|
||||
"lastModified": 1771575107,
|
||||
"narHash": "sha256-RMiV8PRAuFFtJ0l6EZcADdBW1JP+DUIPpDXnMJp0w/k=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "5861228f6e9e9dd5d3f8e0a26411f682fdade93a",
|
||||
"rev": "6b0f198fe0363867d9f8cea387a3b9212b468839",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -13,8 +13,9 @@
|
||||
devShells.default = pkgs.mkShell
|
||||
{
|
||||
buildInputs = with pkgs;[
|
||||
jdk11
|
||||
jdk17
|
||||
maven
|
||||
gradle
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.20.0</version>
|
||||
<version>7.21.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.20.0</version>
|
||||
<version>7.21.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -541,7 +541,7 @@ This task exposes all options available via OpenAPI Generator CLI and the OpenAP
|
||||
openApiGenerate {
|
||||
generatorName.set("kotlin")
|
||||
inputSpec.set("$rootDir/specs/petstore-v3.0.yaml")
|
||||
outputDir.set("$buildDir/generated")
|
||||
outputDir.set(layout.buildDirectory.dir("generated").get().asFile.path)
|
||||
apiPackage.set("org.openapi.example.api")
|
||||
invokerPackage.set("org.openapi.example.invoker")
|
||||
modelPackage.set("org.openapi.example.model")
|
||||
@@ -694,7 +694,7 @@ task buildGoClient(type: org.openapitools.generator.gradle.plugin.tasks.Generate
|
||||
additionalProperties.set([
|
||||
packageName: "petstore"
|
||||
])
|
||||
outputDir.set("$buildDir/go")
|
||||
outputDir.set(layout.buildDirectory.dir("go").get().asFile.path)
|
||||
configOptions.set([
|
||||
dateLibrary: "threetenp"
|
||||
])
|
||||
@@ -702,7 +702,7 @@ task buildGoClient(type: org.openapitools.generator.gradle.plugin.tasks.Generate
|
||||
task buildKotlinClient(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask) {
|
||||
generatorName.set("kotlin")
|
||||
inputSpec.set("$rootDir/petstore-v3.0.yaml")
|
||||
outputDir.set("$buildDir/kotlin")
|
||||
outputDir.set(layout.buildDirectory.dir("kotlin").get().asFile.path)
|
||||
apiPackage.set("org.openapitools.example.api")
|
||||
invokerPackage.set("org.openapitools.example.invoker")
|
||||
modelPackage.set("org.openapitools.example.model")
|
||||
|
||||
@@ -3,12 +3,12 @@ import io.github.gradlenexus.publishplugin.ReleaseNexusStagingRepository
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
id("com.gradle.plugin-publish") version "1.1.0"
|
||||
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
|
||||
id("com.gradle.plugin-publish") version "2.0.0"
|
||||
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
|
||||
id("java-gradle-plugin")
|
||||
id("maven-publish")
|
||||
id("org.gradle.kotlin.kotlin-dsl") version "2.4.1"
|
||||
id("org.jetbrains.kotlin.jvm") version "1.9.0"
|
||||
id("org.gradle.kotlin.kotlin-dsl") version "5.2.0"
|
||||
id("org.jetbrains.kotlin.jvm") version "2.0.21"
|
||||
id("signing")
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
name = "Sonatype Snapshots"
|
||||
url "https://oss.sonatype.org/content/repositories/snapshots/"
|
||||
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ nexusPublishing {
|
||||
// or stored as key=value pairs in ~/.gradle/gradle.properties
|
||||
// You can also apply them in CI via environment variables. See Gradle's docs for details.
|
||||
signing {
|
||||
required { isReleaseVersion && gradle.taskGraph.hasTask("publishPluginMavenPublicationToSonatypeRepository") }
|
||||
required = { isReleaseVersion && gradle.taskGraph.hasTask("publishPluginMavenPublicationToSonatypeRepository") }
|
||||
sign(publishing.publications)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# RELEASE_VERSION
|
||||
openApiGeneratorVersion=7.20.0
|
||||
openApiGeneratorVersion=7.21.0-SNAPSHOT
|
||||
# /RELEASE_VERSION
|
||||
|
||||
# BEGIN placeholders
|
||||
|
||||
Binary file not shown.
@@ -1,6 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
37
modules/openapi-generator-gradle-plugin/gradlew
vendored
37
modules/openapi-generator-gradle-plugin/gradlew
vendored
@@ -15,6 +15,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
@@ -55,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
@@ -83,10 +85,8 @@ done
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@@ -114,7 +114,7 @@ case "$( uname )" in #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
CLASSPATH="\\\"\\\""
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
@@ -133,10 +133,13 @@ location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
@@ -144,7 +147,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
@@ -152,7 +155,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
@@ -197,16 +200,20 @@ if "$cygwin" || "$msys" ; then
|
||||
done
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
@@ -57,22 +59,22 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
set CLASSPATH=
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.20.0</version>
|
||||
<version>7.21.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<properties>
|
||||
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
|
||||
<gradleVersion>7.6.4</gradleVersion>
|
||||
<gradleVersion>8.14.4</gradleVersion>
|
||||
<gradle-tooling.version>7.4.2</gradle-tooling.version>
|
||||
</properties>
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
maven { url "https://repo1.maven.org/maven2" }
|
||||
maven { url = "https://repo1.maven.org/maven2" }
|
||||
maven {
|
||||
url "https://plugins.gradle.org/m2/"
|
||||
url = "https://plugins.gradle.org/m2/"
|
||||
}
|
||||
maven {
|
||||
url "https://oss.sonatype.org/content/repositories/releases/"
|
||||
url = "https://oss.sonatype.org/content/repositories/releases/"
|
||||
}
|
||||
maven {
|
||||
url "https://oss.sonatype.org/content/repositories/snapshots/"
|
||||
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
@@ -23,7 +23,7 @@ apply plugin: 'org.openapi.generator'
|
||||
openApiMeta {
|
||||
generatorName = "Sample"
|
||||
packageName = "org.openapitools.example"
|
||||
outputFolder = "$buildDir/meta".toString()
|
||||
outputFolder = layout.buildDirectory.dir("meta").get().asFile.toString()
|
||||
}
|
||||
|
||||
openApiValidate {
|
||||
@@ -35,7 +35,7 @@ openApiValidate {
|
||||
openApiGenerate {
|
||||
generatorName = "kotlin"
|
||||
inputSpec = "$rootDir/petstore-v3.0.yaml".toString()
|
||||
outputDir = "$buildDir/kotlin".toString()
|
||||
outputDir = layout.buildDirectory.dir("kotlin").get().asFile.toString()
|
||||
apiPackage = "org.openapitools.example.api"
|
||||
invokerPackage = "org.openapitools.example.invoker"
|
||||
modelPackage = "org.openapitools.example.model"
|
||||
@@ -58,7 +58,7 @@ task buildJavaResttemplateSdk(type: org.openapitools.generator.gradle.plugin.tas
|
||||
generatorName = "java"
|
||||
library = "resttemplate"
|
||||
inputSpec = "$rootDir/petstore-v3.0.yaml".toString()
|
||||
outputDir = "$buildDir/java-resttemplate-api-client"
|
||||
outputDir = layout.buildDirectory.dir("java-resttemplate-api-client").get().asFile.toString()
|
||||
apiPackage = "com.example.client"
|
||||
invokerPackage = "com.example.invoker"
|
||||
modelPackage = "com.example.cdm"
|
||||
@@ -79,7 +79,7 @@ task buildGoSdk(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTas
|
||||
additionalProperties = [
|
||||
packageName: "petstore"
|
||||
]
|
||||
outputDir = "$buildDir/go".toString()
|
||||
outputDir = layout.buildDirectory.dir("go").get().asFile.toString()
|
||||
configOptions = [
|
||||
dateLibrary: "threetenp"
|
||||
]
|
||||
@@ -92,7 +92,7 @@ task buildDotnetSdk(type: org.openapitools.generator.gradle.plugin.tasks.Generat
|
||||
packageGuid: "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}",
|
||||
useCompareNetObjects: "true"
|
||||
]
|
||||
outputDir = "$buildDir/csharp".toString()
|
||||
outputDir = layout.buildDirectory.dir("csharp").get().asFile.toString()
|
||||
globalProperties = [
|
||||
models: "",
|
||||
apis : "",
|
||||
@@ -106,7 +106,7 @@ task generateGoWithInvalidSpec(type: org.openapitools.generator.gradle.plugin.ta
|
||||
additionalProperties = [
|
||||
packageName: "petstore"
|
||||
]
|
||||
outputDir = "$buildDir/go".toString()
|
||||
outputDir = layout.buildDirectory.dir("go").get().asFile.toString()
|
||||
configOptions = [
|
||||
dateLibrary: "threetenp"
|
||||
]
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# RELEASE_VERSION
|
||||
openApiGeneratorVersion=7.20.0
|
||||
openApiGeneratorVersion=7.21.0-SNAPSHOT
|
||||
# /RELEASE_VERSION
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
@@ -55,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
@@ -83,10 +85,8 @@ done
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"'
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@@ -114,7 +114,7 @@ case "$( uname )" in #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
CLASSPATH="\\\"\\\""
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
@@ -133,10 +133,13 @@ location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
@@ -144,7 +147,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
@@ -152,7 +155,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
@@ -197,16 +200,20 @@ if "$cygwin" || "$msys" ; then
|
||||
done
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@@ -34,7 +36,7 @@ set APP_HOME=%DIRNAME%
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
@@ -57,22 +59,22 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
set CLASSPATH=
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
|
||||
@@ -60,7 +60,7 @@ class OpenApiGeneratorPlugin : Plugin<Project> {
|
||||
project
|
||||
)
|
||||
|
||||
generate.outputDir.set("$buildDir/generate-resources/main")
|
||||
generate.outputDir.set(project.layout.buildDirectory.dir("generate-resources/main").map { it.asFile.path })
|
||||
|
||||
tasks.apply {
|
||||
register("openApiGenerators", GeneratorsTask::class.java).configure {
|
||||
|
||||
@@ -20,7 +20,7 @@ class GenerateTaskConfigurationCacheTest : TestBase() {
|
||||
}
|
||||
|
||||
@DataProvider(name = "gradle_version_provider")
|
||||
private fun gradleVersionProviderWithConfigurationCache(): Array<Array<String>> = arrayOf(arrayOf("8.7"), arrayOf("7.6.4"))
|
||||
private fun gradleVersionProviderWithConfigurationCache(): Array<Array<String>> = arrayOf(arrayOf("8.14.4"), arrayOf("8.14.4"))
|
||||
|
||||
@DataProvider(name = "gradle_version_provider_without_cc")
|
||||
private fun gradleVersionProviderWithoutConfigurationCache(): Array<Array<String>> = arrayOf(arrayOf("5.6.1"))
|
||||
|
||||
@@ -22,7 +22,7 @@ class GenerateTaskFromCacheTest : TestBase() {
|
||||
}
|
||||
|
||||
@DataProvider(name = "gradle_version_provider")
|
||||
private fun gradleVersionProvider(): Array<Array<String>> = arrayOf(arrayOf("8.7"), arrayOf("7.6.4"))
|
||||
private fun gradleVersionProvider(): Array<Array<String>> = arrayOf(arrayOf("8.14.4"), arrayOf("8.14.4"))
|
||||
|
||||
// inputSpec tests
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import kotlin.test.assertEquals
|
||||
class GenerateTaskUpToDateTest : TestBase() {
|
||||
|
||||
@DataProvider(name = "gradle_version_provider")
|
||||
private fun gradleVersionProvider(): Array<Array<String>> = arrayOf(arrayOf("8.7"), arrayOf("7.6.4"))
|
||||
private fun gradleVersionProvider(): Array<Array<String>> = arrayOf(arrayOf("8.14.4"), arrayOf("8.14.4"))
|
||||
|
||||
// inputSpec tests
|
||||
|
||||
|
||||
@@ -4,11 +4,12 @@ import org.gradle.testkit.runner.GradleRunner
|
||||
import org.gradle.testkit.runner.TaskOutcome
|
||||
import org.testng.annotations.Test
|
||||
import java.io.File
|
||||
import kotlin.io.path.createTempDirectory
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertTrue
|
||||
|
||||
class GeneratorsTaskDslTest : TestBase() {
|
||||
override var temp: File = createTempDir(javaClass.simpleName)
|
||||
override var temp: File = createTempDirectory(javaClass.simpleName).toFile()
|
||||
|
||||
@Test
|
||||
fun `openApiGenerators should list generators available to the user`() {
|
||||
|
||||
@@ -4,16 +4,16 @@ import org.gradle.testkit.runner.GradleRunner
|
||||
import org.gradle.testkit.runner.TaskOutcome
|
||||
import org.testng.annotations.Test
|
||||
import java.io.File
|
||||
import java.nio.file.Files.createTempDirectory
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertTrue
|
||||
|
||||
class MetaTaskDslTest : TestBase() {
|
||||
override var temp: File = createTempDir(javaClass.simpleName)
|
||||
override var temp: File = createTempDirectory(javaClass.simpleName).toFile()
|
||||
|
||||
@Test
|
||||
fun `openApiMeta should generate desired project contents`() {
|
||||
// Arrange
|
||||
val buildDirReplacement = "\$buildDir/meta"
|
||||
withProject("""
|
||||
| plugins {
|
||||
| id 'org.openapi.generator'
|
||||
@@ -22,7 +22,7 @@ class MetaTaskDslTest : TestBase() {
|
||||
| openApiMeta {
|
||||
| generatorName = "Sample"
|
||||
| packageName = "org.openapitools.example"
|
||||
| outputFolder = "$buildDirReplacement".toString()
|
||||
| outputFolder = layout.buildDirectory.dir("meta").get().asFile.path
|
||||
| }
|
||||
""".trimMargin())
|
||||
|
||||
|
||||
@@ -17,8 +17,7 @@ class ValidateTaskDslTest : TestBase() {
|
||||
@DataProvider(name = "gradle_version_provider")
|
||||
fun gradleVersionProvider(): Array<Array<String?>> = arrayOf(
|
||||
arrayOf(null), // uses the version of Gradle used to build the plugin itself
|
||||
arrayOf("8.7"),
|
||||
arrayOf("7.6.4")
|
||||
arrayOf("8.14.4")
|
||||
)
|
||||
|
||||
private fun getGradleRunner(gradleVersion: String?): GradleRunner {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.20.0</version>
|
||||
<version>7.21.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.20.0</version>
|
||||
<version>7.21.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.20.0</version>
|
||||
<version>7.21.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.20.0</version>
|
||||
<version>7.21.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.20.0</version>
|
||||
<version>7.21.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.20.0</version>
|
||||
<version>7.21.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.20.0</version>
|
||||
<version>7.21.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# RELEASE_VERSION
|
||||
openApiGeneratorVersion=7.20.0
|
||||
openApiGeneratorVersion=7.21.0-SNAPSHOT
|
||||
# /RELEASE_VERSION
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.20.0</version>
|
||||
<version>7.21.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.20.0</version>
|
||||
<version>7.21.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.20.0</version>
|
||||
<version>7.21.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
@@ -433,7 +433,7 @@
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
<version>${jackson.version}</version>
|
||||
<version>${jackson-annotations.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.joschi.jackson</groupId>
|
||||
|
||||
@@ -1557,10 +1557,12 @@ public class OpenAPINormalizer {
|
||||
}
|
||||
|
||||
schema = simplifyOneOfAnyOfWithOnlyOneNonNullSubSchema(openAPI, schema, oneOfSchemas);
|
||||
|
||||
if (ModelUtils.isIntegerSchema(schema) || ModelUtils.isNumberSchema(schema) || ModelUtils.isStringSchema(schema)) {
|
||||
// TODO convert oneOf const to enum
|
||||
schema.setOneOf(null);
|
||||
if (schema.getSpecVersion().equals(SpecVersion.V30)) {
|
||||
schema.setOneOf(null);
|
||||
} //else {
|
||||
// TODO convert oneOf const/deprecated to enum
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1839,6 +1841,9 @@ public class OpenAPINormalizer {
|
||||
as.setXml(schema.getXml());
|
||||
as.setNullable(schema.getNullable());
|
||||
as.setUniqueItems(schema.getUniqueItems());
|
||||
as.setDeprecated(schema.getDeprecated());
|
||||
as.setReadOnly(schema.getReadOnly());
|
||||
as.setWriteOnly(schema.getWriteOnly());
|
||||
if (schema.getItems() != null) {
|
||||
// `items` is also a json schema
|
||||
if (StringUtils.isNotEmpty(schema.getItems().get$ref())) {
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package org.openapitools.codegen.languages;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import io.swagger.v3.oas.models.OpenAPI;
|
||||
import io.swagger.v3.oas.models.Operation;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import io.swagger.v3.oas.models.media.StringSchema;
|
||||
import io.swagger.v3.oas.models.parameters.Parameter;
|
||||
import io.swagger.v3.oas.models.parameters.RequestBody;
|
||||
import io.swagger.v3.oas.models.servers.Server;
|
||||
import lombok.Setter;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
@@ -45,6 +48,8 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
|
||||
public static final String PUB_REPOSITORY = "pubRepository";
|
||||
public static final String PUB_PUBLISH_TO = "pubPublishTo";
|
||||
public static final String USE_ENUM_EXTENSION = "useEnumExtension";
|
||||
public static final String USE_OPTIONAL = "useOptional";
|
||||
public static final String PATCH_ONLY = "patchOnly";
|
||||
|
||||
@Setter protected String pubLibrary = "openapi.api";
|
||||
@Setter protected String pubName = "openapi";
|
||||
@@ -56,8 +61,12 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
|
||||
@Setter protected String pubRepository = null;
|
||||
@Setter protected String pubPublishTo = null;
|
||||
@Setter protected boolean useEnumExtension = false;
|
||||
@Setter protected boolean useOptional = false;
|
||||
@Setter protected boolean patchOnly = false;
|
||||
@Setter protected String sourceFolder = "src";
|
||||
protected String libPath = "lib" + File.separator;
|
||||
|
||||
protected Set<String> patchRequestSchemas = new HashSet<>();
|
||||
protected String apiDocPath = "doc/";
|
||||
protected String modelDocPath = "doc/";
|
||||
protected String apiTestPath = "test" + File.separator;
|
||||
@@ -128,7 +137,8 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
|
||||
"bool",
|
||||
"int",
|
||||
"num",
|
||||
"double"
|
||||
"double",
|
||||
"Object"
|
||||
);
|
||||
|
||||
typeMapping = new HashMap<>();
|
||||
@@ -195,6 +205,8 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
|
||||
addOption(PUB_REPOSITORY, "Repository in generated pubspec", pubRepository);
|
||||
addOption(PUB_PUBLISH_TO, "Publish_to in generated pubspec", pubPublishTo);
|
||||
addOption(USE_ENUM_EXTENSION, "Allow the 'x-enum-values' extension for enums", String.valueOf(useEnumExtension));
|
||||
addOption(USE_OPTIONAL, "Use Optional<T> to distinguish absent, null, and present for optional fields (Dart 3+)", String.valueOf(useOptional));
|
||||
addOption(PATCH_ONLY, "Only apply Optional<T> to PATCH operation request bodies (requires useOptional=true)", String.valueOf(patchOnly));
|
||||
addOption(CodegenConstants.SOURCE_FOLDER, CodegenConstants.SOURCE_FOLDER_DESC, sourceFolder);
|
||||
}
|
||||
|
||||
@@ -301,6 +313,24 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
|
||||
additionalProperties.put(USE_ENUM_EXTENSION, useEnumExtension);
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(USE_OPTIONAL)) {
|
||||
this.setUseOptional(convertPropertyToBooleanAndWriteBack(USE_OPTIONAL));
|
||||
} else {
|
||||
additionalProperties.put(USE_OPTIONAL, useOptional);
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(PATCH_ONLY)) {
|
||||
this.setPatchOnly(convertPropertyToBooleanAndWriteBack(PATCH_ONLY));
|
||||
} else {
|
||||
additionalProperties.put(PATCH_ONLY, patchOnly);
|
||||
}
|
||||
|
||||
if (patchOnly && !useOptional) {
|
||||
LOGGER.warn("patchOnly=true requires useOptional=true. Setting useOptional=true.");
|
||||
this.setUseOptional(true);
|
||||
additionalProperties.put(USE_OPTIONAL, true);
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(CodegenConstants.SOURCE_FOLDER)) {
|
||||
String srcFolder = (String) additionalProperties.get(CodegenConstants.SOURCE_FOLDER);
|
||||
this.setSourceFolder(srcFolder.replace('/', File.separatorChar));
|
||||
@@ -544,6 +574,35 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
|
||||
return super.getTypeDeclaration(p);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preprocessOpenAPI(OpenAPI openAPI) {
|
||||
super.preprocessOpenAPI(openAPI);
|
||||
|
||||
if (patchOnly && openAPI.getPaths() != null) {
|
||||
openAPI.getPaths().forEach((path, pathItem) -> {
|
||||
if (pathItem.getPatch() != null) {
|
||||
Operation patchOp = pathItem.getPatch();
|
||||
if (patchOp.getRequestBody() != null) {
|
||||
RequestBody requestBody = ModelUtils.getReferencedRequestBody(openAPI, patchOp.getRequestBody());
|
||||
if (requestBody != null && requestBody.getContent() != null) {
|
||||
requestBody.getContent().forEach((mediaType, content) -> {
|
||||
if (content.getSchema() != null) {
|
||||
String ref = content.getSchema().get$ref();
|
||||
if (ref != null) {
|
||||
String schemaName = ModelUtils.getSimpleRef(ref);
|
||||
String modelName = toModelName(schemaName);
|
||||
patchRequestSchemas.add(modelName);
|
||||
LOGGER.info("Identified '{}' as PATCH request schema (will use Optional<T>)", modelName);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSchemaType(Schema p) {
|
||||
String openAPIType = super.getSchemaType(p);
|
||||
@@ -558,7 +617,49 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
|
||||
|
||||
@Override
|
||||
public ModelsMap postProcessModels(ModelsMap objs) {
|
||||
return postProcessModelsEnum(objs);
|
||||
objs = postProcessModelsEnum(objs);
|
||||
|
||||
if (useOptional) {
|
||||
for (ModelMap modelMap : objs.getModels()) {
|
||||
CodegenModel model = modelMap.getModel();
|
||||
|
||||
boolean shouldUseOptional;
|
||||
|
||||
if (patchOnly) {
|
||||
shouldUseOptional = patchRequestSchemas.contains(model.classname);
|
||||
} else {
|
||||
Boolean schemaUseOptional = (Boolean) model.vendorExtensions.get("x-use-optional");
|
||||
shouldUseOptional = schemaUseOptional == null || schemaUseOptional;
|
||||
}
|
||||
|
||||
if (shouldUseOptional) {
|
||||
for (CodegenProperty prop : model.vars) {
|
||||
if (!prop.required && !prop.dataType.startsWith("Optional<")) {
|
||||
wrapPropertyWithOptional(prop);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return objs;
|
||||
}
|
||||
|
||||
private void wrapPropertyWithOptional(CodegenProperty property) {
|
||||
property.vendorExtensions.put("x-unwrapped-datatype", property.dataType);
|
||||
property.vendorExtensions.put("x-is-optional", true);
|
||||
property.vendorExtensions.put("x-original-is-number", property.isNumber);
|
||||
property.vendorExtensions.put("x-original-is-integer", property.isInteger);
|
||||
|
||||
boolean hasNullableSuffix = property.dataType.endsWith("?");
|
||||
String baseType = hasNullableSuffix ? property.dataType.substring(0, property.dataType.length() - 1) : property.dataType;
|
||||
property.dataType = "Optional<" + baseType + "?" + ">";
|
||||
|
||||
if (property.datatypeWithEnum != null && !property.datatypeWithEnum.startsWith("Optional<")) {
|
||||
hasNullableSuffix = property.datatypeWithEnum.endsWith("?");
|
||||
baseType = hasNullableSuffix ? property.datatypeWithEnum.substring(0, property.datatypeWithEnum.length() - 1) : property.datatypeWithEnum;
|
||||
property.datatypeWithEnum = "Optional<" + baseType + "?" + ">";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -623,6 +724,19 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
|
||||
return property;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CodegenParameter fromParameter(Parameter parameter, Set<String> imports) {
|
||||
final CodegenParameter param = super.fromParameter(parameter, imports);
|
||||
|
||||
if (useOptional && param.dataType != null && param.dataType.startsWith("Optional<")) {
|
||||
param.dataType = param.dataType.substring("Optional<".length(), param.dataType.length() - 1);
|
||||
param.vendorExtensions.remove("x-is-optional");
|
||||
param.vendorExtensions.remove("x-unwrapped-datatype");
|
||||
}
|
||||
|
||||
return param;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, List<Server> servers) {
|
||||
final CodegenOperation op = super.fromOperation(path, httpMethod, operation, servers);
|
||||
@@ -659,6 +773,13 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
|
||||
if (operations != null) {
|
||||
List<CodegenOperation> ops = operations.getOperation();
|
||||
for (CodegenOperation op : ops) {
|
||||
if (useOptional) {
|
||||
unwrapOptionalFromParameters(op.pathParams);
|
||||
unwrapOptionalFromParameters(op.queryParams);
|
||||
unwrapOptionalFromParameters(op.headerParams);
|
||||
unwrapOptionalFromParameters(op.formParams);
|
||||
}
|
||||
|
||||
if (op.hasConsumes) {
|
||||
if (!op.formParams.isEmpty() || op.isMultipart) {
|
||||
// DefaultCodegen only sets this if the first consumes mediaType
|
||||
@@ -680,6 +801,16 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
|
||||
return objs;
|
||||
}
|
||||
|
||||
private void unwrapOptionalFromParameters(List<CodegenParameter> params) {
|
||||
if (params == null) return;
|
||||
for (CodegenParameter param : params) {
|
||||
if (param.dataType != null && param.dataType.startsWith("Optional<")) {
|
||||
param.dataType = param.dataType.substring("Optional<".length(), param.dataType.length() - 1);
|
||||
param.vendorExtensions.remove("x-is-optional");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<Map<String, String>> prioritizeContentTypes(List<Map<String, String>> consumes) {
|
||||
if (consumes.size() <= 1) {
|
||||
// no need to change any order
|
||||
|
||||
@@ -1769,8 +1769,16 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
innerExample = p.items.defaultValue;
|
||||
}
|
||||
example = "Arrays.asList(" + innerExample + ")";
|
||||
if (p.uniqueItems) {
|
||||
example = "new LinkedHashSet<>(" + example + ")";
|
||||
}
|
||||
} else {
|
||||
example = "Arrays.asList()";
|
||||
if (p.uniqueItems) {
|
||||
example = "new LinkedHashSet<>()";
|
||||
}
|
||||
else {
|
||||
example = "Arrays.asList()";
|
||||
}
|
||||
}
|
||||
} else if (Boolean.TRUE.equals(p.isMap)) {
|
||||
example = "new HashMap()";
|
||||
|
||||
@@ -56,6 +56,10 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
||||
|
||||
public static final String JAVAX_PACKAGE = "javaxPackage";
|
||||
public static final String USE_JAKARTA_EE = "useJakartaEe";
|
||||
public static final String USE_JACKSON_3 = "useJackson3";
|
||||
public static final String JACKSON2_PACKAGE = "com.fasterxml.jackson";
|
||||
public static final String JACKSON3_PACKAGE = "tools.jackson";
|
||||
public static final String JACKSON_PACKAGE = "jacksonPackage";
|
||||
public static final String SCHEMA_IMPLEMENTS = "schemaImplements";
|
||||
public static final String SCHEMA_IMPLEMENTS_FIELDS = "schemaImplementsFields";
|
||||
public static final String X_KOTLIN_IMPLEMENTS_SKIP = "xKotlinImplementsSkip";
|
||||
@@ -80,6 +84,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
||||
protected boolean serializableModel = false;
|
||||
|
||||
@Setter protected boolean useJakartaEe = false;
|
||||
@Getter @Setter protected boolean useJackson3 = false;
|
||||
|
||||
@Setter protected boolean nonPublicApi = false;
|
||||
|
||||
@@ -394,7 +399,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
||||
inner = new StringSchema().description("TODO default missing map inner type to string");
|
||||
p.setAdditionalProperties(inner);
|
||||
}
|
||||
return getSchemaType(target) + "<kotlin.String, " + getTypeDeclaration(inner) + ">";
|
||||
return getSchemaType(target) + "<kotlin.String, " + getItemsTypeDeclaration(inner) + ">";
|
||||
}
|
||||
return super.getTypeDeclaration(target);
|
||||
}
|
||||
@@ -569,6 +574,17 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
||||
} else {
|
||||
applyJavaxPackage();
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(USE_JACKSON_3)) {
|
||||
setUseJackson3(Boolean.parseBoolean(additionalProperties.get(USE_JACKSON_3).toString()));
|
||||
}
|
||||
additionalProperties.put(USE_JACKSON_3, useJackson3);
|
||||
|
||||
if (useJackson3) {
|
||||
applyJackson3Package();
|
||||
} else {
|
||||
applyJackson2Package();
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isModelMutable() {
|
||||
@@ -844,6 +860,14 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
||||
writePropertyBack(JAVAX_PACKAGE, "jakarta");
|
||||
}
|
||||
|
||||
protected void applyJackson2Package() {
|
||||
writePropertyBack(JACKSON_PACKAGE, JACKSON2_PACKAGE);
|
||||
}
|
||||
|
||||
protected void applyJackson3Package() {
|
||||
writePropertyBack(JACKSON_PACKAGE, JACKSON3_PACKAGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isReservedWord(String word) {
|
||||
// We want case-sensitive escaping, to avoid unnecessary backtick-escaping.
|
||||
|
||||
@@ -2064,6 +2064,10 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
|
||||
moduleImports.add("pydantic", "field_validator");
|
||||
}
|
||||
|
||||
if (cp.getPattern() != null) {
|
||||
moduleImports.add("pydantic", "field_validator");
|
||||
}
|
||||
|
||||
if (cp.getIsArray()) {
|
||||
return arrayType(cp);
|
||||
} else if (cp.getIsMap() || cp.getIsFreeFormObject()) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user