mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2026-01-23 02:47:11 +00:00
Compare commits
45 Commits
dependabot
...
v7.18.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51228436e0 | ||
|
|
ec0a63dcf3 | ||
|
|
9779468cdc | ||
|
|
fb2878cb23 | ||
|
|
a3d03bad09 | ||
|
|
6abe6ff1c4 | ||
|
|
a529769bf3 | ||
|
|
1722f5591b | ||
|
|
20136f4b9a | ||
|
|
f484aeac2c | ||
|
|
833d1d3d38 | ||
|
|
8e7fd3cfb9 | ||
|
|
149fdcb61f | ||
|
|
e1edb9e645 | ||
|
|
e4a26ce307 | ||
|
|
1d79f3671a | ||
|
|
09a5800771 | ||
|
|
a9f439f1c6 | ||
|
|
c5ebcda902 | ||
|
|
b06fdb5781 | ||
|
|
5f28987b17 | ||
|
|
0b296bf50f | ||
|
|
39da542b99 | ||
|
|
6d7e8c69a0 | ||
|
|
7ccd039a7b | ||
|
|
8f8001ea1a | ||
|
|
5c28ab4db2 | ||
|
|
104c57319f | ||
|
|
cfcacf3074 | ||
|
|
5a6fcd3bd5 | ||
|
|
3b232f6a90 | ||
|
|
8ad6fff26f | ||
|
|
7cc0a7adac | ||
|
|
74f7351718 | ||
|
|
d59a54a18a | ||
|
|
c91df9edd4 | ||
|
|
b86213bea3 | ||
|
|
ce21b9e503 | ||
|
|
38c622019e | ||
|
|
74c551cd88 | ||
|
|
8d17f662de | ||
|
|
4f9f14a7d8 | ||
|
|
da778c46b0 | ||
|
|
abea33c32a | ||
|
|
7a431db7ef |
2
.github/workflows/docker-release.yml
vendored
2
.github/workflows/docker-release.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
||||
java-version: 11
|
||||
distribution: 'zulu'
|
||||
- name: Cache Maven packages
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ~/.m2
|
||||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
||||
|
||||
2
.github/workflows/gradle-plugin-tests.yaml
vendored
2
.github/workflows/gradle-plugin-tests.yaml
vendored
@@ -21,7 +21,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
cache: gradle
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: cache-maven-repository
|
||||
with:
|
||||
|
||||
4
.github/workflows/gradle-test.yaml
vendored
4
.github/workflows/gradle-test.yaml
vendored
@@ -40,14 +40,14 @@ jobs:
|
||||
cache: gradle
|
||||
# Cache Gradle Dependencies
|
||||
- name: Setup Gradle Dependencies Cache
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ~/.gradle/caches
|
||||
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts') }}
|
||||
|
||||
# Cache Gradle Wrapper
|
||||
- name: Setup Gradle Wrapper Cache
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ~/.gradle/wrapper
|
||||
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
|
||||
|
||||
8
.github/workflows/linux.yaml
vendored
8
.github/workflows/linux.yaml
vendored
@@ -29,14 +29,14 @@ jobs:
|
||||
java-version: ${{ matrix.java }}
|
||||
cache: gradle
|
||||
|
||||
- uses: actions/cache@v4
|
||||
- uses: actions/cache@v5
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml', 'modules/**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
|
||||
- uses: actions/cache@v4
|
||||
- uses: actions/cache@v5
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
@@ -62,7 +62,7 @@ jobs:
|
||||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
|
||||
|
||||
- name: Upload Maven build artifact
|
||||
uses: actions/upload-artifact@v5
|
||||
uses: actions/upload-artifact@v6
|
||||
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@v6
|
||||
uses: actions/download-artifact@v7
|
||||
with:
|
||||
name: artifact
|
||||
- name: Run Ensures Script
|
||||
|
||||
2
.github/workflows/maven-plugin-tests.yaml
vendored
2
.github/workflows/maven-plugin-tests.yaml
vendored
@@ -20,7 +20,7 @@ jobs:
|
||||
java-version: 11
|
||||
distribution: 'temurin'
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: cache-maven-repository
|
||||
with:
|
||||
|
||||
2
.github/workflows/maven-release.yml
vendored
2
.github/workflows/maven-release.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
||||
java-version: 11
|
||||
distribution: 'zulu'
|
||||
- name: Cache Maven packages
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ~/.m2
|
||||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
||||
|
||||
12
.github/workflows/openapi-generator.yaml
vendored
12
.github/workflows/openapi-generator.yaml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
cache: gradle
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: cache-maven-repository
|
||||
with:
|
||||
@@ -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@v5
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: openapi-generator-cli.jar
|
||||
path: modules/openapi-generator-cli/target/openapi-generator-cli.jar
|
||||
@@ -62,7 +62,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
cache: gradle
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: cache-maven-repository
|
||||
with:
|
||||
@@ -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@v5
|
||||
uses: actions/upload-artifact@v6
|
||||
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@v6
|
||||
uses: actions/download-artifact@v7
|
||||
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@v6
|
||||
uses: actions/download-artifact@v7
|
||||
with:
|
||||
name: openapi-generator-cli.jar
|
||||
path: modules/openapi-generator-cli/target
|
||||
|
||||
2
.github/workflows/samples-clojure.yaml
vendored
2
.github/workflows/samples-clojure.yaml
vendored
@@ -34,7 +34,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 11
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
2
.github/workflows/samples-dart.yaml
vendored
2
.github/workflows/samples-dart.yaml
vendored
@@ -24,7 +24,7 @@ jobs:
|
||||
java-version: 11
|
||||
cache: maven
|
||||
- name: Cache test dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: pub-cache
|
||||
with:
|
||||
|
||||
2
.github/workflows/samples-dotnet-fx.yaml
vendored
2
.github/workflows/samples-dotnet-fx.yaml
vendored
@@ -11,7 +11,7 @@ on:
|
||||
- samples/client/petstore/csharp/generichost/net4.8/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build .Net projects
|
||||
name: Build .Net Framework projects
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
||||
@@ -15,7 +15,7 @@ on:
|
||||
- samples/client/petstore/csharp/unityWebRequest/standard2.0/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build .Net projects
|
||||
name: Build .Net Standard projects
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
||||
59
.github/workflows/samples-dotnet10.yaml
vendored
Normal file
59
.github/workflows/samples-dotnet10.yaml
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
name: Samples C# .Net 10 Clients
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- samples/client/petstore/csharp/generichost/latest/**
|
||||
- samples/client/petstore/csharp/generichost/net10/**
|
||||
- samples/client/petstore/csharp/httpclient/net10/**
|
||||
- samples/client/petstore/csharp/restsharp/net10/**
|
||||
- samples/client/petstore/csharp/unityWebRequest/net10/**
|
||||
pull_request:
|
||||
paths:
|
||||
- samples/client/petstore/csharp/generichost/latest/**
|
||||
- samples/client/petstore/csharp/generichost/net10/**
|
||||
- samples/client/petstore/csharp/httpclient/net10/**
|
||||
- samples/client/petstore/csharp/restsharp/net10/**
|
||||
- samples/client/petstore/csharp/unityWebRequest/net10/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build .Net 10 projects
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
- samples/client/petstore/csharp/generichost/latest/ComposedEnum
|
||||
- samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf
|
||||
- samples/client/petstore/csharp/generichost/latest/Tags
|
||||
- samples/client/petstore/csharp/generichost/latest/HelloWorld
|
||||
- samples/client/petstore/csharp/generichost/latest/OneOfList
|
||||
- samples/client/petstore/csharp/generichost/net10/AllOf
|
||||
- samples/client/petstore/csharp/generichost/net10/AnyOf
|
||||
- samples/client/petstore/csharp/generichost/net10/AnyOfNoCompare
|
||||
- samples/client/petstore/csharp/generichost/net10/FormModels
|
||||
# - samples/client/petstore/csharp/generichost/net10/ManualPetstoreTests
|
||||
# - samples/client/petstore/csharp/generichost/net10/ManualSourceGenerationTests
|
||||
- samples/client/petstore/csharp/generichost/net10/NullReferenceTypes
|
||||
- samples/client/petstore/csharp/generichost/net10/OneOf
|
||||
- samples/client/petstore/csharp/generichost/net10/Petstore
|
||||
- samples/client/petstore/csharp/generichost/net10/SourceGeneration
|
||||
- samples/client/petstore/csharp/generichost/net10/UseDateTimeForDate
|
||||
# restsharp
|
||||
- samples/client/petstore/csharp/restsharp/net10/EnumMappings
|
||||
# httpclient
|
||||
- samples/client/petstore/csharp/httpclient/net10/Petstore
|
||||
- samples/client/petstore/csharp/httpclient/net10/Petstore-nonPublicApi
|
||||
# unity
|
||||
# - samples/client/petstore/csharp/unityWebRequest/net10/Petstore
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-dotnet@v5.0.0
|
||||
with:
|
||||
dotnet-version: '10.x'
|
||||
- name: Build
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: dotnet build Org.OpenAPITools.sln
|
||||
- name: Test
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: dotnet test Org.OpenAPITools.sln
|
||||
2
.github/workflows/samples-dotnet8.yaml
vendored
2
.github/workflows/samples-dotnet8.yaml
vendored
@@ -15,7 +15,7 @@ on:
|
||||
- samples/client/petstore/csharp/unityWebRequest/net8/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build .Net projects
|
||||
name: Build .Net 8 projects
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
||||
11
.github/workflows/samples-dotnet9.yaml
vendored
11
.github/workflows/samples-dotnet9.yaml
vendored
@@ -3,31 +3,24 @@ name: Samples C# .Net 9 Clients
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- samples/client/petstore/csharp/generichost/latest/**
|
||||
- samples/client/petstore/csharp/generichost/net9/**
|
||||
- samples/client/petstore/csharp/httpclient/net9/**
|
||||
- samples/client/petstore/csharp/restsharp/net9/**
|
||||
- samples/client/petstore/csharp/unityWebRequest/net9/**
|
||||
pull_request:
|
||||
paths:
|
||||
- samples/client/petstore/csharp/generichost/latest/**
|
||||
- samples/client/petstore/csharp/generichost/net9/**
|
||||
- samples/client/petstore/csharp/httpclient/net9/**
|
||||
- samples/client/petstore/csharp/restsharp/net9/**
|
||||
- samples/client/petstore/csharp/unityWebRequest/net9/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build .Net projects
|
||||
name: Build .Net 9 projects
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
- samples/client/petstore/csharp/generichost/latest/ComposedEnum
|
||||
- samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf
|
||||
- samples/client/petstore/csharp/generichost/latest/Tags
|
||||
- samples/client/petstore/csharp/generichost/latest/HelloWorld
|
||||
- samples/client/petstore/csharp/generichost/latest/OneOfList
|
||||
- samples/client/petstore/csharp/generichost/net9/AllOf
|
||||
- samples/client/petstore/csharp/generichost/net9/AnyOf
|
||||
- samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare
|
||||
@@ -50,7 +43,7 @@ jobs:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-dotnet@v5.0.1
|
||||
with:
|
||||
dotnet-version: '9.0.101'
|
||||
dotnet-version: '9.0.x'
|
||||
- name: Build
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: dotnet build Org.OpenAPITools.sln
|
||||
|
||||
2
.github/workflows/samples-groovy.yaml
vendored
2
.github/workflows/samples-groovy.yaml
vendored
@@ -28,7 +28,7 @@ jobs:
|
||||
java-version: 8
|
||||
cache: gradle
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 11
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
@@ -29,7 +29,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
@@ -35,7 +35,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 8
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
@@ -121,7 +121,7 @@ jobs:
|
||||
java-version: 11
|
||||
cache: gradle
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
@@ -133,7 +133,7 @@ jobs:
|
||||
run: mvn clean package --no-transfer-progress
|
||||
|
||||
- name: Cache gradle dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: gradle-caches
|
||||
with:
|
||||
@@ -141,7 +141,7 @@ jobs:
|
||||
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/*.gradle', '**/*.gradle.kts') }}
|
||||
|
||||
- name: Cache gradle wrapper
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: gradle-wrapper
|
||||
with:
|
||||
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
java-version: 17
|
||||
cache: gradle
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
@@ -57,7 +57,7 @@ jobs:
|
||||
run: mvn clean package --no-transfer-progress
|
||||
|
||||
- name: Cache gradle dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: gradle-caches
|
||||
with:
|
||||
@@ -65,7 +65,7 @@ jobs:
|
||||
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/*.gradle', '**/*.gradle.kts') }}
|
||||
|
||||
- name: Cache gradle wrapper
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: gradle-wrapper
|
||||
with:
|
||||
|
||||
2
.github/workflows/samples-java-dubbo.yaml
vendored
2
.github/workflows/samples-java-dubbo.yaml
vendored
@@ -25,7 +25,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
@@ -32,7 +32,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: ${{ matrix.version }}
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: ${{ matrix.version }}
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
@@ -53,7 +53,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 11
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
@@ -35,7 +35,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 11
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
2
.github/workflows/samples-java-sbt.yaml
vendored
2
.github/workflows/samples-java-sbt.yaml
vendored
@@ -26,7 +26,7 @@ jobs:
|
||||
- name: Setup sbt launcher
|
||||
uses: sbt/setup-sbt@v1
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
@@ -37,7 +37,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 8
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
2
.github/workflows/samples-java-wiremock.yaml
vendored
2
.github/workflows/samples-java-wiremock.yaml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 11
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
2
.github/workflows/samples-jaxrs-jdk11.yaml
vendored
2
.github/workflows/samples-jaxrs-jdk11.yaml
vendored
@@ -24,7 +24,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 11
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
2
.github/workflows/samples-jaxrs.yaml
vendored
2
.github/workflows/samples-jaxrs.yaml
vendored
@@ -44,7 +44,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 11
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
2
.github/workflows/samples-jdk17.yaml
vendored
2
.github/workflows/samples-jdk17.yaml
vendored
@@ -64,7 +64,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
2
.github/workflows/samples-jdk21.yaml
vendored
2
.github/workflows/samples-jdk21.yaml
vendored
@@ -37,7 +37,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 21
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
5
.github/workflows/samples-kotlin-client.yaml
vendored
5
.github/workflows/samples-kotlin-client.yaml
vendored
@@ -29,7 +29,6 @@ jobs:
|
||||
# needs Android configured
|
||||
#- samples/client/petstore/kotlin-json-request-string
|
||||
- samples/client/petstore/kotlin-jvm-okhttp4-coroutines
|
||||
- samples/client/petstore/kotlin-jvm-volley
|
||||
- samples/client/petstore/kotlin-moshi-codegen
|
||||
- samples/client/petstore/kotlin-multiplatform
|
||||
- samples/client/petstore/kotlin-multiplatform-kotlinx-datetime
|
||||
@@ -47,10 +46,8 @@ jobs:
|
||||
- samples/client/petstore/kotlin-array-integer-enum
|
||||
- samples/client/petstore/kotlin-default-values-jvm-okhttp4
|
||||
- samples/client/petstore/kotlin-default-values-jvm-retrofit2
|
||||
- samples/client/petstore/kotlin-default-values-jvm-volley
|
||||
- samples/client/petstore/kotlin-default-values-multiplatform
|
||||
- samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4
|
||||
- samples/client/petstore/kotlin-array-simple-string-jvm-volley
|
||||
- samples/client/petstore/kotlin-array-simple-string-multiplatform
|
||||
- samples/client/petstore/kotlin-bigdecimal-default-multiplatform
|
||||
- samples/client/petstore/kotlin-bigdecimal-default-okhttp4
|
||||
@@ -81,7 +78,7 @@ jobs:
|
||||
java-version: 11
|
||||
cache: gradle
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
java-version: 17
|
||||
cache: gradle
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
@@ -61,7 +61,7 @@ jobs:
|
||||
java-version: 17
|
||||
cache: gradle
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
@@ -34,7 +34,7 @@ jobs:
|
||||
java-version: 21
|
||||
cache: gradle
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
2
.github/workflows/samples-kotlin-server.yaml
vendored
2
.github/workflows/samples-kotlin-server.yaml
vendored
@@ -65,7 +65,7 @@ jobs:
|
||||
java-version: 11
|
||||
cache: gradle
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 11
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
@@ -53,7 +53,7 @@ jobs:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
key: ${{ runner.os }}-python-${{ steps.py.outputs.python-version }}-
|
||||
path: |
|
||||
|
||||
@@ -38,7 +38,7 @@ jobs:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
key: ${{ runner.os }}-python-${{ steps.py.outputs.python-version }}-
|
||||
path: |
|
||||
|
||||
4
.github/workflows/samples-rust-server.yaml
vendored
4
.github/workflows/samples-rust-server.yaml
vendored
@@ -60,6 +60,10 @@ jobs:
|
||||
cargo build --bin ${package##*/} --features cli
|
||||
target/debug/${package##*/} --help
|
||||
fi
|
||||
# Test the validate feature if it exists
|
||||
if cargo read-manifest | grep -q '"validate"'; then
|
||||
cargo build --features validate --all-targets
|
||||
fi
|
||||
cargo fmt
|
||||
cargo test
|
||||
cargo clippy
|
||||
|
||||
2
.github/workflows/samples-scala-client.yaml
vendored
2
.github/workflows/samples-scala-client.yaml
vendored
@@ -58,7 +58,7 @@ jobs:
|
||||
- name: Setup sbt launcher
|
||||
uses: sbt/setup-sbt@v1
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
2
.github/workflows/samples-scala-jdk8.yaml
vendored
2
.github/workflows/samples-scala-jdk8.yaml
vendored
@@ -26,7 +26,7 @@ jobs:
|
||||
- name: Setup sbt launcher
|
||||
uses: sbt/setup-sbt@v1
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
2
.github/workflows/samples-scala-server.yaml
vendored
2
.github/workflows/samples-scala-server.yaml
vendored
@@ -31,7 +31,7 @@ jobs:
|
||||
- name: Setup sbt launcher
|
||||
uses: sbt/setup-sbt@v1
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
2
.github/workflows/samples-spring-jdk17.yaml
vendored
2
.github/workflows/samples-spring-jdk17.yaml
vendored
@@ -49,7 +49,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
2
.github/workflows/samples-spring.yaml
vendored
2
.github/workflows/samples-spring.yaml
vendored
@@ -68,7 +68,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 8
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
2
.github/workflows/windows.yaml
vendored
2
.github/workflows/windows.yaml
vendored
@@ -26,7 +26,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
cache: gradle
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
env:
|
||||
cache-name: cache-maven-repository
|
||||
with:
|
||||
|
||||
@@ -6,6 +6,7 @@ additionalProperties:
|
||||
shardVersion: 1.0.0
|
||||
moduleName: Petstore
|
||||
shardName: petstore
|
||||
#paramsEncoder: Crest::EnumeratedFlatParamsEncoder
|
||||
strictSpecBehavior: false
|
||||
modelNameMappings:
|
||||
PropertyNameMapping: AnotherPropertyNameMapping
|
||||
|
||||
14
bin/configs/csharp-generichost-net10-allOf.yaml
Normal file
14
bin/configs/csharp-generichost-net10-allOf.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/generichost/net10/AllOf
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/allOf.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
useCompareNetObjects: true
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
nullableReferenceTypes: true
|
||||
equatable: true
|
||||
targetFramework: net10.0
|
||||
modelPropertySorting: alphabetical
|
||||
operationParameterSorting: alphabetical
|
||||
14
bin/configs/csharp-generichost-net10-anyOf.yaml
Normal file
14
bin/configs/csharp-generichost-net10-anyOf.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/generichost/net10/AnyOf
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/anyOf.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
useCompareNetObjects: true
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
nullableReferenceTypes: true
|
||||
equatable: true
|
||||
targetFramework: net10.0
|
||||
modelPropertySorting: alphabetical
|
||||
operationParameterSorting: alphabetical
|
||||
14
bin/configs/csharp-generichost-net10-anyOfNoCompare.yaml
Normal file
14
bin/configs/csharp-generichost-net10-anyOfNoCompare.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/generichost/net10/AnyOfNoCompare
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/anyOf.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
useCompareNetObjects: false
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
nullableReferenceTypes: true
|
||||
equatable: true
|
||||
targetFramework: net10.0
|
||||
modelPropertySorting: alphabetical
|
||||
operationParameterSorting: alphabetical
|
||||
17
bin/configs/csharp-generichost-net10-formModels.yaml
Normal file
17
bin/configs/csharp-generichost-net10-formModels.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/generichost/net10/FormModels
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
useCompareNetObjects: true
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
nullableReferenceTypes: false
|
||||
equatable: true
|
||||
targetFramework: net10.0
|
||||
skipFormModel: false
|
||||
modelPropertySorting: alphabetical
|
||||
operationParameterSorting: alphabetical
|
||||
inlineSchemaOptions:
|
||||
RESOLVE_INLINE_ENUMS: true
|
||||
@@ -0,0 +1,14 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/generichost/net10/SourceGeneration
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
useCompareNetObjects: true
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
useSourceGeneration: true
|
||||
equatable: true
|
||||
targetFramework: net10.0
|
||||
modelPropertySorting: alphabetical
|
||||
operationParameterSorting: alphabetical
|
||||
14
bin/configs/csharp-generichost-net10-nrt.yaml
Normal file
14
bin/configs/csharp-generichost-net10-nrt.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/generichost/net10/NullReferenceTypes
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
useCompareNetObjects: true
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
nullableReferenceTypes: true
|
||||
equatable: true
|
||||
targetFramework: net10.0
|
||||
modelPropertySorting: alphabetical
|
||||
operationParameterSorting: alphabetical
|
||||
14
bin/configs/csharp-generichost-net10-oneOf.yaml
Normal file
14
bin/configs/csharp-generichost-net10-oneOf.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/generichost/net10/OneOf
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOf.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
useCompareNetObjects: true
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
nullableReferenceTypes: true
|
||||
equatable: true
|
||||
targetFramework: net10.0
|
||||
modelPropertySorting: alphabetical
|
||||
operationParameterSorting: alphabetical
|
||||
11
bin/configs/csharp-generichost-net10-useDateTimeForDate.yaml
Normal file
11
bin/configs/csharp-generichost-net10-useDateTimeForDate.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/generichost/net10/UseDateTimeForDate
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/dates-api.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{2E60EF87-DB0B-4D01-A36E-F5E90F7EC757}'
|
||||
useDateTimeForDate: true
|
||||
targetFramework: net10.0
|
||||
modelPropertySorting: alphabetical
|
||||
operationParameterSorting: alphabetical
|
||||
14
bin/configs/csharp-generichost-net10.yaml
Normal file
14
bin/configs/csharp-generichost-net10.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/generichost/net10/Petstore
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
useCompareNetObjects: true
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
nullableReferenceTypes: false
|
||||
equatable: true
|
||||
targetFramework: net10.0
|
||||
modelPropertySorting: alphabetical
|
||||
operationParameterSorting: alphabetical
|
||||
14
bin/configs/csharp-httpclient-net10-nonPublicApi.yaml
Normal file
14
bin/configs/csharp-httpclient-net10-nonPublicApi.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
# for .net standard httpclient
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/httpclient/net10/Petstore-nonPublicApi
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-addpet-only.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
library: httpclient
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
useCompareNetObjects: true
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
useOneOfDiscriminatorLookup: true
|
||||
targetFramework: net10.0
|
||||
equatable: true
|
||||
nonPublicApi: true
|
||||
13
bin/configs/csharp-httpclient-net10.yaml
Normal file
13
bin/configs/csharp-httpclient-net10.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
# for .net standard httpclient
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/httpclient/net10/Petstore
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
library: httpclient
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
useCompareNetObjects: true
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
useOneOfDiscriminatorLookup: true
|
||||
targetFramework: net10.0
|
||||
equatable: true
|
||||
15
bin/configs/csharp-restsharp-net10.yaml
Normal file
15
bin/configs/csharp-restsharp-net10.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
# for .net standard
|
||||
generatorName: csharp
|
||||
library: restsharp
|
||||
outputDir: samples/client/petstore/csharp/restsharp/net10/EnumMappings
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature-oneof-primitive-types.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
useCompareNetObjects: true
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
useOneOfDiscriminatorLookup: true
|
||||
targetFramework: net10.0
|
||||
equatable: true
|
||||
enumNameMappings:
|
||||
delivered: Shipped
|
||||
9
bin/configs/csharp-unityWebRequest-net10.yaml
Normal file
9
bin/configs/csharp-unityWebRequest-net10.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
# for .net Unity
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/unityWebRequest/net10/Petstore
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
library: unityWebRequest
|
||||
additionalProperties:
|
||||
targetFramework: net10.0
|
||||
equatable: true
|
||||
@@ -1,9 +0,0 @@
|
||||
generatorName: kotlin
|
||||
outputDir: samples/client/petstore/kotlin-array-simple-string-jvm-volley
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_7199_array_simple_string.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/kotlin-client
|
||||
additionalProperties:
|
||||
artifactId: kotlin-array-simple-string-jvm-volley
|
||||
library: jvm-volley
|
||||
serializationLibrary: gson
|
||||
generateRoomModels: false
|
||||
@@ -1,10 +0,0 @@
|
||||
generatorName: kotlin
|
||||
outputDir: samples/client/petstore/kotlin-default-values-jvm-volley
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_10865_default_values.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/kotlin-client
|
||||
additionalProperties:
|
||||
artifactId: kotlin-default-values-jvm-volley
|
||||
library: jvm-volley
|
||||
sortParamsByRequiredFlag: false
|
||||
serializationLibrary: gson
|
||||
generateRoomModels: true
|
||||
@@ -1,9 +0,0 @@
|
||||
generatorName: kotlin
|
||||
outputDir: samples/client/petstore/kotlin-jvm-volley
|
||||
library: jvm-volley
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/kotlin-client
|
||||
additionalProperties:
|
||||
artifactId: kotlin-petstore-jvm-volley
|
||||
generateRoomModels: "true"
|
||||
serializationLibrary: "gson"
|
||||
@@ -3,7 +3,6 @@ id: generators
|
||||
title: Generators List
|
||||
---
|
||||
|
||||
[main] INFO o.o.c.l.PythonFastAPIServerCodegen - Skipping sorting of path operations, order matters, let the developer decide via their specification file.
|
||||
The following generators are available:
|
||||
|
||||
## CLIENT generators
|
||||
|
||||
@@ -25,6 +25,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |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|
|
||||
|moduleName|module name (e.g. TwitterClient| |OpenAPIClient|
|
||||
|paramsEncoder|params_encoder setting (e.g. Crest::NestedParamsEncoder, Crest::EnumeratedFlatParamsEncoder, Crest::ZeroEnumeratedFlatParamsEncoder| |Crest::NestedParamsEncoder|
|
||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||
|shardAuthor|shard author (only one is supported).| |null|
|
||||
|shardAuthorEmail|shard author email (only one is supported).| |null|
|
||||
|
||||
@@ -46,7 +46,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|packageVersion|C# package version.| |1.0.0|
|
||||
|returnICollection|Return ICollection<T> instead of the concrete type.| |false|
|
||||
|sourceFolder|source folder for generated code| |src|
|
||||
|targetFramework|The target .NET framework version. To target multiple frameworks, use `;` as the separator, e.g. `netstandard2.1;netcoreapp3.1`|<dl><dt>**netstandard1.3**</dt><dd>.NET Standard 1.3</dd><dt>**netstandard1.4**</dt><dd>.NET Standard 1.4</dd><dt>**netstandard1.5**</dt><dd>.NET Standard 1.5</dd><dt>**netstandard1.6**</dt><dd>.NET Standard 1.6</dd><dt>**netstandard2.0**</dt><dd>.NET Standard 2.0</dd><dt>**netstandard2.1**</dt><dd>.NET Standard 2.1</dd><dt>**net47**</dt><dd>.NET Framework 4.7</dd><dt>**net48**</dt><dd>.NET Framework 4.8</dd><dt>**net8.0**</dt><dd>.NET 8.0 (End of Support 10 November 2026)</dd><dt>**net9.0**</dt><dd>.NET 9.0 (End of Support 12 May 2026)</dd></dl>|net9.0|
|
||||
|targetFramework|The target .NET framework version. To target multiple frameworks, use `;` as the separator, e.g. `netstandard2.1;netcoreapp3.1`|<dl><dt>**netstandard1.3**</dt><dd>.NET Standard 1.3</dd><dt>**netstandard1.4**</dt><dd>.NET Standard 1.4</dd><dt>**netstandard1.5**</dt><dd>.NET Standard 1.5</dd><dt>**netstandard1.6**</dt><dd>.NET Standard 1.6</dd><dt>**netstandard2.0**</dt><dd>.NET Standard 2.0</dd><dt>**netstandard2.1**</dt><dd>.NET Standard 2.1</dd><dt>**net47**</dt><dd>.NET Framework 4.7</dd><dt>**net48**</dt><dd>.NET Framework 4.8</dd><dt>**net8.0**</dt><dd>.NET 8.0 (End of Support 10 November 2026)</dd><dt>**net9.0**</dt><dd>.NET 9.0 (End of Support 10 November 2026)</dd><dt>**net10.0**</dt><dd>.NET 10.0 (End of Support 14 November 2028)</dd></dl>|net10.0|
|
||||
|useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false|
|
||||
|useDateTimeForDate|Use DateTime to model date properties even if DateOnly supported. (.net 6.0+ only)| |false|
|
||||
|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false|
|
||||
|
||||
@@ -31,7 +31,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|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|
|
||||
|library|Library template (sub-template) to use|<dl><dt>**jvm-ktor**</dt><dd>Platform: Java Virtual Machine. HTTP client: Ktor 1.6.7. JSON processing: Gson, Jackson (default).</dd><dt>**jvm-okhttp4**</dt><dd>[DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.</dd><dt>**jvm-spring-webclient**</dt><dd>Platform: Java Virtual Machine. HTTP: Spring 5 (or 6 with useSpringBoot3 enabled) WebClient. JSON processing: Jackson.</dd><dt>**jvm-spring-restclient**</dt><dd>Platform: Java Virtual Machine. HTTP: Spring 6 RestClient. JSON processing: Jackson.</dd><dt>**jvm-retrofit2**</dt><dd>Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.</dd><dt>**multiplatform**</dt><dd>Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.7. JSON processing: Kotlinx Serialization: 1.2.1.</dd><dt>**jvm-volley**</dt><dd>Platform: JVM for Android. HTTP client: Volley 1.2.1. JSON processing: gson 2.8.9</dd><dt>**jvm-vertx**</dt><dd>Platform: Java Virtual Machine. HTTP client: Vert.x Web Client. JSON processing: Moshi, Gson or Jackson.</dd></dl>|jvm-okhttp4|
|
||||
|library|Library template (sub-template) to use|<dl><dt>**jvm-ktor**</dt><dd>Platform: Java Virtual Machine. HTTP client: Ktor 1.6.7. JSON processing: Gson, Jackson (default).</dd><dt>**jvm-okhttp4**</dt><dd>[DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.</dd><dt>**jvm-spring-webclient**</dt><dd>Platform: Java Virtual Machine. HTTP: Spring 5 (or 6 with useSpringBoot3 enabled) WebClient. JSON processing: Jackson.</dd><dt>**jvm-spring-restclient**</dt><dd>Platform: Java Virtual Machine. HTTP: Spring 6 RestClient. JSON processing: Jackson.</dd><dt>**jvm-retrofit2**</dt><dd>Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.</dd><dt>**multiplatform**</dt><dd>Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.7. JSON processing: Kotlinx Serialization: 1.2.1.</dd><dt>**jvm-volley**</dt><dd>Platform: JVM for Android. HTTP client: Volley 1.2.1. JSON processing: gson 2.8.9 (Deprecated)</dd><dt>**jvm-vertx**</dt><dd>Platform: Java Virtual Machine. HTTP client: Vert.x Web Client. JSON processing: Moshi, Gson or Jackson.</dd></dl>|jvm-okhttp4|
|
||||
|mapFileBinaryToByteArray|Map File and Binary to ByteArray (default: false)| |false|
|
||||
|modelMutable|Create mutable models| |false|
|
||||
|moshiCodeGen|Whether to enable codegen with the Moshi library. Refer to the [official Moshi doc](https://github.com/square/moshi#codegen) for more info.| |false|
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.18.0-SNAPSHOT</version>
|
||||
<version>7.18.0</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.18.0-SNAPSHOT</version>
|
||||
<version>7.18.0</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# RELEASE_VERSION
|
||||
openApiGeneratorVersion=7.18.0-SNAPSHOT
|
||||
openApiGeneratorVersion=7.18.0
|
||||
# /RELEASE_VERSION
|
||||
|
||||
# BEGIN placeholders
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.18.0-SNAPSHOT</version>
|
||||
<version>7.18.0</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# RELEASE_VERSION
|
||||
openApiGeneratorVersion=7.18.0-SNAPSHOT
|
||||
openApiGeneratorVersion=7.18.0
|
||||
# /RELEASE_VERSION
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.18.0-SNAPSHOT</version>
|
||||
<version>7.18.0</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.18.0-SNAPSHOT</version>
|
||||
<version>7.18.0</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.18.0-SNAPSHOT</version>
|
||||
<version>7.18.0</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.18.0-SNAPSHOT</version>
|
||||
<version>7.18.0</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.18.0-SNAPSHOT</version>
|
||||
<version>7.18.0</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.18.0-SNAPSHOT</version>
|
||||
<version>7.18.0</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.18.0-SNAPSHOT</version>
|
||||
<version>7.18.0</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.18.0-SNAPSHOT</version>
|
||||
<version>7.18.0</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.18.0-SNAPSHOT</version>
|
||||
<version>7.18.0</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -483,4 +483,9 @@ public class CodegenConstants {
|
||||
public static final String X_MODIFIERS = "x-modifiers";
|
||||
public static final String X_MODIFIER_PREFIX = "x-modifier-";
|
||||
public static final String X_MODEL_IS_MUTABLE = "x-model-is-mutable";
|
||||
public static final String X_IMPLEMENTS = "x-implements";
|
||||
public static final String X_IS_ONE_OF_INTERFACE = "x-is-one-of-interface";
|
||||
public static final String X_DISCRIMINATOR_VALUE = "x-discriminator-value";
|
||||
public static final String X_ONE_OF_NAME = "x-one-of-name";
|
||||
public static final String X_NULLABLE = "x-nullable";
|
||||
}
|
||||
|
||||
@@ -527,7 +527,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
for (ModelMap mo : modelsAttrs.getModels()) {
|
||||
CodegenModel cm = mo.getModel();
|
||||
if (cm.oneOf.size() > 0) {
|
||||
cm.vendorExtensions.put("x-is-one-of-interface", true);
|
||||
cm.vendorExtensions.put(X_IS_ONE_OF_INTERFACE, true);
|
||||
for (String one : cm.oneOf) {
|
||||
if (!additionalDataMap.containsKey(one)) {
|
||||
additionalDataMap.put(one, new OneOfImplementorAdditionalData(one));
|
||||
@@ -2348,8 +2348,8 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
@SuppressWarnings("static-method")
|
||||
public String toOneOfName(List<String> names, Schema composedSchema) {
|
||||
Map<String, Object> exts = composedSchema.getExtensions();
|
||||
if (exts != null && exts.containsKey("x-one-of-name")) {
|
||||
return (String) exts.get("x-one-of-name");
|
||||
if (exts != null && exts.containsKey(X_ONE_OF_NAME)) {
|
||||
return (String) exts.get(X_ONE_OF_NAME);
|
||||
}
|
||||
return "oneOf<" + String.join(",", names) + ">";
|
||||
}
|
||||
@@ -3548,8 +3548,8 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
once(LOGGER).error("Failed to lookup the schema '{}' when processing oneOf/anyOf. Please check to ensure it's defined properly.", modelName);
|
||||
} else {
|
||||
Map<String, Object> vendorExtensions = cs.getExtensions();
|
||||
if (vendorExtensions != null && !vendorExtensions.isEmpty() && vendorExtensions.containsKey("x-discriminator-value")) {
|
||||
String xDiscriminatorValue = (String) vendorExtensions.get("x-discriminator-value");
|
||||
if (vendorExtensions != null && !vendorExtensions.isEmpty() && vendorExtensions.containsKey(X_DISCRIMINATOR_VALUE)) {
|
||||
String xDiscriminatorValue = (String) vendorExtensions.get(X_DISCRIMINATOR_VALUE);
|
||||
mm = new MappedModel(xDiscriminatorValue, toModelName(modelName), true);
|
||||
descendentSchemas.add(mm);
|
||||
}
|
||||
@@ -3605,7 +3605,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
Map<String, Object> vendorExtensions = cs.getExtensions();
|
||||
String mappingName =
|
||||
Optional.ofNullable(vendorExtensions)
|
||||
.map(ve -> ve.get("x-discriminator-value"))
|
||||
.map(ve -> ve.get(X_DISCRIMINATOR_VALUE))
|
||||
.map(discriminatorValue -> (String) discriminatorValue)
|
||||
.orElse(currentSchemaName);
|
||||
MappedModel mm = new MappedModel(mappingName, toModelName(currentSchemaName), !mappingName.equals(currentSchemaName));
|
||||
@@ -4098,8 +4098,8 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
if (referencedSchema.getNullable() != null) {
|
||||
property.isNullable = referencedSchema.getNullable();
|
||||
} else if (referencedSchema.getExtensions() != null &&
|
||||
referencedSchema.getExtensions().containsKey("x-nullable")) {
|
||||
property.isNullable = (Boolean) referencedSchema.getExtensions().get("x-nullable");
|
||||
referencedSchema.getExtensions().containsKey(X_NULLABLE)) {
|
||||
property.isNullable = (Boolean) referencedSchema.getExtensions().get(X_NULLABLE);
|
||||
}
|
||||
|
||||
final XML referencedSchemaXml = referencedSchema.getXml();
|
||||
@@ -4201,8 +4201,8 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
// evaluate common attributes if defined in the top level
|
||||
if (p.getNullable() != null) {
|
||||
property.isNullable = p.getNullable();
|
||||
} else if (p.getExtensions() != null && p.getExtensions().containsKey("x-nullable")) {
|
||||
property.isNullable = (Boolean) p.getExtensions().get("x-nullable");
|
||||
} else if (p.getExtensions() != null && p.getExtensions().containsKey(X_NULLABLE)) {
|
||||
property.isNullable = (Boolean) p.getExtensions().get(X_NULLABLE);
|
||||
}
|
||||
|
||||
if (p.getReadOnly() != null) {
|
||||
@@ -8047,8 +8047,8 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
// evaluate common attributes such as description if defined in the top level
|
||||
if (original.getNullable() != null) {
|
||||
codegenParameter.isNullable = original.getNullable();
|
||||
} else if (original.getExtensions() != null && original.getExtensions().containsKey("x-nullable")) {
|
||||
codegenParameter.isNullable = (Boolean) original.getExtensions().get("x-nullable");
|
||||
} else if (original.getExtensions() != null && original.getExtensions().containsKey(X_NULLABLE)) {
|
||||
codegenParameter.isNullable = (Boolean) original.getExtensions().get(X_NULLABLE);
|
||||
}
|
||||
|
||||
if (original.getExtensions() != null) {
|
||||
@@ -8464,7 +8464,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
*/
|
||||
public void addOneOfNameExtension(Schema schema, String name) {
|
||||
if (schema.getOneOf() != null && schema.getOneOf().size() > 0) {
|
||||
schema.addExtension("x-one-of-name", name);
|
||||
schema.addExtension(X_ONE_OF_NAME, name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8498,7 +8498,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
cm.name = type;
|
||||
cm.classname = type;
|
||||
cm.vendorExtensions.put("x-is-one-of-interface", true);
|
||||
cm.vendorExtensions.put(X_IS_ONE_OF_INTERFACE, true);
|
||||
cm.interfaceModels = new ArrayList<>();
|
||||
|
||||
addOneOfInterfaces.add(cm);
|
||||
|
||||
@@ -37,8 +37,7 @@ import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.openapitools.codegen.CodegenConstants.X_INTERNAL;
|
||||
import static org.openapitools.codegen.CodegenConstants.X_PARENT;
|
||||
import static org.openapitools.codegen.CodegenConstants.*;
|
||||
import static org.openapitools.codegen.utils.ModelUtils.simplifyOneOfAnyOfWithOnlyOneNonNullSubSchema;
|
||||
import static org.openapitools.codegen.utils.StringUtils.getUniqueString;
|
||||
|
||||
@@ -1570,7 +1569,7 @@ public class OpenAPINormalizer {
|
||||
}
|
||||
|
||||
protected Schema setNullable(Schema schema) {
|
||||
if (schema.getNullable() != null || (schema.getExtensions() != null && schema.getExtensions().containsKey("x-nullable"))) {
|
||||
if (schema.getNullable() != null || (schema.getExtensions() != null && schema.getExtensions().containsKey(X_NULLABLE))) {
|
||||
// already set, don't overwrite
|
||||
return schema;
|
||||
}
|
||||
|
||||
@@ -547,13 +547,15 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
||||
}
|
||||
for (CodegenParameter param : operation.allParams) {
|
||||
// import "os" if the operation uses files
|
||||
if (!addedOSImport && "*os.File".equals(param.dataType)) {
|
||||
if (!addedOSImport && ("*os.File".equals(param.dataType) ||
|
||||
(param.items != null && "*os.File".equals(param.items.dataType)))) {
|
||||
imports.add(createMapping("import", "os"));
|
||||
addedOSImport = true;
|
||||
}
|
||||
|
||||
// import "time" if the operation has a time parameter.
|
||||
if (!addedTimeImport && "time.Time".equals(param.dataType)) {
|
||||
if (!addedTimeImport && ("time.Time".equals(param.dataType) ||
|
||||
(param.items != null && "time.Time".equals(param.items.dataType)))) {
|
||||
imports.add(createMapping("import", "time"));
|
||||
addedTimeImport = true;
|
||||
}
|
||||
@@ -648,13 +650,15 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
||||
}
|
||||
for (CodegenParameter param : operation.allParams) {
|
||||
// import "os" if the operation uses files
|
||||
if (!addedOSImport && "*os.File".equals(param.dataType)) {
|
||||
if (!addedOSImport && ("*os.File".equals(param.dataType) ||
|
||||
(param.items != null && "*os.File".equals(param.items.dataType)))) {
|
||||
imports.add(createMapping("import", "os"));
|
||||
addedOSImport = true;
|
||||
}
|
||||
|
||||
// import "time" if the operation has a time parameter.
|
||||
if (!addedTimeImport && "time.Time".equals(param.dataType)) {
|
||||
if (!addedTimeImport && ("time.Time".equals(param.dataType) ||
|
||||
(param.items != null && "time.Time".equals(param.items.dataType)))) {
|
||||
imports.add(createMapping("import", "time"));
|
||||
addedTimeImport = true;
|
||||
}
|
||||
|
||||
@@ -71,6 +71,7 @@ import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
import java.util.stream.StreamSupport;
|
||||
|
||||
import static org.openapitools.codegen.CodegenConstants.X_IMPLEMENTS;
|
||||
import static org.openapitools.codegen.utils.CamelizeOption.*;
|
||||
import static org.openapitools.codegen.utils.ModelUtils.getSchemaItems;
|
||||
import static org.openapitools.codegen.utils.OnceLogger.once;
|
||||
@@ -1997,8 +1998,8 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
for (ModelMap mo : objs.getModels()) {
|
||||
CodegenModel cm = mo.getModel();
|
||||
if (this.serializableModel) {
|
||||
cm.getVendorExtensions().putIfAbsent("x-implements", new ArrayList<String>());
|
||||
((ArrayList<String>) cm.getVendorExtensions().get("x-implements")).add("Serializable");
|
||||
cm.getVendorExtensions().putIfAbsent(X_IMPLEMENTS, new ArrayList<String>());
|
||||
((ArrayList<String>) cm.getVendorExtensions().get(X_IMPLEMENTS)).add("Serializable");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -77,6 +77,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
protected static final String NET_70_OR_LATER = "net70OrLater";
|
||||
protected static final String NET_80_OR_LATER = "net80OrLater";
|
||||
protected static final String NET_90_OR_LATER = "net90OrLater";
|
||||
protected static final String NET_10_OR_LATER = "net10OrLater";
|
||||
|
||||
@SuppressWarnings("hiding")
|
||||
private final Logger LOGGER = LoggerFactory.getLogger(CSharpClientCodegen.class);
|
||||
@@ -90,7 +91,8 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
FrameworkStrategy.NETFRAMEWORK_4_7,
|
||||
FrameworkStrategy.NETFRAMEWORK_4_8,
|
||||
FrameworkStrategy.NET_8_0,
|
||||
FrameworkStrategy.NET_9_0
|
||||
FrameworkStrategy.NET_9_0,
|
||||
FrameworkStrategy.NET_10
|
||||
);
|
||||
private static FrameworkStrategy latestFramework = frameworkStrategies.get(frameworkStrategies.size() - 1);
|
||||
protected final Map<String, String> frameworks;
|
||||
@@ -1448,8 +1450,11 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
};
|
||||
static FrameworkStrategy NET_8_0 = new FrameworkStrategy("net8.0", ".NET 8.0 (End of Support 10 November 2026)", "net8.0", Boolean.FALSE) {
|
||||
};
|
||||
static FrameworkStrategy NET_9_0 = new FrameworkStrategy("net9.0", ".NET 9.0 (End of Support 12 May 2026)", "net9.0", Boolean.FALSE) {
|
||||
static FrameworkStrategy NET_9_0 = new FrameworkStrategy("net9.0", ".NET 9.0 (End of Support 10 November 2026)", "net9.0", Boolean.FALSE) {
|
||||
};
|
||||
static FrameworkStrategy NET_10 = new FrameworkStrategy("net10.0", ".NET 10.0 (End of Support 14 November 2028)", "net10.0", Boolean.FALSE) {
|
||||
};
|
||||
|
||||
protected String name;
|
||||
protected String description;
|
||||
protected String testTargetFramework;
|
||||
@@ -1580,6 +1585,19 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
properties.put(NET_70_OR_LATER, true);
|
||||
properties.put(NET_80_OR_LATER, true);
|
||||
properties.put(NET_90_OR_LATER, true);
|
||||
} else if (strategies.stream().anyMatch(p -> "net10.0".equals(p.name))) {
|
||||
properties.put(NET_STANDARD_14_OR_LATER, true);
|
||||
properties.put(NET_STANDARD_15_OR_LATER, true);
|
||||
properties.put(NET_STANDARD_16_OR_LATER, true);
|
||||
properties.put(NET_STANDARD_20_OR_LATER, true);
|
||||
properties.put(NET_STANDARD_21_OR_LATER, true);
|
||||
properties.put(NET_47_OR_LATER, true);
|
||||
properties.put(NET_48_OR_LATER, true);
|
||||
properties.put(NET_60_OR_LATER, true);
|
||||
properties.put(NET_70_OR_LATER, true);
|
||||
properties.put(NET_80_OR_LATER, true);
|
||||
properties.put(NET_90_OR_LATER, true);
|
||||
properties.put(NET_10_OR_LATER, true);
|
||||
} else {
|
||||
throw new RuntimeException("Unhandled case");
|
||||
}
|
||||
|
||||
@@ -29,6 +29,8 @@ import org.openapitools.codegen.model.ModelsMap;
|
||||
import org.openapitools.codegen.model.OperationMap;
|
||||
import org.openapitools.codegen.model.OperationsMap;
|
||||
import org.openapitools.codegen.templating.mustache.PrefixWithHashLambda;
|
||||
import org.openapitools.codegen.templating.mustache.UppercaseLambda;
|
||||
import org.openapitools.codegen.templating.mustache.TitlecaseLambda;
|
||||
import org.openapitools.codegen.utils.ModelUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -57,6 +59,7 @@ public class CrystalClientCodegen extends DefaultCodegen {
|
||||
@Setter protected String shardDescription = "This shard maps to a REST API";
|
||||
@Setter protected String shardAuthor = "";
|
||||
@Setter protected String shardAuthorEmail = "";
|
||||
@Setter protected String paramsEncoder = "Crest::NestedParamsEncoder";
|
||||
protected String apiDocPath = "docs/";
|
||||
protected String modelDocPath = "docs/";
|
||||
protected List<String> primitiveTypes = new ArrayList<String>();
|
||||
@@ -70,6 +73,7 @@ public class CrystalClientCodegen extends DefaultCodegen {
|
||||
public static final String SHARD_DESCRIPTION = "shardDescription";
|
||||
public static final String SHARD_AUTHOR = "shardAuthor";
|
||||
public static final String SHARD_AUTHOR_EMAIL = "shardAuthorEmail";
|
||||
public static final String PARAMS_ENCODER = "paramsEncoder";
|
||||
|
||||
public CrystalClientCodegen() {
|
||||
super();
|
||||
@@ -197,8 +201,7 @@ public class CrystalClientCodegen extends DefaultCodegen {
|
||||
|
||||
cliOptions.add(new CliOption(SHARD_HOMEPAGE, "shard homepage.").defaultValue("http://org.openapitools"));
|
||||
|
||||
cliOptions.add(
|
||||
new CliOption(SHARD_DESCRIPTION, "shard description.").defaultValue("This shard maps to a REST API"));
|
||||
cliOptions.add(new CliOption(SHARD_DESCRIPTION, "shard description.").defaultValue("This shard maps to a REST API"));
|
||||
|
||||
cliOptions.add(new CliOption(SHARD_AUTHOR, "shard author (only one is supported)."));
|
||||
|
||||
@@ -206,6 +209,10 @@ public class CrystalClientCodegen extends DefaultCodegen {
|
||||
|
||||
cliOptions.add(new CliOption(CodegenConstants.HIDE_GENERATION_TIMESTAMP,
|
||||
CodegenConstants.HIDE_GENERATION_TIMESTAMP_DESC).defaultValue(Boolean.TRUE.toString()));
|
||||
|
||||
cliOptions.add(new CliOption(PARAMS_ENCODER,
|
||||
"params_encoder setting (e.g. Crest::NestedParamsEncoder, Crest::EnumeratedFlatParamsEncoder, Crest::ZeroEnumeratedFlatParamsEncoder").
|
||||
defaultValue("Crest::NestedParamsEncoder"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -260,6 +267,12 @@ public class CrystalClientCodegen extends DefaultCodegen {
|
||||
setShardAuthorEmail((String) additionalProperties.get(SHARD_AUTHOR_EMAIL));
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(PARAMS_ENCODER)) {
|
||||
setParamsEncoder((String) additionalProperties.get(PARAMS_ENCODER));
|
||||
} else {
|
||||
additionalProperties.put(PARAMS_ENCODER, paramsEncoder);
|
||||
}
|
||||
|
||||
// make api and model doc path available in mustache template
|
||||
additionalProperties.put("apiDocPath", apiDocPath);
|
||||
additionalProperties.put("modelDocPath", modelDocPath);
|
||||
@@ -273,6 +286,7 @@ public class CrystalClientCodegen extends DefaultCodegen {
|
||||
supportingFiles.add(new SupportingFile("api_error.mustache", shardFolder, "api_error.cr"));
|
||||
supportingFiles.add(new SupportingFile("configuration.mustache", shardFolder, "configuration.cr"));
|
||||
supportingFiles.add(new SupportingFile("api_client.mustache", shardFolder, "api_client.cr"));
|
||||
supportingFiles.add(new SupportingFile("recursive_hash.mustache", shardFolder, "recursive_hash.cr"));
|
||||
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
|
||||
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
||||
@@ -285,6 +299,8 @@ public class CrystalClientCodegen extends DefaultCodegen {
|
||||
|
||||
// add lambda for mustache templates
|
||||
additionalProperties.put("lambdaPrefixWithHash", new PrefixWithHashLambda());
|
||||
additionalProperties.put("lambdaUppercase", new UppercaseLambda());
|
||||
additionalProperties.put("lambdaTitlecase", new TitlecaseLambda());
|
||||
|
||||
}
|
||||
|
||||
@@ -747,8 +763,13 @@ public class CrystalClientCodegen extends DefaultCodegen {
|
||||
return moduleName + "::" + codegenModel.classname + "::" + enumVars.get(0).get("name");
|
||||
} else if (codegenModel.oneOf != null && !codegenModel.oneOf.isEmpty()) {
|
||||
String subModel = (String) codegenModel.oneOf.toArray()[0];
|
||||
String oneOf = constructExampleCode(modelMaps.get(subModel), modelMaps, processedModelMap);
|
||||
return oneOf;
|
||||
if (modelMaps.get(subModel) == null) {
|
||||
LOGGER.warn("Cannot find codegen for SubModel: {} (model: {})", subModel, model);
|
||||
return "";
|
||||
} else {
|
||||
String oneOf = constructExampleCode(modelMaps.get(subModel), modelMaps, processedModelMap);
|
||||
return oneOf;
|
||||
}
|
||||
} else {
|
||||
processedModelMap.put(model, 1);
|
||||
}
|
||||
|
||||
@@ -520,7 +520,7 @@ public class GoClientCodegen extends AbstractGoCodegen {
|
||||
addedFmtImport = true;
|
||||
}
|
||||
|
||||
if (model.hasRequired) {
|
||||
if (generateUnmarshalJSON && model.hasRequired) {
|
||||
if (!model.isAdditionalPropertiesTrue &&
|
||||
(model.oneOf == null || model.oneOf.isEmpty()) &&
|
||||
(model.anyOf == null || model.anyOf.isEmpty())) {
|
||||
|
||||
@@ -47,6 +47,7 @@ import java.util.regex.Pattern;
|
||||
import static com.google.common.base.CaseFormat.LOWER_CAMEL;
|
||||
import static com.google.common.base.CaseFormat.UPPER_UNDERSCORE;
|
||||
import static java.util.Collections.sort;
|
||||
import static org.openapitools.codegen.CodegenConstants.X_IMPLEMENTS;
|
||||
import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER;
|
||||
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
||||
|
||||
@@ -1173,7 +1174,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
||||
for (ModelMap mo : models) {
|
||||
CodegenModel cm = mo.getModel();
|
||||
|
||||
cm.getVendorExtensions().putIfAbsent("x-implements", new ArrayList<String>());
|
||||
cm.getVendorExtensions().putIfAbsent(X_IMPLEMENTS, new ArrayList<String>());
|
||||
if (isLibrary(JERSEY2) || isLibrary(JERSEY3) || isLibrary(NATIVE) || isLibrary(OKHTTP_GSON)) {
|
||||
if (cm.oneOf != null && !cm.oneOf.isEmpty() && cm.oneOf.contains("ModelNull")) {
|
||||
// if oneOf contains "null" type
|
||||
@@ -1188,7 +1189,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
||||
}
|
||||
}
|
||||
if (this.parcelableModel && !cm.isEnum) {
|
||||
((ArrayList<String>) cm.getVendorExtensions().get("x-implements")).add("Parcelable");
|
||||
((ArrayList<String>) cm.getVendorExtensions().get(X_IMPLEMENTS)).add("Parcelable");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
19
modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java
Normal file → Executable file
19
modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java
Normal file → Executable file
@@ -248,7 +248,7 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
|
||||
supportedLibraries.put(JVM_SPRING_RESTCLIENT, "Platform: Java Virtual Machine. HTTP: Spring 6 RestClient. JSON processing: Jackson.");
|
||||
supportedLibraries.put(JVM_RETROFIT2, "Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.");
|
||||
supportedLibraries.put(MULTIPLATFORM, "Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.7. JSON processing: Kotlinx Serialization: 1.2.1.");
|
||||
supportedLibraries.put(JVM_VOLLEY, "Platform: JVM for Android. HTTP client: Volley 1.2.1. JSON processing: gson 2.8.9");
|
||||
supportedLibraries.put(JVM_VOLLEY, "Platform: JVM for Android. HTTP client: Volley 1.2.1. JSON processing: gson 2.8.9 (Deprecated)");
|
||||
supportedLibraries.put(JVM_VERTX, "Platform: Java Virtual Machine. HTTP client: Vert.x Web Client. JSON processing: Moshi, Gson or Jackson.");
|
||||
|
||||
CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "Library template (sub-template) to use");
|
||||
@@ -417,11 +417,14 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
|
||||
if (hasConflict) {
|
||||
LOGGER.warn("You specified RxJava versions 1 and 2 and 3 or Coroutines together, please choose one of them.");
|
||||
} else if (hasRx3) {
|
||||
this.setUseRxJava3(Boolean.parseBoolean(additionalProperties.get(USE_RX_JAVA3).toString()));
|
||||
setUseRxJava3(convertPropertyToBoolean(USE_RX_JAVA3));
|
||||
} else if (hasCoroutines) {
|
||||
this.setUseCoroutines(Boolean.parseBoolean(additionalProperties.get(USE_COROUTINES).toString()));
|
||||
setUseCoroutines(convertPropertyToBoolean(USE_COROUTINES));
|
||||
}
|
||||
|
||||
additionalProperties.put(USE_RX_JAVA3, useRxJava3);
|
||||
additionalProperties.put(USE_COROUTINES, useCoroutines);
|
||||
|
||||
if (!hasRx3 && !hasCoroutines) {
|
||||
setDoNotUseRxAndCoroutines(true);
|
||||
additionalProperties.put(DO_NOT_USE_RX_AND_COROUTINES, true);
|
||||
@@ -447,7 +450,11 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(OMIT_GRADLE_WRAPPER)) {
|
||||
setOmitGradleWrapper(Boolean.parseBoolean(additionalProperties.get(OMIT_GRADLE_WRAPPER).toString()));
|
||||
setOmitGradleWrapper(convertPropertyToBooleanAndWriteBack(OMIT_GRADLE_WRAPPER));
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(USE_SPRING_BOOT3)) {
|
||||
convertPropertyToBooleanAndWriteBack(USE_SPRING_BOOT3);
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(CodegenConstants.SERIALIZATION_LIBRARY)) {
|
||||
@@ -467,11 +474,11 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(GENERATE_ONEOF_ANYOF_WRAPPERS)) {
|
||||
setGenerateOneOfAnyOfWrappers(Boolean.parseBoolean(additionalProperties.get(GENERATE_ONEOF_ANYOF_WRAPPERS).toString()));
|
||||
setGenerateOneOfAnyOfWrappers(convertPropertyToBooleanAndWriteBack(GENERATE_ONEOF_ANYOF_WRAPPERS));
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(FAIL_ON_UNKNOWN_PROPERTIES)) {
|
||||
setFailOnUnknownProperties(Boolean.parseBoolean(additionalProperties.get(FAIL_ON_UNKNOWN_PROPERTIES).toString()));
|
||||
setFailOnUnknownProperties(convertPropertyToBooleanAndWriteBack(FAIL_ON_UNKNOWN_PROPERTIES));
|
||||
} else {
|
||||
additionalProperties.put(FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
setFailOnUnknownProperties(false);
|
||||
|
||||
@@ -90,9 +90,6 @@ public class PythonFastAPIServerCodegen extends AbstractPythonCodegen {
|
||||
public PythonFastAPIServerCodegen() {
|
||||
super();
|
||||
|
||||
// Skip sorting of operations to preserve the order found in the OpenAPI spec file. See
|
||||
// https://fastapi.tiangolo.com/tutorial/path-params/?h=path#order-matters for details on why order matters.
|
||||
LOGGER.info("Skipping sorting of path operations, order matters, let the developer decide via their specification file.");
|
||||
setSkipSortingOperations(true);
|
||||
|
||||
modifyFeatureSet(features -> features.includeSecurityFeatures(
|
||||
@@ -150,6 +147,11 @@ public class PythonFastAPIServerCodegen extends AbstractPythonCodegen {
|
||||
public void processOpts() {
|
||||
super.processOpts();
|
||||
|
||||
// Skip sorting of operations via setSkipSortingOperations(true) in the constructor to preserve the order
|
||||
// found in the OpenAPI spec file. See
|
||||
// https://fastapi.tiangolo.com/tutorial/path-params/?h=path#order-matters for details on why order matters.
|
||||
LOGGER.info("Skipping sorting of path operations, order matters, let the developer decide via their specification file.");
|
||||
|
||||
if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) {
|
||||
setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME));
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.openapitools.codegen.CodegenConstants.X_ONE_OF_NAME;
|
||||
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
||||
import static org.openapitools.codegen.utils.StringUtils.underscore;
|
||||
|
||||
@@ -86,6 +87,9 @@ public class RustServerCodegen extends AbstractRustCodegen implements CodegenCon
|
||||
private static final String problemJsonMimeType = "application/problem+json";
|
||||
private static final String problemXmlMimeType = "application/problem+xml";
|
||||
|
||||
// Track if we have models with conflicting names (Ok/Err) that conflict with serde_valid
|
||||
private boolean hasConflictingModelNames = false;
|
||||
|
||||
public RustServerCodegen() {
|
||||
super();
|
||||
|
||||
@@ -941,6 +945,11 @@ public class RustServerCodegen extends AbstractRustCodegen implements CodegenCon
|
||||
if (param.contentType != null && isMimetypeJson(param.contentType)) {
|
||||
param.vendorExtensions.put("x-consumes-json", true);
|
||||
}
|
||||
|
||||
// Add a vendor extension to flag if this can have validate() run on it.
|
||||
if (!param.isUuid && !param.isPrimitiveType && !param.isEnum && (!param.isContainer || !languageSpecificPrimitives.contains(typeMapping.get(param.baseType)))) {
|
||||
param.vendorExtensions.put("x-can-validate", true);
|
||||
}
|
||||
}
|
||||
|
||||
for (CodegenParameter param : op.formParams) {
|
||||
@@ -1406,8 +1415,8 @@ public class RustServerCodegen extends AbstractRustCodegen implements CodegenCon
|
||||
if (composedSchema != null) {
|
||||
exts = composedSchema.getExtensions();
|
||||
}
|
||||
if (exts != null && exts.containsKey("x-one-of-name")) {
|
||||
return (String) exts.get("x-one-of-name");
|
||||
if (exts != null && exts.containsKey(X_ONE_OF_NAME)) {
|
||||
return (String) exts.get(X_ONE_OF_NAME);
|
||||
}
|
||||
|
||||
List<Schema> schemas = ModelUtils.getInterfaces(composedSchema);
|
||||
@@ -1454,8 +1463,20 @@ public class RustServerCodegen extends AbstractRustCodegen implements CodegenCon
|
||||
public void postProcessModelProperty(CodegenModel model, CodegenProperty property) {
|
||||
super.postProcessModelProperty(model, property);
|
||||
|
||||
// Check for reserved field names that conflict with serde_valid macro internals
|
||||
if ("ok".equalsIgnoreCase(property.name) || "err".equalsIgnoreCase(property.name)) {
|
||||
model.vendorExtensions.put("x-skip-serde-valid", true);
|
||||
}
|
||||
|
||||
// Mark properties that reference complex types (models) for nested validation
|
||||
// Only add nested validation for types that reference generated models (contain "models::")
|
||||
if (property.dataType != null && property.dataType.contains("models::")) {
|
||||
property.vendorExtensions.put("x-needs-nested-validation", true);
|
||||
}
|
||||
|
||||
// TODO: We should avoid reverse engineering primitive type status from the data type
|
||||
if (!languageSpecificPrimitives.contains(stripNullable(property.dataType))) {
|
||||
String strippedType = stripNullable(property.dataType);
|
||||
if (!languageSpecificPrimitives.contains(strippedType)) {
|
||||
// If we use a more qualified model name, then only camelize the actual type, not the qualifier.
|
||||
if (property.dataType.contains(":")) {
|
||||
int position = property.dataType.lastIndexOf(":");
|
||||
@@ -1528,7 +1549,32 @@ public class RustServerCodegen extends AbstractRustCodegen implements CodegenCon
|
||||
|
||||
@Override
|
||||
public ModelsMap postProcessModels(ModelsMap objs) {
|
||||
return super.postProcessModelsEnum(objs);
|
||||
ModelsMap result = super.postProcessModelsEnum(objs);
|
||||
|
||||
// Check for model names that conflict with serde_valid macro internals
|
||||
// Once we find one, set a class-level flag that persists across all model batches
|
||||
if (!hasConflictingModelNames) {
|
||||
for (ModelMap modelMap : result.getModels()) {
|
||||
CodegenModel model = modelMap.getModel();
|
||||
if ("Ok".equalsIgnoreCase(model.classname) || "Err".equalsIgnoreCase(model.classname)) {
|
||||
hasConflictingModelNames = true;
|
||||
additionalProperties.put("hasConflictingModelNames", true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If there are conflicting names (detected in any batch), skip serde_valid for ALL models
|
||||
if (hasConflictingModelNames) {
|
||||
for (ModelMap modelMap : result.getModels()) {
|
||||
CodegenModel model = modelMap.getModel();
|
||||
model.vendorExtensions.put("x-skip-serde-valid", true);
|
||||
}
|
||||
// Set the flag for this batch's template context
|
||||
result.put("hasConflictingModelNames", true);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private void processParam(CodegenParameter param, CodegenOperation op) {
|
||||
@@ -1613,6 +1659,11 @@ public class RustServerCodegen extends AbstractRustCodegen implements CodegenCon
|
||||
String exampleString = (example != null) ? "Some(" + example + ")" : "None";
|
||||
param.vendorExtensions.put("x-example", exampleString);
|
||||
}
|
||||
|
||||
// Add a vendor extension to flag if this can have validate() run on it.
|
||||
if (!param.isUuid && !param.isPrimitiveType && !param.isEnum && (!param.isContainer || !languageSpecificPrimitives.contains(typeMapping.get(param.baseType)))) {
|
||||
param.vendorExtensions.put("x-can-validate", true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -48,6 +48,7 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.openapitools.codegen.CodegenConstants.X_ONE_OF_NAME;
|
||||
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
||||
import static org.openapitools.codegen.utils.StringUtils.underscore;
|
||||
|
||||
@@ -1386,8 +1387,8 @@ public class RustServerCodegenDeprecated extends AbstractRustCodegen implements
|
||||
if (composedSchema != null) {
|
||||
exts = composedSchema.getExtensions();
|
||||
}
|
||||
if (exts != null && exts.containsKey("x-one-of-name")) {
|
||||
return (String) exts.get("x-one-of-name");
|
||||
if (exts != null && exts.containsKey(X_ONE_OF_NAME)) {
|
||||
return (String) exts.get(X_ONE_OF_NAME);
|
||||
}
|
||||
|
||||
List<Schema> schemas = ModelUtils.getInterfaces(composedSchema);
|
||||
|
||||
@@ -32,6 +32,8 @@ import java.io.File;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.openapitools.codegen.CodegenConstants.X_IMPLEMENTS;
|
||||
|
||||
public class ScalaHttp4sServerCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
private final Logger LOGGER = LoggerFactory.getLogger(ScalaHttp4sServerCodegen.class);
|
||||
protected String artifactId = "http4s-server";
|
||||
@@ -374,7 +376,7 @@ public class ScalaHttp4sServerCodegen extends DefaultCodegen implements CodegenC
|
||||
}
|
||||
//
|
||||
try {
|
||||
List<String> exts = (List<String>) cModel.getVendorExtensions().get("x-implements");
|
||||
List<String> exts = (List<String>) cModel.getVendorExtensions().get(X_IMPLEMENTS);
|
||||
if (exts != null) {
|
||||
cModel.getVendorExtensions().put("x-extends", exts.subList(0, 1));
|
||||
cModel.getVendorExtensions().put("x-extendsWith", exts.subList(1, exts.size()));
|
||||
|
||||
@@ -184,6 +184,11 @@ public class TypeScriptNodeClientCodegen extends AbstractTypeScriptClientCodegen
|
||||
for (ModelMap mo : entry.getModels()) {
|
||||
CodegenModel cm = mo.getModel();
|
||||
|
||||
// Filter out primitive types from parent property
|
||||
if (cm.parent != null && isPrimitiveType(cm.parent)) {
|
||||
cm.parent = null;
|
||||
}
|
||||
|
||||
// Add additional filename information for imports
|
||||
mo.put("tsImports", toTsImports(cm, cm.imports));
|
||||
}
|
||||
@@ -289,6 +294,26 @@ public class TypeScriptNodeClientCodegen extends AbstractTypeScriptClientCodegen
|
||||
return languageSpecificPrimitives.contains(type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a type is a primitive TypeScript type (string, boolean, number).
|
||||
* This is used to filter out primitive types from the parent property.
|
||||
*
|
||||
* @param type the type to check
|
||||
* @return true if the type is a primitive type
|
||||
*/
|
||||
private boolean isPrimitiveType(String type) {
|
||||
if (type == null) {
|
||||
return false;
|
||||
}
|
||||
// Check for primitive types (case-insensitive)
|
||||
String lowerType = type.toLowerCase(Locale.ROOT);
|
||||
return "string".equals(lowerType) ||
|
||||
"boolean".equals(lowerType) ||
|
||||
"number".equals(lowerType) ||
|
||||
"any".equals(lowerType) ||
|
||||
"array".equals(lowerType);
|
||||
}
|
||||
|
||||
// Determines if the given type is a generic/templated type (ie. ArrayList<String>)
|
||||
private boolean isLanguageGenericType(String type) {
|
||||
for (String genericType : languageGenericTypes) {
|
||||
@@ -323,6 +348,15 @@ public class TypeScriptNodeClientCodegen extends AbstractTypeScriptClientCodegen
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addParentFromContainer(CodegenModel model, Schema schema) {
|
||||
super.addParentFromContainer(model, schema);
|
||||
// Filter out primitive types from parent property
|
||||
if (model.parent != null && isPrimitiveType(model.parent)) {
|
||||
model.parent = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) {
|
||||
super.addAdditionPropertiesToCodeGenModel(codegenModel, schema);
|
||||
|
||||
@@ -56,6 +56,7 @@ import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.openapitools.codegen.CodegenConstants.X_NULLABLE;
|
||||
import static org.openapitools.codegen.CodegenConstants.X_PARENT;
|
||||
import static org.openapitools.codegen.utils.OnceLogger.once;
|
||||
|
||||
@@ -1757,8 +1758,8 @@ public class ModelUtils {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (schema.getExtensions() != null && schema.getExtensions().get("x-nullable") != null) {
|
||||
return Boolean.parseBoolean(schema.getExtensions().get("x-nullable").toString());
|
||||
if (schema.getExtensions() != null && schema.getExtensions().get(X_NULLABLE) != null) {
|
||||
return Boolean.parseBoolean(schema.getExtensions().get(X_NULLABLE).toString());
|
||||
}
|
||||
// In OAS 3.1, the recommended way to define a nullable property or object is to use oneOf.
|
||||
if (isComposedSchema(schema)) {
|
||||
|
||||
@@ -9,6 +9,8 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static org.openapitools.codegen.CodegenConstants.X_IMPLEMENTS;
|
||||
|
||||
/**
|
||||
* This class holds data to add to `oneOf` members. Let's consider this example:
|
||||
* <p>
|
||||
@@ -101,11 +103,11 @@ public class OneOfImplementorAdditionalData {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public void addToImplementor(CodegenConfig cc, CodegenModel implcm, List<Map<String, String>> implImports, boolean addInterfaceImports) {
|
||||
implcm.getVendorExtensions().putIfAbsent("x-implements", new ArrayList<String>());
|
||||
implcm.getVendorExtensions().putIfAbsent(X_IMPLEMENTS, new ArrayList<String>());
|
||||
|
||||
// Add implemented interfaces
|
||||
for (String intf : additionalInterfaces) {
|
||||
List<String> impl = (List<String>) implcm.getVendorExtensions().get("x-implements");
|
||||
List<String> impl = (List<String>) implcm.getVendorExtensions().get(X_IMPLEMENTS);
|
||||
impl.add(intf);
|
||||
if (addInterfaceImports) {
|
||||
// Add imports for interfaces
|
||||
|
||||
@@ -38,7 +38,7 @@ public class URLPathUtils {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(URLPathUtils.class);
|
||||
public static final String LOCAL_HOST = "http://localhost";
|
||||
public static final Pattern VARIABLE_PATTERN = Pattern.compile("\\{([^\\}]+)\\}");
|
||||
public static final Pattern VARIABLE_PATTERN = Pattern.compile("(?<!\\$)\\{([^\\}]+)\\}");
|
||||
|
||||
// TODO: This should probably be moved into generator/workflow type rather than a static like this.
|
||||
public static URL getServerURL(OpenAPI openAPI, Map<String, String> userDefinedVariables) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user