forked from loafle/openapi-generator-original
Compare commits
117 Commits
v7.2.0
...
rust-fix-e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e5275b3315 | ||
|
|
45add92710 | ||
|
|
f31164b569 | ||
|
|
6a8ca1018f | ||
|
|
d0187ab359 | ||
|
|
dccb147055 | ||
|
|
4840b366bc | ||
|
|
90bd1f361b | ||
|
|
0357a1b1dd | ||
|
|
1e17712f25 | ||
|
|
b2f622cd98 | ||
|
|
c2ec0bafdf | ||
|
|
74a3a8870d | ||
|
|
659e21a4bf | ||
|
|
256b27912b | ||
|
|
e6161cc044 | ||
|
|
df0e13f0c6 | ||
|
|
227c8602f7 | ||
|
|
189bf7d6c5 | ||
|
|
3dcef8249b | ||
|
|
eb10b410e1 | ||
|
|
e326d6aafc | ||
|
|
27f766721a | ||
|
|
50ae17b197 | ||
|
|
5b6b082504 | ||
|
|
3767110b1b | ||
|
|
3756c3b65d | ||
|
|
d810d7c534 | ||
|
|
eab34c9b3f | ||
|
|
7e8b521069 | ||
|
|
a730fe5048 | ||
|
|
287e8fc69c | ||
|
|
26ab9e7741 | ||
|
|
092463a513 | ||
|
|
a0418c2855 | ||
|
|
13edc5d494 | ||
|
|
36e4e4f316 | ||
|
|
af71460c86 | ||
|
|
6518932ccf | ||
|
|
90a7354c42 | ||
|
|
33faa2960c | ||
|
|
9391354b85 | ||
|
|
64c763b87a | ||
|
|
51dbd32622 | ||
|
|
8e9a17fe02 | ||
|
|
406bc28a3d | ||
|
|
b01b182af6 | ||
|
|
968c6dc418 | ||
|
|
c6efe8810d | ||
|
|
75ef9e0b02 | ||
|
|
e384201416 | ||
|
|
62459f4a9a | ||
|
|
6429711a58 | ||
|
|
987a52cf0f | ||
|
|
69e72203ae | ||
|
|
76560e34c9 | ||
|
|
be19c35c45 | ||
|
|
61c40474af | ||
|
|
d0e533d573 | ||
|
|
cfe7dcc0cf | ||
|
|
e3c0a3e8b0 | ||
|
|
9b7528d8c8 | ||
|
|
455add6d80 | ||
|
|
11caad92df | ||
|
|
9b62b9bb05 | ||
|
|
e69c5269d5 | ||
|
|
7ddcb9a8cb | ||
|
|
1e0e8fe0eb | ||
|
|
dd5c7e3b9a | ||
|
|
8bab0ceb53 | ||
|
|
90f3b24edc | ||
|
|
425011a50c | ||
|
|
69a4a65bc7 | ||
|
|
df7976c1a3 | ||
|
|
c041d7e12f | ||
|
|
209344ba40 | ||
|
|
9827098057 | ||
|
|
210044eb8a | ||
|
|
f36659114b | ||
|
|
742c2c48e7 | ||
|
|
0d4c9fb2c3 | ||
|
|
22a0fc1727 | ||
|
|
4acbd69c3d | ||
|
|
cc946e3f61 | ||
|
|
ca260b2230 | ||
|
|
07a9257ee9 | ||
|
|
5c571b0e1f | ||
|
|
c782526556 | ||
|
|
a0c2517e79 | ||
|
|
22d228b075 | ||
|
|
64f2cad9e8 | ||
|
|
6317796cba | ||
|
|
ddc7d4b1b5 | ||
|
|
23bd5d413c | ||
|
|
1b72140b46 | ||
|
|
34c3f8c7aa | ||
|
|
3d91fa8bd7 | ||
|
|
063865973d | ||
|
|
dffb5c121f | ||
|
|
c56fc21517 | ||
|
|
cb84dffb2a | ||
|
|
48e9b9f408 | ||
|
|
218dccdb8b | ||
|
|
8b5b5a74c3 | ||
|
|
a5d3fb4f60 | ||
|
|
6eeecc1d18 | ||
|
|
1105759a6f | ||
|
|
e20466bffe | ||
|
|
35b47e6382 | ||
|
|
c252216700 | ||
|
|
c215bc681d | ||
|
|
2d50655d8c | ||
|
|
d0f659ec4d | ||
|
|
a4f1a17502 | ||
|
|
8c014372aa | ||
|
|
a67e07e132 | ||
|
|
5eab3cef19 |
@@ -192,20 +192,6 @@ jobs:
|
||||
- checkout
|
||||
- command_build_and_test:
|
||||
nodeNo: "3"
|
||||
node4:
|
||||
machine:
|
||||
image: ubuntu-2004:202201-02
|
||||
working_directory: ~/OpenAPITools/openapi-generator
|
||||
shell: /bin/bash --login
|
||||
environment:
|
||||
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
|
||||
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
|
||||
DOCKER_GENERATOR_IMAGE_NAME: openapitools/openapi-generator
|
||||
DOCKER_CODEGEN_CLI_IMAGE_NAME: openapitools/openapi-generator-cli
|
||||
steps:
|
||||
- checkout
|
||||
- command_build_and_test:
|
||||
nodeNo: "4"
|
||||
workflows:
|
||||
version: 2
|
||||
build:
|
||||
@@ -214,4 +200,3 @@ workflows:
|
||||
- node1
|
||||
- node2
|
||||
- node3
|
||||
- node4
|
||||
|
||||
10
.github/CODEOWNERS
vendored
10
.github/CODEOWNERS
vendored
@@ -28,6 +28,14 @@ modules/openapi-generator-cli/**/* @jimschubert
|
||||
modules/openapi-generator-gradle-plugin/**/* @jimschubert
|
||||
modules/openapi-generator-maven-plugin/**/* @jimschubert
|
||||
|
||||
# Martin Delille
|
||||
# cpp-qt-client technical committee
|
||||
modules/openapi-generator/src/main/resources/cpp-qt-client/**/* @ravinikam
|
||||
samples/client/petstore/cpp-qt/**/* @ravinikam
|
||||
modules/openapi-generator/src/main/resources/cpp-qt-client/**/* @stkrwork
|
||||
samples/client/petstore/cpp-qt/**/* @stkrwork
|
||||
modules/openapi-generator/src/main/resources/cpp-qt-client/**/* @etherealjoy
|
||||
samples/client/petstore/cpp-qt/**/* @etherealjoy
|
||||
modules/openapi-generator/src/main/resources/cpp-qt-client/**/* @martindelille
|
||||
samples/client/petstore/cpp-qt/**/* @martindelille
|
||||
modules/openapi-generator/src/main/resources/cpp-qt-client/**/* @muttleyxd
|
||||
samples/client/petstore/cpp-qt/**/* @muttleyxd
|
||||
|
||||
2
.github/workflows/gradle-plugin-tests.yaml
vendored
2
.github/workflows/gradle-plugin-tests.yaml
vendored
@@ -20,7 +20,7 @@ jobs:
|
||||
java-version: 11
|
||||
distribution: 'temurin'
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: cache-maven-repository
|
||||
with:
|
||||
|
||||
4
.github/workflows/gradle-test.yaml
vendored
4
.github/workflows/gradle-test.yaml
vendored
@@ -37,14 +37,14 @@ jobs:
|
||||
java-version: 11
|
||||
# Cache Gradle Dependencies
|
||||
- name: Setup Gradle Dependencies Cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.gradle/caches
|
||||
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts') }}
|
||||
|
||||
# Cache Gradle Wrapper
|
||||
- name: Setup Gradle Wrapper Cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.gradle/wrapper
|
||||
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
|
||||
|
||||
4
.github/workflows/linux.yaml
vendored
4
.github/workflows/linux.yaml
vendored
@@ -28,14 +28,14 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: ${{ matrix.java }}
|
||||
|
||||
- uses: actions/cache@v3
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml', 'modules/**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
|
||||
- uses: actions/cache@v3
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
|
||||
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@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: cache-maven-repository
|
||||
with:
|
||||
|
||||
4
.github/workflows/openapi-generator.yaml
vendored
4
.github/workflows/openapi-generator.yaml
vendored
@@ -22,7 +22,7 @@ jobs:
|
||||
java-version: 11
|
||||
distribution: 'temurin'
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: cache-maven-repository
|
||||
with:
|
||||
@@ -60,7 +60,7 @@ jobs:
|
||||
java-version: 11
|
||||
distribution: 'temurin'
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: cache-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@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: pub-cache
|
||||
with:
|
||||
|
||||
4
.github/workflows/samples-dotnet.yaml
vendored
4
.github/workflows/samples-dotnet.yaml
vendored
@@ -4,6 +4,7 @@ on:
|
||||
push:
|
||||
paths:
|
||||
- 'samples/client/petstore/csharp/**net6.0**/'
|
||||
- 'samples/client/petstore/csharp/**net7.0**/'
|
||||
- 'samples/client/petstore/csharp/OpenAPIClient-generichost-netcore**/'
|
||||
- 'samples/client/petstore/csharp/OpenAPIClient-generichost-manual-tests/**'
|
||||
- 'samples/server/petstore/aspnetcore-6.0/**'
|
||||
@@ -12,6 +13,7 @@ on:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'samples/client/petstore/csharp/**net6.0**/'
|
||||
- 'samples/client/petstore/csharp/**net7.0**/'
|
||||
- 'samples/client/petstore/csharp/OpenAPIClient-generichost-netcore**/'
|
||||
- 'samples/client/petstore/csharp/OpenAPIClient-generichost-manual-tests/**'
|
||||
- 'samples/server/petstore/aspnetcore-6.0/**'
|
||||
@@ -35,6 +37,8 @@ jobs:
|
||||
- samples/client/petstore/csharp/OpenAPIClient-generichost-netcore-latest-oneOf
|
||||
- samples/client/petstore/csharp/OpenAPIClient-generichost-netcore-latest-anyOf
|
||||
- samples/client/petstore/csharp/OpenAPIClient-generichost-manual-tests
|
||||
- samples/client/petstore/csharp/OpenAPIClient-generichost-net7.0-useDateTimeForDate
|
||||
- samples/client/petstore/csharp/OpenAPIClient-net7.0-useDateTimeForDate
|
||||
- samples/server/petstore/aspnetcore-6.0
|
||||
- samples/server/petstore/aspnetcore-6.0-pocoModels
|
||||
- samples/server/petstore/aspnetcore-6.0-project4Models
|
||||
|
||||
2
.github/workflows/samples-groovy.yaml
vendored
2
.github/workflows/samples-groovy.yaml
vendored
@@ -27,7 +27,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 8
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
@@ -20,6 +20,7 @@ jobs:
|
||||
- samples/client/echo_api/java/native
|
||||
- samples/client/echo_api/java/feign-gson
|
||||
- samples/client/echo_api/java/resttemplate
|
||||
- samples/client/echo_api/java/resteasy
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-java@v4
|
||||
@@ -27,7 +28,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 11
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
@@ -7,12 +7,13 @@ on:
|
||||
- samples/client/echo_api/java/feign-gson/**
|
||||
- samples/client/echo_api/java/okhttp-gson/**
|
||||
- samples/client/echo_api/java/resttemplate/**
|
||||
- samples/client/echo_api/java/resteasy/**
|
||||
pull_request:
|
||||
paths:
|
||||
- samples/client/echo_api/java/apache-httpclient/**
|
||||
- samples/client/echo_api/java/feign-gson/**
|
||||
- samples/client/echo_api/java/okhttp-gson/**
|
||||
- samples/client/echo_api/java/resttemplate/**
|
||||
- samples/client/echo_api/java/resteasy/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build Java Client JDK8
|
||||
@@ -26,6 +27,7 @@ jobs:
|
||||
- samples/client/echo_api/java/feign-gson
|
||||
- samples/client/echo_api/java/okhttp-gson
|
||||
- samples/client/echo_api/java/resttemplate
|
||||
- samples/client/echo_api/java/resteasy
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-java@v4
|
||||
@@ -33,7 +35,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 8
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
@@ -78,7 +78,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 11
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
@@ -27,7 +27,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
2
.github/workflows/samples-java-helidon.yaml
vendored
2
.github/workflows/samples-java-helidon.yaml
vendored
@@ -29,7 +29,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: ${{ matrix.version }}
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
@@ -35,7 +35,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 11
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
@@ -38,7 +38,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 8
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
35
.github/workflows/samples-java-wiremock.yaml
vendored
Normal file
35
.github/workflows/samples-java-wiremock.yaml
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
name: Samples Java Wiremock
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- samples/server/petstore/java-wiremock/**
|
||||
pull_request:
|
||||
paths:
|
||||
- samples/server/petstore/java-wiremock/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build Java Wiremock
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
- samples/server/petstore/java-wiremock
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 11
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
path: |
|
||||
~/.m2
|
||||
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
|
||||
- name: Build
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: mvn clean package
|
||||
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@v3
|
||||
uses: actions/cache@v4
|
||||
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: 8
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
2
.github/workflows/samples-jdk17.yaml
vendored
2
.github/workflows/samples-jdk17.yaml
vendored
@@ -54,7 +54,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
3
.github/workflows/samples-kotlin-client.yaml
vendored
3
.github/workflows/samples-kotlin-client.yaml
vendored
@@ -65,6 +65,7 @@ jobs:
|
||||
- samples/client/petstore/kotlin-jvm-spring-2-webclient
|
||||
- samples/client/petstore/kotlin-jvm-spring-3-webclient
|
||||
- samples/client/petstore/kotlin-jvm-spring-3-restclient
|
||||
- samples/client/echo_api/kotlin-jvm-spring-3-restclient
|
||||
- samples/client/petstore/kotlin-spring-cloud
|
||||
- samples/client/petstore/kotlin-name-parameter-mappings
|
||||
- samples/client/others/kotlin-jvm-okhttp-parameter-tests
|
||||
@@ -75,7 +76,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 8
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
@@ -4,11 +4,13 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- 'samples/server/petstore/kotlin-springboot-3*/**'
|
||||
- 'samples/server/petstore/kotlin-server/javalin/**'
|
||||
# comment out due to gradle build failure
|
||||
# - samples/server/petstore/kotlin-spring-default/**
|
||||
pull_request:
|
||||
paths:
|
||||
- 'samples/server/petstore/kotlin-springboot-3*/**'
|
||||
- 'samples/server/petstore/kotlin-server/javalin/**'
|
||||
# comment out due to gradle build failure
|
||||
# - samples/server/petstore/kotlin-spring-default/**
|
||||
|
||||
@@ -25,6 +27,8 @@ jobs:
|
||||
sample:
|
||||
# server
|
||||
- samples/server/petstore/kotlin-springboot-3
|
||||
- samples/server/petstore/kotlin-springboot-request
|
||||
- samples/server/petstore/kotlin-server/javalin
|
||||
# comment out due to gradle build failure
|
||||
# - samples/server/petstore/kotlin-spring-default/
|
||||
steps:
|
||||
@@ -34,7 +38,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
3
.github/workflows/samples-kotlin-server.yaml
vendored
3
.github/workflows/samples-kotlin-server.yaml
vendored
@@ -37,6 +37,7 @@ jobs:
|
||||
- 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
|
||||
# comment out due to gradle build failure
|
||||
#- samples/server/petstore/kotlin-spring-default
|
||||
@@ -49,7 +50,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 8
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
@@ -15,7 +15,7 @@ jobs:
|
||||
sample:
|
||||
# clients
|
||||
- samples/client/echo_api/python
|
||||
- samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true
|
||||
- samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent
|
||||
python-version:
|
||||
- "3.7"
|
||||
- "3.8"
|
||||
@@ -42,3 +42,7 @@ jobs:
|
||||
- name: Test
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: python -m pytest
|
||||
|
||||
- name: mypy
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: python -m mypy
|
||||
|
||||
@@ -39,7 +39,7 @@ jobs:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
key: ${{ runner.os }}-python-${{ steps.py.outputs.python-version }}-
|
||||
path: |
|
||||
@@ -57,3 +57,7 @@ jobs:
|
||||
- name: Test
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: poetry run pytest -v
|
||||
|
||||
- name: mypy
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: poetry run mypy
|
||||
|
||||
@@ -39,7 +39,7 @@ jobs:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
key: ${{ runner.os }}-python-${{ steps.py.outputs.python-version }}-
|
||||
path: |
|
||||
|
||||
42
.github/workflows/samples-r.yaml
vendored
Normal file
42
.github/workflows/samples-r.yaml
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
name: Samples R
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'samples/client/echo_api/r/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'samples/client/echo_api/r/**'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build R
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
- 'samples/client/echo_api/r/'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup node.js
|
||||
uses: actions/setup-node@v4
|
||||
- name: Run echo server
|
||||
run: |
|
||||
git clone https://github.com/wing328/http-echo-server -b openapi-generator-test-server
|
||||
(cd http-echo-server && npm install && npm start &)
|
||||
- uses: r-lib/actions/setup-r@v2
|
||||
with:
|
||||
r-version: 3.6.1
|
||||
- uses: r-lib/actions/setup-r-dependencies@v2
|
||||
working-directory: ${{ matrix.sample }}
|
||||
with:
|
||||
cache-version: 2
|
||||
- name: Install curl
|
||||
run: sudo apt-get install -y r-cran-curl
|
||||
- name: build and test
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: |
|
||||
# export _R_CHECK_FORCE_SUGGESTS_=false
|
||||
/bin/bash build_and_test.bash
|
||||
shell: bash
|
||||
3
.github/workflows/samples-rust.yaml
vendored
3
.github/workflows/samples-rust.yaml
vendored
@@ -6,11 +6,13 @@ on:
|
||||
- "samples/client/others/rust/**"
|
||||
- "samples/server/petstore/rust-server/**"
|
||||
- "samples/client/petstore/rust-server/**"
|
||||
- "samples/server/petstore/rust-axum/**"
|
||||
pull_request:
|
||||
paths:
|
||||
- "samples/client/others/rust/**"
|
||||
- "samples/client/petstore/rust/**"
|
||||
- "samples/server/petstore/rust-server/**"
|
||||
- "samples/server/petstore/rust-axum/**"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -24,6 +26,7 @@ jobs:
|
||||
- samples/client/others/rust/
|
||||
- samples/client/petstore/rust/
|
||||
- samples/server/petstore/rust-server/
|
||||
- samples/server/petstore/rust-axum/
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions-rs/toolchain@v1
|
||||
|
||||
3
.github/workflows/samples-scala.yaml
vendored
3
.github/workflows/samples-scala.yaml
vendored
@@ -31,6 +31,7 @@ jobs:
|
||||
- samples/server/petstore/scala-pekko-http-server
|
||||
- samples/server/petstore/scalatra
|
||||
- samples/server/petstore/scala-finch # cannot be tested with jdk11
|
||||
- samples/server/petstore/scala-http4s-server
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-java@v4
|
||||
@@ -38,7 +39,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 8
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
2
.github/workflows/samples-spring-jdk17.yaml
vendored
2
.github/workflows/samples-spring-jdk17.yaml
vendored
@@ -24,7 +24,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
2
.github/workflows/samples-spring.yaml
vendored
2
.github/workflows/samples-spring.yaml
vendored
@@ -64,7 +64,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 8
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-repository
|
||||
with:
|
||||
|
||||
2
.github/workflows/windows.yaml
vendored
2
.github/workflows/windows.yaml
vendored
@@ -25,7 +25,7 @@ jobs:
|
||||
java-version: ${{ matrix.java }}
|
||||
distribution: 'temurin'
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: cache-maven-repository
|
||||
with:
|
||||
|
||||
@@ -22,6 +22,7 @@ cache:
|
||||
- $HOME/samples/client/petstore/ruby/vendor/bundle
|
||||
- $HOME/samples/client/petstore/python/.venv/
|
||||
- $HOME/samples/server/petstore/rust-server/target
|
||||
- $HOME/samples/server/petstore/rust-axum/target
|
||||
- $HOME/perl5
|
||||
- $HOME/.cargo
|
||||
- $HOME/.pub-cache
|
||||
|
||||
@@ -13,6 +13,9 @@ if [ "$NODE_INDEX" = "1" ]; then
|
||||
echo "Running node $NODE_INDEX ..."
|
||||
java -version
|
||||
|
||||
sudo apt-get -y install cpanminus
|
||||
|
||||
(cd samples/client/petstore/perl && /bin/bash ./test.bash)
|
||||
(cd samples/client/petstore/ruby && mvn integration-test)
|
||||
(cd samples/client/petstore/ruby-faraday && mvn integration-test)
|
||||
(cd samples/client/petstore/ruby-httpx && mvn integration-test)
|
||||
@@ -89,24 +92,6 @@ elif [ "$NODE_INDEX" = "3" ]; then
|
||||
(cd samples/client/petstore/javascript-es6 && mvn integration-test)
|
||||
(cd samples/client/petstore/javascript-promise-es6 && mvn integration-test)
|
||||
|
||||
elif [ "$NODE_INDEX" = "4" ]; then
|
||||
echo "Running node $NODE_INDEX ..."
|
||||
|
||||
#wget https://www.python.org/ftp/python/3.8.9/Python-3.8.9.tgz
|
||||
#tar -xf Python-3.8.9.tgz
|
||||
#cd Python-3.8.9
|
||||
#./configure --enable-optimizations
|
||||
#sudo make altinstall
|
||||
pyenv install --list
|
||||
pyenv install 3.7.12
|
||||
#pyenv install 2.7.14 #python2 no longer supported
|
||||
pyenv global 3.7.12
|
||||
|
||||
(cd samples/openapi3/client/petstore/python && mvn integration-test)
|
||||
(cd samples/openapi3/client/petstore/python-pydantic-v1 && mvn integration-test)
|
||||
(cd samples/openapi3/client/petstore/python-aiohttp && mvn integration-test)
|
||||
(cd samples/openapi3/client/petstore/python-pydantic-v1-aiohttp && mvn integration-test)
|
||||
|
||||
else
|
||||
echo "Running node $NODE_INDEX ..."
|
||||
java -version
|
||||
|
||||
20
README.md
20
README.md
@@ -15,7 +15,7 @@
|
||||
|
||||
<div align="center">
|
||||
|
||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.2.0`):
|
||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.3.0`):
|
||||
[](https://app.travis-ci.com/github/OpenAPITools/openapi-generator/builds)
|
||||
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
|
||||
[](https://ci.appveyor.com/project/WilliamCheng/openapi-generator)
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
<div align="center">
|
||||
|
||||
:star::star::star: If you would like to contribute, please refer to [guidelines](CONTRIBUTING.md) and a list of [open tasks](https://github.com/openapitools/openapi-generator/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).:star::star::star:
|
||||
:star::star::star: If you would like to contribute, please refer to [guidelines](CONTRIBUTING.md) and a list of [open tasks](https://github.com/openapitools/openapi-generator/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22). :star::star::star:
|
||||
|
||||
:bangbang: To migrate from Swagger Codegen to OpenAPI Generator, please refer to the [migration guide](docs/migration-from-swagger-codegen.md) :bangbang:
|
||||
|
||||
@@ -64,6 +64,7 @@ If you find OpenAPI Generator useful for work, please consider asking your compa
|
||||
[<img src="https://openapi-generator.tech/img/companies/dmtech.jpeg" width="128" height="128">](https://www.dm-jobs.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||
[<img src="https://openapi-generator.tech/img/companies/adyen.png" width="128" height="128">](https://adyen.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||
[<img src="https://openapi-generator.tech/img/companies/fornex.png" width="128" height="128">](https://fornex.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||
[<img src="https://openapi-generator.tech/img/companies/alloyautomation.png" width="128" height="128">](https://runalloy.com/signup?utm_source=github&utm_medium=referral&utm_campaign=1524_openapigenerator)
|
||||
|
||||
#### Thank you GoDaddy for sponsoring the domain names, Linode for sponsoring the VPS, Checkly for sponsoring the API monitoring and Gradle for sponsoring Develocity
|
||||
|
||||
@@ -120,8 +121,8 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
|
||||
|
||||
| OpenAPI Generator Version | Release Date | Notes |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- |
|
||||
| 7.2.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.2.0-SNAPSHOT/) | 15.12.2023 | Minor release with breaking changes (with fallback) |
|
||||
| [7.1.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.1.0) (latest stable release) | 13.11.2023 | Minor release with breaking changes (with fallback) |
|
||||
| 7.3.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.3.0-SNAPSHOT/) | 30.01.2024 | Minor release with breaking changes (with fallback) |
|
||||
| [7.2.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.2.0) (latest stable release) | 22.12.2023 | 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) |
|
||||
@@ -184,16 +185,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.1.0/openapi-generator-cli-7.1.0.jar`
|
||||
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.2.0/openapi-generator-cli-7.2.0.jar`
|
||||
|
||||
For **Mac/Linux** users:
|
||||
```sh
|
||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.1.0/openapi-generator-cli-7.1.0.jar -O openapi-generator-cli.jar
|
||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.2.0/openapi-generator-cli-7.2.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.1.0/openapi-generator-cli-7.1.0.jar
|
||||
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.2.0/openapi-generator-cli-7.2.0.jar
|
||||
```
|
||||
|
||||
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
|
||||
@@ -477,7 +478,7 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat
|
||||
-i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml \
|
||||
-g java \
|
||||
-t modules/openapi-generator/src/main/resources/Java \
|
||||
--additional-properties artifactId=petstore-okhttp-gson,hideGenerationTimestamp:true \
|
||||
--additional-properties artifactId=petstore-okhttp-gson,hideGenerationTimestamp=true \
|
||||
-o samples/client/petstore/java/okhttp-gson
|
||||
```
|
||||
|
||||
@@ -617,6 +618,8 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
||||
- [California State University, Northridge](https://www.csun.edu)
|
||||
- [CAM](https://www.cam-inc.co.jp/)
|
||||
- [Camptocamp](https://www.camptocamp.com/en)
|
||||
- [Carlsberg Group](https://www.carlsberggroup.com/)
|
||||
- [Christopher Queen Consulting](https://www.christopherqueenconsulting.com/)
|
||||
- [Cisco](https://www.cisco.com/)
|
||||
- [codecentric AG](https://www.codecentric.de/)
|
||||
- [CoinAPI](https://www.coinapi.io/)
|
||||
@@ -918,6 +921,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
||||
- 2023-05-18 - [如何基于 Swagger 使用 OpenAPI Generator 生成 JMeter 脚本?](https://blog.51cto.com/u_15181572/6294974) by [高楼(Zee)](https://blog.51cto.com/u_15181572)
|
||||
- 2023-06-28 - [Generate API contract using OpenAPI Generator Maven plugin](https://huongdanjava.com/generate-api-contract-using-openapi-generator-maven-plugin.html) by [Khanh Nguyen](https://huongdanjava.com/)
|
||||
- 2023-06-30 - [Generate Client SDKs with OpenApi Generator in Springboot](https://medium.com/@ramavathvinayak/generate-client-sdks-with-openapi-generator-in-springboot-f9f012e73c0b) by [Vinayak Ramavath](https://medium.com/@ramavathvinayak)
|
||||
- 2023-12-10 - [UnityでOpenAPI Generatorを使う](https://www.youtube.com/watch?v=CbNwKVV5LRM) by [Soup Tori](https://www.youtube.com/@souptori8417)
|
||||
|
||||
## [6 - About Us](#table-of-contents)
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/OpenAPIClient-generichost-net7.0-useDateTimeForDate
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/dates-api.yaml
|
||||
library: generichost
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{2E60EF87-DB0B-4D01-A36E-F5E90F7EC757}'
|
||||
useDateTimeForDate: true
|
||||
@@ -0,0 +1,9 @@
|
||||
# for .net standard
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/OpenAPIClient-net7.0-useDateTimeForDate
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/dates-api.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{D0A67E81-4061-48EB-B4B8-C73BDF8B2D95}'
|
||||
targetFramework: net7.0
|
||||
useDateTimeForDate: true
|
||||
@@ -1,6 +1,6 @@
|
||||
generatorName: java
|
||||
outputDir: samples/client/petstore/java/resteasy-echo
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-echo.yaml
|
||||
outputDir: samples/client/echo_api/java/resteasy
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/echo_api.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/Java
|
||||
additionalProperties:
|
||||
artifactId: petstore-resteasy-echo
|
||||
7
bin/configs/java-wiremock.yaml
Normal file
7
bin/configs/java-wiremock.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
generatorName: java-wiremock
|
||||
outputDir: samples/server/petstore/java-wiremock
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/java-wiremock
|
||||
additionalProperties:
|
||||
artifactId: petstore-wiremock
|
||||
hideGenerationTimestamp: "true"
|
||||
@@ -6,3 +6,4 @@ additionalProperties:
|
||||
serializationLibrary: jackson
|
||||
artifactId: kotlin-petstore-jackson
|
||||
enumPropertyNaming: UPPERCASE
|
||||
enumUnknownDefaultCase: "true"
|
||||
|
||||
9
bin/configs/kotlin-jvm-spring-3-restclient-echo-api.yaml
Normal file
9
bin/configs/kotlin-jvm-spring-3-restclient-echo-api.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
generatorName: kotlin
|
||||
outputDir: samples/client/echo_api/kotlin-jvm-spring-3-restclient
|
||||
library: jvm-spring-restclient
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/echo_api.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/kotlin-client
|
||||
additionalProperties:
|
||||
enumUnknownDefaultCase: true
|
||||
serializationLibrary: jackson
|
||||
useSpringBoot3: true
|
||||
7
bin/configs/kotlin-server-javalin.yaml
Normal file
7
bin/configs/kotlin-server-javalin.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
generatorName: kotlin-server
|
||||
outputDir: samples/server/petstore/kotlin-server/javalin
|
||||
library: javalin5
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/kotlin-server
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
9
bin/configs/kotlin-spring-boot-request.yaml
Normal file
9
bin/configs/kotlin-spring-boot-request.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
generatorName: kotlin-spring
|
||||
outputDir: samples/server/petstore/kotlin-springboot-request
|
||||
library: spring-boot
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/kotlin-spring
|
||||
additionalProperties:
|
||||
appendRequestToHandler: true
|
||||
interfaceOnly: true
|
||||
useSpringBoot3: true
|
||||
10
bin/configs/manual/rust-axum-multipart-v3.yaml
Normal file
10
bin/configs/manual/rust-axum-multipart-v3.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
generatorName: rust-axum
|
||||
outputDir: samples/server/petstore/rust-axum/output/multipart-v3
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/rust-server/multipart-v3.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/rust-axum
|
||||
generateAliasAsModel: true
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
allowBlockingResponseSerialize: "true"
|
||||
packageName: multipart-v3
|
||||
enablePostProcessFile: true
|
||||
10
bin/configs/manual/rust-axum-openapi-v3.yaml
Normal file
10
bin/configs/manual/rust-axum-openapi-v3.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
generatorName: rust-axum
|
||||
outputDir: samples/server/petstore/rust-axum/output/openapi-v3
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/rust-server/openapi-v3.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/rust-axum
|
||||
generateAliasAsModel: true
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
allowBlockingValidator: "true"
|
||||
packageName: openapi-v3
|
||||
enablePostProcessFile: true
|
||||
9
bin/configs/manual/rust-axum-ops-v3.yaml
Normal file
9
bin/configs/manual/rust-axum-ops-v3.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
generatorName: rust-axum
|
||||
outputDir: samples/server/petstore/rust-axum/output/ops-v3
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/rust-server/ops-v3.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/rust-axum
|
||||
generateAliasAsModel: true
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
packageName: ops-v3
|
||||
enablePostProcessFile: true
|
||||
@@ -0,0 +1,10 @@
|
||||
generatorName: rust-axum
|
||||
outputDir: samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/rust-server/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/rust-axum
|
||||
generateAliasAsModel: true
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
packageName: petstore-with-fake-endpoints-models-for-testing
|
||||
publishRustRegistry: crates-io
|
||||
enablePostProcessFile: true
|
||||
9
bin/configs/manual/rust-axum-petstore.yaml
Normal file
9
bin/configs/manual/rust-axum-petstore.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
generatorName: rust-axum
|
||||
outputDir: samples/server/petstore/rust-axum/output/petstore
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/rust-axum
|
||||
generateAliasAsModel: true
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
packageName: petstore
|
||||
enablePostProcessFile: true
|
||||
9
bin/configs/manual/rust-axum-ping-bearer-auth-v3.yaml
Normal file
9
bin/configs/manual/rust-axum-ping-bearer-auth-v3.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
generatorName: rust-axum
|
||||
outputDir: samples/server/petstore/rust-axum/output/ping-bearer-auth
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/rust-server/ping-bearer-auth.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/rust-axum
|
||||
generateAliasAsModel: true
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
packageName: ping-bearer-auth
|
||||
enablePostProcessFile: true
|
||||
9
bin/configs/manual/rust-axum-test.yaml
Normal file
9
bin/configs/manual/rust-axum-test.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
generatorName: rust-axum
|
||||
outputDir: samples/server/petstore/rust-axum/output/rust-axum-test
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/rust-server/rust-server-test.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/rust-axum
|
||||
generateAliasAsModel: true
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
packageName: rust-server-test
|
||||
enablePostProcessFile: true
|
||||
@@ -1,6 +1,6 @@
|
||||
generatorName: perl
|
||||
outputDir: samples/client/petstore/perl
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/perl/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/perl
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
|
||||
@@ -6,3 +6,9 @@ library: asyncio
|
||||
additionalProperties:
|
||||
packageName: petstore_api
|
||||
mapNumberTo: float
|
||||
nameMappings:
|
||||
_type: underscore_type
|
||||
type_: type_with_underscore
|
||||
modelNameMappings:
|
||||
# The OpenAPI spec ApiResponse conflicts with the internal ApiResponse
|
||||
ApiResponse: ModelApiResponse
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
generatorName: python
|
||||
outputDir: samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true
|
||||
outputDir: samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/echo_api.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/python
|
||||
additionalProperties:
|
||||
|
||||
@@ -10,3 +10,6 @@ additionalProperties:
|
||||
nameMappings:
|
||||
_type: underscore_type
|
||||
type_: type_with_underscore
|
||||
modelNameMappings:
|
||||
# The OpenAPI spec ApiResponse conflicts with the internal ApiResponse
|
||||
ApiResponse: ModelApiResponse
|
||||
|
||||
6
bin/configs/r-echo-api.yaml
Normal file
6
bin/configs/r-echo-api.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
generatorName: r
|
||||
outputDir: samples/client/echo_api/r
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/echo_api.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/r
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
@@ -15,3 +15,5 @@ nameMappings:
|
||||
parameterNameMappings:
|
||||
_type: underscore_type
|
||||
type_: type_with_underscore
|
||||
enumNameMappings:
|
||||
delivered: SHIPPED
|
||||
|
||||
6
bin/configs/scala-http4s-server.yaml
Normal file
6
bin/configs/scala-http4s-server.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
generatorName: scala-http4s-server
|
||||
outputDir: samples/server/petstore/scala-http4s-server
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/scala-http4s-server
|
||||
additionalProperties:
|
||||
artifactId: openapi-scala-http4s-server
|
||||
@@ -9,4 +9,5 @@ additionalProperties:
|
||||
snapshotVersion: "true"
|
||||
useSpringBoot3: true
|
||||
useBeanValidation: true
|
||||
withXml: true
|
||||
hideGenerationTimestamp: "true"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
- filename: "samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ClientTest.java"
|
||||
sha256: db505f7801fef62c13a08a8e9ca1fc4c5c947ab46b46f12943139d353feacf17
|
||||
- filename: "samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java"
|
||||
sha256: 6db714e9744c150c8982c3cb18e4f37a9c1ecd8f72f6d58943986e781ab4a344
|
||||
sha256: 7b9514ac0b3730685590d6ef273b2c2a1fb72d968529c2423a139ee9b0b92a65
|
||||
- filename: "samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/PetApiTest.java"
|
||||
sha256: 0d64cdc11809a7b5b952ccdad2bd91bd0045b3894d6fabf3e368fa0be12b8217
|
||||
- filename: "samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/PetTest.java"
|
||||
|
||||
@@ -107,6 +107,7 @@ The following generators are available:
|
||||
* [java-undertow-server](generators/java-undertow-server.md)
|
||||
* [java-vertx (deprecated)](generators/java-vertx.md)
|
||||
* [java-vertx-web (beta)](generators/java-vertx-web.md)
|
||||
* [java-wiremock (beta)](generators/java-wiremock.md)
|
||||
* [jaxrs-cxf](generators/jaxrs-cxf.md)
|
||||
* [jaxrs-cxf-cdi](generators/jaxrs-cxf-cdi.md)
|
||||
* [jaxrs-cxf-extended](generators/jaxrs-cxf-extended.md)
|
||||
@@ -130,9 +131,11 @@ The following generators are available:
|
||||
* [python-flask](generators/python-flask.md)
|
||||
* [ruby-on-rails](generators/ruby-on-rails.md)
|
||||
* [ruby-sinatra](generators/ruby-sinatra.md)
|
||||
* [rust-axum (beta)](generators/rust-axum.md)
|
||||
* [rust-server](generators/rust-server.md)
|
||||
* [scala-akka-http-server (beta)](generators/scala-akka-http-server.md)
|
||||
* [scala-finch](generators/scala-finch.md)
|
||||
* [scala-http4s-server](generators/scala-http4s-server.md)
|
||||
* [scala-lagom-server](generators/scala-lagom-server.md)
|
||||
* [scala-play-server](generators/scala-play-server.md)
|
||||
* [scalatra](generators/scalatra.md)
|
||||
|
||||
@@ -12,7 +12,7 @@ The following generators are available:
|
||||
* [cpp-restsdk](cpp-restsdk.md)
|
||||
* [cpp-tizen](cpp-tizen.md)
|
||||
* [csharp](csharp.md)
|
||||
* [csharp-netcore](csharp-netcore.md)
|
||||
* [csharp-functions](csharp-functions.md)
|
||||
* [dart](dart.md)
|
||||
* [dart-dio](dart-dio.md)
|
||||
* [eiffel](eiffel.md)
|
||||
|
||||
@@ -47,6 +47,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|sourceFolder|source folder for generated code| |src|
|
||||
|swashbuckleVersion|Swashbuckle version: 3.0.0 (deprecated), 4.0.0 (deprecated), 5.0.0 (deprecated), 6.4.0|<dl><dt>**3.0.0**</dt><dd>Swashbuckle 3.0.0</dd><dt>**4.0.0**</dt><dd>Swashbuckle 4.0.0</dd><dt>**5.0.0**</dt><dd>Swashbuckle 5.0.0</dd><dt>**6.4.0**</dt><dd>Swashbuckle 6.4.0</dd></dl>|3.0.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|
|
||||
|useDefaultRouting|Use default routing for the ASP.NET Core version.| |true|
|
||||
|useFrameworkReference|Use frameworkReference for ASP.NET Core 3.0+ and PackageReference ASP.NET Core 2.2 or earlier.| |false|
|
||||
@@ -74,6 +75,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<ul class="column-ul">
|
||||
<li>Boolean</li>
|
||||
<li>Collection</li>
|
||||
<li>DateOnly</li>
|
||||
<li>DateOnly?</li>
|
||||
<li>DateTime</li>
|
||||
<li>DateTime?</li>
|
||||
<li>DateTimeOffset</li>
|
||||
|
||||
@@ -44,6 +44,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|
|
||||
|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|
|
||||
|useNewtonsoft|Uses the Newtonsoft JSON library.| |true|
|
||||
|
||||
@@ -67,6 +68,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<ul class="column-ul">
|
||||
<li>Boolean</li>
|
||||
<li>Collection</li>
|
||||
<li>DateOnly</li>
|
||||
<li>DateOnly?</li>
|
||||
<li>DateTime</li>
|
||||
<li>DateTime?</li>
|
||||
<li>DateTimeOffset</li>
|
||||
|
||||
@@ -47,6 +47,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|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>**net6.0**</dt><dd>.NET 6.0 (End of Support 12 November 2024)</dd><dt>**net7.0**</dt><dd>.NET 7.0</dd><dt>**net8.0**</dt><dd>.NET 8.0</dd></dl>|net8.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|
|
||||
|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.| |false|
|
||||
|useSourceGeneration|Use source generation where available (only `generichost` library supports this option).| |false|
|
||||
@@ -73,6 +74,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<ul class="column-ul">
|
||||
<li>Boolean</li>
|
||||
<li>Collection</li>
|
||||
<li>DateOnly</li>
|
||||
<li>DateOnly?</li>
|
||||
<li>DateTime</li>
|
||||
<li>DateTime?</li>
|
||||
<li>DateTimeOffset</li>
|
||||
|
||||
329
docs/generators/java-wiremock.md
Normal file
329
docs/generators/java-wiremock.md
Normal file
@@ -0,0 +1,329 @@
|
||||
---
|
||||
title: Documentation for the java-wiremock Generator
|
||||
---
|
||||
|
||||
## METADATA
|
||||
|
||||
| Property | Value | Notes |
|
||||
| -------- | ----- | ----- |
|
||||
| generator name | java-wiremock | pass this to the generate command after -g |
|
||||
| generator stability | BETA | |
|
||||
| generator type | SERVER | |
|
||||
| generator language | Java | |
|
||||
| generator default templating engine | mustache | |
|
||||
| helpTxt | Generates Java Wiremock stubs, requests and responses samples. | |
|
||||
|
||||
## 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.
|
||||
|
||||
| Option | Description | Values | Default |
|
||||
| ------ | ----------- | ------ | ------- |
|
||||
|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|
|
||||
|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|
|
||||
|apiPackage|package for generated api classes| |null|
|
||||
|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
|
||||
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-java|
|
||||
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|
||||
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|
||||
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
|
||||
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
|
||||
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|
|
||||
|containerDefaultToNull|Set containers (array, set, map) default to null| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|java8|
|
||||
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|
||||
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|
||||
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|
||||
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|
||||
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |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|
|
||||
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |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|
|
||||
|groupId|groupId in generated pom.xml| |org.openapitools|
|
||||
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|
||||
|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|
|
||||
|invokerPackage|root package for generated code| |org.openapitools|
|
||||
|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|
|
||||
|licenseName|The name of the license| |Unlicense|
|
||||
|licenseUrl|The URL of the license| |http://unlicense.org|
|
||||
|modelPackage|package for generated models| |null|
|
||||
|openApiNullable|Enable OpenAPI Jackson Nullable library| |true|
|
||||
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
|
||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||
|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|
||||
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|
||||
|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|
||||
|serializableModel|boolean - toggle "implements Serializable" for generated models| |false|
|
||||
|snapshotVersion|Uses a SNAPSHOT version.|<dl><dt>**true**</dt><dd>Use a SnapShot Version</dd><dt>**false**</dt><dd>Use a Release Version</dd></dl>|null|
|
||||
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|
||||
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
||||
|sourceFolder|source folder for generated code| |src/main/java|
|
||||
|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi|
|
||||
|useJakartaEe|whether to use Jakarta EE namespace instead of javax| |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|
|
||||
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
||||
|
||||
## SUPPORTED VENDOR EXTENSIONS
|
||||
|
||||
| Extension name | Description | Applicable for | Default value |
|
||||
| -------------- | ----------- | -------------- | ------------- |
|
||||
|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL|
|
||||
|x-implements|Ability to specify interfaces that model must implements|MODEL|empty array
|
||||
|x-setter-extra-annotation|Custom annotation that can be specified over java setter for specific field|FIELD|When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value
|
||||
|x-tags|Specify multiple swagger tags for operation|OPERATION|null
|
||||
|x-accepts|Specify custom value for 'Accept' header for operation|OPERATION|null
|
||||
|x-content-type|Specify custom value for 'Content-Type' header for operation|OPERATION|null
|
||||
|x-class-extra-annotation|List of custom annotations to be added to model|MODEL|null
|
||||
|x-field-extra-annotation|List of custom annotations to be added to property|FIELD|null
|
||||
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
| ---------- | ------- |
|
||||
|Array|java.util.List|
|
||||
|ArrayList|java.util.ArrayList|
|
||||
|BigDecimal|java.math.BigDecimal|
|
||||
|Date|java.util.Date|
|
||||
|DateTime|org.joda.time.*|
|
||||
|File|java.io.File|
|
||||
|HashMap|java.util.HashMap|
|
||||
|LinkedHashSet|java.util.LinkedHashSet|
|
||||
|List|java.util.*|
|
||||
|LocalDate|org.joda.time.*|
|
||||
|LocalDateTime|org.joda.time.*|
|
||||
|LocalTime|org.joda.time.*|
|
||||
|Map|java.util.Map|
|
||||
|Set|java.util.*|
|
||||
|Timestamp|java.sql.Timestamp|
|
||||
|URI|java.net.URI|
|
||||
|UUID|java.util.UUID|
|
||||
|
||||
|
||||
## INSTANTIATION TYPES
|
||||
|
||||
| Type/Alias | Instantiated By |
|
||||
| ---------- | --------------- |
|
||||
|array|ArrayList|
|
||||
|map|HashMap|
|
||||
|set|LinkedHashSet|
|
||||
|
||||
|
||||
## LANGUAGE PRIMITIVES
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>Boolean</li>
|
||||
<li>Double</li>
|
||||
<li>Float</li>
|
||||
<li>Integer</li>
|
||||
<li>Long</li>
|
||||
<li>Object</li>
|
||||
<li>String</li>
|
||||
<li>boolean</li>
|
||||
<li>byte[]</li>
|
||||
</ul>
|
||||
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>abstract</li>
|
||||
<li>apiclient</li>
|
||||
<li>apiexception</li>
|
||||
<li>apiresponse</li>
|
||||
<li>assert</li>
|
||||
<li>boolean</li>
|
||||
<li>break</li>
|
||||
<li>byte</li>
|
||||
<li>case</li>
|
||||
<li>catch</li>
|
||||
<li>char</li>
|
||||
<li>class</li>
|
||||
<li>configuration</li>
|
||||
<li>const</li>
|
||||
<li>continue</li>
|
||||
<li>default</li>
|
||||
<li>do</li>
|
||||
<li>double</li>
|
||||
<li>else</li>
|
||||
<li>enum</li>
|
||||
<li>extends</li>
|
||||
<li>file</li>
|
||||
<li>final</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
<li>for</li>
|
||||
<li>goto</li>
|
||||
<li>if</li>
|
||||
<li>implements</li>
|
||||
<li>import</li>
|
||||
<li>instanceof</li>
|
||||
<li>int</li>
|
||||
<li>interface</li>
|
||||
<li>list</li>
|
||||
<li>localdate</li>
|
||||
<li>localreturntype</li>
|
||||
<li>localtime</li>
|
||||
<li>localvaraccept</li>
|
||||
<li>localvaraccepts</li>
|
||||
<li>localvarauthnames</li>
|
||||
<li>localvarcollectionqueryparams</li>
|
||||
<li>localvarcontenttype</li>
|
||||
<li>localvarcontenttypes</li>
|
||||
<li>localvarcookieparams</li>
|
||||
<li>localvarformparams</li>
|
||||
<li>localvarheaderparams</li>
|
||||
<li>localvarpath</li>
|
||||
<li>localvarpostbody</li>
|
||||
<li>localvarqueryparams</li>
|
||||
<li>long</li>
|
||||
<li>native</li>
|
||||
<li>new</li>
|
||||
<li>null</li>
|
||||
<li>object</li>
|
||||
<li>offsetdatetime</li>
|
||||
<li>package</li>
|
||||
<li>private</li>
|
||||
<li>protected</li>
|
||||
<li>public</li>
|
||||
<li>return</li>
|
||||
<li>short</li>
|
||||
<li>static</li>
|
||||
<li>strictfp</li>
|
||||
<li>stringutil</li>
|
||||
<li>super</li>
|
||||
<li>switch</li>
|
||||
<li>synchronized</li>
|
||||
<li>this</li>
|
||||
<li>throw</li>
|
||||
<li>throws</li>
|
||||
<li>transient</li>
|
||||
<li>try</li>
|
||||
<li>void</li>
|
||||
<li>volatile</li>
|
||||
<li>while</li>
|
||||
</ul>
|
||||
|
||||
## FEATURE SET
|
||||
|
||||
|
||||
### Client Modification Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|BasePath|✓|ToolingExtension
|
||||
|Authorizations|✗|ToolingExtension
|
||||
|UserAgent|✗|ToolingExtension
|
||||
|MockServer|✗|ToolingExtension
|
||||
|
||||
### Data Type Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Custom|✗|OAS2,OAS3
|
||||
|Int32|✓|OAS2,OAS3
|
||||
|Int64|✓|OAS2,OAS3
|
||||
|Float|✓|OAS2,OAS3
|
||||
|Double|✓|OAS2,OAS3
|
||||
|Decimal|✓|ToolingExtension
|
||||
|String|✓|OAS2,OAS3
|
||||
|Byte|✓|OAS2,OAS3
|
||||
|Binary|✓|OAS2,OAS3
|
||||
|Boolean|✓|OAS2,OAS3
|
||||
|Date|✓|OAS2,OAS3
|
||||
|DateTime|✓|OAS2,OAS3
|
||||
|Password|✓|OAS2,OAS3
|
||||
|File|✓|OAS2
|
||||
|Uuid|✗|
|
||||
|Array|✓|OAS2,OAS3
|
||||
|Null|✗|OAS3
|
||||
|AnyType|✗|OAS2,OAS3
|
||||
|Object|✓|OAS2,OAS3
|
||||
|Maps|✓|ToolingExtension
|
||||
|CollectionFormat|✓|OAS2
|
||||
|CollectionFormatMulti|✓|OAS2
|
||||
|Enum|✓|OAS2,OAS3
|
||||
|ArrayOfEnum|✓|ToolingExtension
|
||||
|ArrayOfModel|✓|ToolingExtension
|
||||
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
|
||||
|ArrayOfCollectionOfModel|✓|ToolingExtension
|
||||
|ArrayOfCollectionOfEnum|✓|ToolingExtension
|
||||
|MapOfEnum|✓|ToolingExtension
|
||||
|MapOfModel|✓|ToolingExtension
|
||||
|MapOfCollectionOfPrimitives|✓|ToolingExtension
|
||||
|MapOfCollectionOfModel|✓|ToolingExtension
|
||||
|MapOfCollectionOfEnum|✓|ToolingExtension
|
||||
|
||||
### Documentation Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Readme|✓|ToolingExtension
|
||||
|Model|✓|ToolingExtension
|
||||
|Api|✓|ToolingExtension
|
||||
|
||||
### Global Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Host|✓|OAS2,OAS3
|
||||
|BasePath|✓|OAS2,OAS3
|
||||
|Info|✓|OAS2,OAS3
|
||||
|Schemes|✗|OAS2,OAS3
|
||||
|PartialSchemes|✓|OAS2,OAS3
|
||||
|Consumes|✓|OAS2
|
||||
|Produces|✓|OAS2
|
||||
|ExternalDocumentation|✓|OAS2,OAS3
|
||||
|Examples|✓|OAS2,OAS3
|
||||
|XMLStructureDefinitions|✗|OAS2,OAS3
|
||||
|MultiServer|✗|OAS3
|
||||
|ParameterizedServer|✗|OAS3
|
||||
|ParameterStyling|✗|OAS3
|
||||
|Callbacks|✗|OAS3
|
||||
|LinkObjects|✗|OAS3
|
||||
|
||||
### Parameter Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Path|✓|OAS2,OAS3
|
||||
|Query|✓|OAS2,OAS3
|
||||
|Header|✓|OAS2,OAS3
|
||||
|Body|✓|OAS2
|
||||
|FormUnencoded|✓|OAS2
|
||||
|FormMultipart|✓|OAS2
|
||||
|Cookie|✓|OAS3
|
||||
|
||||
### Schema Support Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Simple|✓|OAS2,OAS3
|
||||
|Composite|✓|OAS2,OAS3
|
||||
|Polymorphism|✗|OAS2,OAS3
|
||||
|Union|✗|OAS3
|
||||
|allOf|✗|OAS2,OAS3
|
||||
|anyOf|✗|OAS3
|
||||
|oneOf|✗|OAS3
|
||||
|not|✗|OAS3
|
||||
|
||||
### Security Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|BasicAuth|✓|OAS2,OAS3
|
||||
|ApiKey|✓|OAS2,OAS3
|
||||
|OpenIDConnect|✗|OAS3
|
||||
|BearerToken|✓|OAS3
|
||||
|OAuth2_Implicit|✓|OAS2,OAS3
|
||||
|OAuth2_Password|✗|OAS2,OAS3
|
||||
|OAuth2_ClientCredentials|✗|OAS2,OAS3
|
||||
|OAuth2_AuthorizationCode|✗|OAS2,OAS3
|
||||
|SignatureAuth|✗|OAS3
|
||||
|AWSV4Signature|✗|ToolingExtension
|
||||
|
||||
### Wire Format Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|JSON|✓|OAS2,OAS3
|
||||
|XML|✓|OAS2,OAS3
|
||||
|PROTOBUF|✗|ToolingExtension
|
||||
|Custom|✗|OAS2,OAS3
|
||||
@@ -32,7 +32,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|featureResources|Generates routes in a typed way, for both: constructing URLs and reading the parameters.| |true|
|
||||
|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools|
|
||||
|interfaceOnly|Whether to generate only API interface stubs without the server files. This option is currently supported only when using jaxrs-spec library.| |false|
|
||||
|library|library template (sub-template)|<dl><dt>**ktor**</dt><dd>ktor framework</dd><dt>**jaxrs-spec**</dt><dd>JAX-RS spec only</dd></dl>|ktor|
|
||||
|library|library template (sub-template)|<dl><dt>**ktor**</dt><dd>ktor framework</dd><dt>**jaxrs-spec**</dt><dd>JAX-RS spec only</dd><dt>**javalin5**</dt><dd>Javalin 5</dd></dl>|ktor|
|
||||
|modelMutable|Create mutable models| |false|
|
||||
|omitGradleWrapper|Whether to omit Gradle wrapper for creating a sub project.| |false|
|
||||
|packageName|Generated artifact package name.| |org.openapitools.server|
|
||||
|
||||
@@ -22,6 +22,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|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|
|
||||
|apiPackage|api package for generated code| |org.openapitools.api|
|
||||
|apiSuffix|suffix for api classes| |Api|
|
||||
|appendRequestToHandler|Append ServerHttpRequest to handler method for getting request stuff| |false|
|
||||
|artifactId|Generated artifact id (name of jar).| |openapi-spring|
|
||||
|artifactVersion|Generated artifact's package version.| |1.0.0|
|
||||
|basePackage|base package (invokerPackage) for generated code| |org.openapitools|
|
||||
|
||||
235
docs/generators/rust-axum.md
Normal file
235
docs/generators/rust-axum.md
Normal file
@@ -0,0 +1,235 @@
|
||||
---
|
||||
title: Documentation for the rust-axum Generator
|
||||
---
|
||||
|
||||
## METADATA
|
||||
|
||||
| Property | Value | Notes |
|
||||
| -------- | ----- | ----- |
|
||||
| generator name | rust-axum | pass this to the generate command after -g |
|
||||
| generator stability | BETA | |
|
||||
| generator type | SERVER | |
|
||||
| generator language | Rust | |
|
||||
| generator default templating engine | mustache | |
|
||||
| helpTxt | Generates a Rust server library which bases on Axum. | |
|
||||
|
||||
## 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.
|
||||
|
||||
| Option | Description | Values | Default |
|
||||
| ------ | ----------- | ------ | ------- |
|
||||
|allowBlockingResponseSerialize|By default, json/form-urlencoded response serialization, which might perform a lot of compute in a future without yielding, is executed on a blocking thread via tokio::task::spawn_blocking. Set this option to true will override this behaviour and allow blocking call to happen. It helps to improve the performance when response serialization (e.g. returns tiny data) is low cost.| |false|
|
||||
|allowBlockingValidator|By default, validation process, which might perform a lot of compute in a future without yielding, is executed on a blocking thread via tokio::task::spawn_blocking. Set this option to true will override this behaviour and allow blocking call to happen. It helps to improve the performance when validating request-data (header, path, query, body) is low cost.| |false|
|
||||
|disableValidator|Disable validating request-data (header, path, query, body) against OpenAPI Schema Specification.| |false|
|
||||
|packageName|Rust crate name (convention: snake_case).| |openapi|
|
||||
|packageVersion|Rust crate version.| |null|
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
| ---------- | ------- |
|
||||
|
||||
|
||||
## INSTANTIATION TYPES
|
||||
|
||||
| Type/Alias | Instantiated By |
|
||||
| ---------- | --------------- |
|
||||
|array|Vec|
|
||||
|map|std::collections::HashMap|
|
||||
|
||||
|
||||
## LANGUAGE PRIMITIVES
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>String</li>
|
||||
<li>bool</li>
|
||||
<li>char</li>
|
||||
<li>f32</li>
|
||||
<li>f64</li>
|
||||
<li>i16</li>
|
||||
<li>i32</li>
|
||||
<li>i64</li>
|
||||
<li>i8</li>
|
||||
<li>isize</li>
|
||||
<li>str</li>
|
||||
<li>u16</li>
|
||||
<li>u32</li>
|
||||
<li>u64</li>
|
||||
<li>u8</li>
|
||||
<li>usize</li>
|
||||
</ul>
|
||||
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>Self</li>
|
||||
<li>abstract</li>
|
||||
<li>as</li>
|
||||
<li>async</li>
|
||||
<li>await</li>
|
||||
<li>become</li>
|
||||
<li>box</li>
|
||||
<li>break</li>
|
||||
<li>const</li>
|
||||
<li>continue</li>
|
||||
<li>crate</li>
|
||||
<li>do</li>
|
||||
<li>dyn</li>
|
||||
<li>else</li>
|
||||
<li>enum</li>
|
||||
<li>extern</li>
|
||||
<li>false</li>
|
||||
<li>final</li>
|
||||
<li>fn</li>
|
||||
<li>for</li>
|
||||
<li>if</li>
|
||||
<li>impl</li>
|
||||
<li>in</li>
|
||||
<li>let</li>
|
||||
<li>loop</li>
|
||||
<li>macro</li>
|
||||
<li>match</li>
|
||||
<li>mod</li>
|
||||
<li>move</li>
|
||||
<li>mut</li>
|
||||
<li>override</li>
|
||||
<li>priv</li>
|
||||
<li>pub</li>
|
||||
<li>ref</li>
|
||||
<li>return</li>
|
||||
<li>self</li>
|
||||
<li>static</li>
|
||||
<li>struct</li>
|
||||
<li>super</li>
|
||||
<li>trait</li>
|
||||
<li>true</li>
|
||||
<li>try</li>
|
||||
<li>type</li>
|
||||
<li>typeof</li>
|
||||
<li>unsafe</li>
|
||||
<li>unsized</li>
|
||||
<li>use</li>
|
||||
<li>virtual</li>
|
||||
<li>where</li>
|
||||
<li>while</li>
|
||||
<li>yield</li>
|
||||
</ul>
|
||||
|
||||
## FEATURE SET
|
||||
|
||||
|
||||
### Client Modification Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|BasePath|✗|ToolingExtension
|
||||
|Authorizations|✗|ToolingExtension
|
||||
|UserAgent|✗|ToolingExtension
|
||||
|MockServer|✗|ToolingExtension
|
||||
|
||||
### Data Type Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Custom|✗|OAS2,OAS3
|
||||
|Int32|✓|OAS2,OAS3
|
||||
|Int64|✓|OAS2,OAS3
|
||||
|Float|✓|OAS2,OAS3
|
||||
|Double|✓|OAS2,OAS3
|
||||
|Decimal|✓|ToolingExtension
|
||||
|String|✓|OAS2,OAS3
|
||||
|Byte|✓|OAS2,OAS3
|
||||
|Binary|✓|OAS2,OAS3
|
||||
|Boolean|✓|OAS2,OAS3
|
||||
|Date|✓|OAS2,OAS3
|
||||
|DateTime|✓|OAS2,OAS3
|
||||
|Password|✓|OAS2,OAS3
|
||||
|File|✓|OAS2
|
||||
|Uuid|✗|
|
||||
|Array|✓|OAS2,OAS3
|
||||
|Null|✗|OAS3
|
||||
|AnyType|✗|OAS2,OAS3
|
||||
|Object|✓|OAS2,OAS3
|
||||
|Maps|✓|ToolingExtension
|
||||
|CollectionFormat|✓|OAS2
|
||||
|CollectionFormatMulti|✓|OAS2
|
||||
|Enum|✓|OAS2,OAS3
|
||||
|ArrayOfEnum|✓|ToolingExtension
|
||||
|ArrayOfModel|✓|ToolingExtension
|
||||
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
|
||||
|ArrayOfCollectionOfModel|✓|ToolingExtension
|
||||
|ArrayOfCollectionOfEnum|✓|ToolingExtension
|
||||
|MapOfEnum|✓|ToolingExtension
|
||||
|MapOfModel|✓|ToolingExtension
|
||||
|MapOfCollectionOfPrimitives|✓|ToolingExtension
|
||||
|MapOfCollectionOfModel|✓|ToolingExtension
|
||||
|MapOfCollectionOfEnum|✓|ToolingExtension
|
||||
|
||||
### Documentation Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Readme|✗|ToolingExtension
|
||||
|Model|✓|ToolingExtension
|
||||
|Api|✓|ToolingExtension
|
||||
|
||||
### Global Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Host|✓|OAS2,OAS3
|
||||
|BasePath|✓|OAS2,OAS3
|
||||
|Info|✗|OAS2,OAS3
|
||||
|Schemes|✗|OAS2,OAS3
|
||||
|PartialSchemes|✓|OAS2,OAS3
|
||||
|Consumes|✓|OAS2
|
||||
|Produces|✓|OAS2
|
||||
|ExternalDocumentation|✗|OAS2,OAS3
|
||||
|Examples|✗|OAS2,OAS3
|
||||
|XMLStructureDefinitions|✗|OAS2,OAS3
|
||||
|MultiServer|✗|OAS3
|
||||
|ParameterizedServer|✗|OAS3
|
||||
|ParameterStyling|✗|OAS3
|
||||
|Callbacks|✗|OAS3
|
||||
|LinkObjects|✗|OAS3
|
||||
|
||||
### Parameter Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Path|✓|OAS2,OAS3
|
||||
|Query|✓|OAS2,OAS3
|
||||
|Header|✓|OAS2,OAS3
|
||||
|Body|✓|OAS2
|
||||
|FormUnencoded|✓|OAS2
|
||||
|FormMultipart|✓|OAS2
|
||||
|Cookie|✗|OAS3
|
||||
|
||||
### Schema Support Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Simple|✓|OAS2,OAS3
|
||||
|Composite|✓|OAS2,OAS3
|
||||
|Polymorphism|✗|OAS2,OAS3
|
||||
|Union|✗|OAS3
|
||||
|allOf|✗|OAS2,OAS3
|
||||
|anyOf|✗|OAS3
|
||||
|oneOf|✗|OAS3
|
||||
|not|✗|OAS3
|
||||
|
||||
### Security Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|BasicAuth|✓|OAS2,OAS3
|
||||
|ApiKey|✓|OAS2,OAS3
|
||||
|OpenIDConnect|✗|OAS3
|
||||
|BearerToken|✓|OAS3
|
||||
|OAuth2_Implicit|✓|OAS2,OAS3
|
||||
|OAuth2_Password|✓|OAS2,OAS3
|
||||
|OAuth2_ClientCredentials|✓|OAS2,OAS3
|
||||
|OAuth2_AuthorizationCode|✓|OAS2,OAS3
|
||||
|SignatureAuth|✗|OAS3
|
||||
|AWSV4Signature|✗|ToolingExtension
|
||||
|
||||
### Wire Format Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|JSON|✓|OAS2,OAS3
|
||||
|XML|✗|OAS2,OAS3
|
||||
|PROTOBUF|✗|ToolingExtension
|
||||
|Custom|✓|OAS2,OAS3
|
||||
275
docs/generators/scala-http4s-server.md
Normal file
275
docs/generators/scala-http4s-server.md
Normal file
@@ -0,0 +1,275 @@
|
||||
---
|
||||
title: Documentation for the scala-http4s-server Generator
|
||||
---
|
||||
|
||||
## METADATA
|
||||
|
||||
| Property | Value | Notes |
|
||||
| -------- | ----- | ----- |
|
||||
| generator name | scala-http4s-server | pass this to the generate command after -g |
|
||||
| generator stability | STABLE | |
|
||||
| generator type | SERVER | |
|
||||
| generator language | Scala | |
|
||||
| generator default templating engine | mustache | |
|
||||
| helpTxt | Generates a Scala http4s server bindings. | |
|
||||
|
||||
## 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.
|
||||
|
||||
| Option | Description | Values | Default |
|
||||
| ------ | ----------- | ------ | ------- |
|
||||
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |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|
|
||||
|excludeSbt|exclude sbt from generation| |null|
|
||||
|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|
|
||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |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|
|
||||
|sourceSubfolder|name of subfolder, for example to generate code in src/scala/generated| |null|
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
| ---------- | ------- |
|
||||
|And|eu.timepit.refined.boolean.And|
|
||||
|ArrayBuffer|scala.collection.mutable.ArrayBuffer|
|
||||
|Date|java.util.Date|
|
||||
|DateTime|java.time.LocalDateTime|
|
||||
|File|java.io.File|
|
||||
|Greater|eu.timepit.refined.numeric.Greater|
|
||||
|GreaterEqual|eu.timepit.refined.numeric.GreaterEqual|
|
||||
|HashMap|scala.collection.immutable.HashMap|
|
||||
|Less|eu.timepit.refined.numeric.Less|
|
||||
|LessEqual|eu.timepit.refined.numeric.LessEqual|
|
||||
|LocalDate|java.time.LocalDate|
|
||||
|LocalDateTime|java.time.LocalDateTime|
|
||||
|LocalTime|java.time.LocalTime|
|
||||
|Map|scala.collection.immutable.Map|
|
||||
|MatchesRegex|eu.timepit.refined.string.MatchesRegex|
|
||||
|MaxSize|eu.timepit.refined.collection.MaxSize|
|
||||
|MinSize|eu.timepit.refined.collection.MinSize|
|
||||
|OffsetDateTime|java.time.OffsetDateTime|
|
||||
|Refined|eu.timepit.refined.api.Refined|
|
||||
|Seq|scala.collection.immutable.Seq|
|
||||
|Timestamp|java.sql.Timestamp|
|
||||
|URI|java.net.URI|
|
||||
|UUID|java.util.UUID|
|
||||
|ZonedDateTime|java.time.ZonedDateTime|
|
||||
|
||||
|
||||
## INSTANTIATION TYPES
|
||||
|
||||
| Type/Alias | Instantiated By |
|
||||
| ---------- | --------------- |
|
||||
|array|ArrayList|
|
||||
|map|HashMap|
|
||||
|
||||
|
||||
## LANGUAGE PRIMITIVES
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>Any</li>
|
||||
<li>AnyRef</li>
|
||||
<li>AnyVal</li>
|
||||
<li>BigDecimal</li>
|
||||
<li>Boolean</li>
|
||||
<li>Double</li>
|
||||
<li>Float</li>
|
||||
<li>Int</li>
|
||||
<li>Integer</li>
|
||||
<li>Long</li>
|
||||
<li>Object</li>
|
||||
<li>String</li>
|
||||
</ul>
|
||||
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>abstract</li>
|
||||
<li>assert</li>
|
||||
<li>break</li>
|
||||
<li>byte</li>
|
||||
<li>case</li>
|
||||
<li>catch</li>
|
||||
<li>char</li>
|
||||
<li>class</li>
|
||||
<li>const</li>
|
||||
<li>continue</li>
|
||||
<li>def</li>
|
||||
<li>default</li>
|
||||
<li>do</li>
|
||||
<li>double</li>
|
||||
<li>else</li>
|
||||
<li>enum</li>
|
||||
<li>extends</li>
|
||||
<li>false</li>
|
||||
<li>final</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
<li>for</li>
|
||||
<li>forsome</li>
|
||||
<li>goto</li>
|
||||
<li>if</li>
|
||||
<li>implements</li>
|
||||
<li>implicit</li>
|
||||
<li>import</li>
|
||||
<li>instanceof</li>
|
||||
<li>int</li>
|
||||
<li>interface</li>
|
||||
<li>lazy</li>
|
||||
<li>long</li>
|
||||
<li>match</li>
|
||||
<li>native</li>
|
||||
<li>new</li>
|
||||
<li>null</li>
|
||||
<li>object</li>
|
||||
<li>override</li>
|
||||
<li>package</li>
|
||||
<li>private</li>
|
||||
<li>protected</li>
|
||||
<li>public</li>
|
||||
<li>return</li>
|
||||
<li>sealed</li>
|
||||
<li>short</li>
|
||||
<li>static</li>
|
||||
<li>strictfp</li>
|
||||
<li>super</li>
|
||||
<li>switch</li>
|
||||
<li>synchronized</li>
|
||||
<li>this</li>
|
||||
<li>throw</li>
|
||||
<li>throws</li>
|
||||
<li>trait</li>
|
||||
<li>transient</li>
|
||||
<li>true</li>
|
||||
<li>try</li>
|
||||
<li>type</li>
|
||||
<li>val</li>
|
||||
<li>var</li>
|
||||
<li>void</li>
|
||||
<li>volatile</li>
|
||||
<li>while</li>
|
||||
<li>with</li>
|
||||
<li>yield</li>
|
||||
</ul>
|
||||
|
||||
## FEATURE SET
|
||||
|
||||
|
||||
### Client Modification Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|BasePath|✗|ToolingExtension
|
||||
|Authorizations|✗|ToolingExtension
|
||||
|UserAgent|✗|ToolingExtension
|
||||
|MockServer|✗|ToolingExtension
|
||||
|
||||
### Data Type Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Custom|✗|OAS2,OAS3
|
||||
|Int32|✓|OAS2,OAS3
|
||||
|Int64|✓|OAS2,OAS3
|
||||
|Float|✓|OAS2,OAS3
|
||||
|Double|✓|OAS2,OAS3
|
||||
|Decimal|✓|ToolingExtension
|
||||
|String|✓|OAS2,OAS3
|
||||
|Byte|✓|OAS2,OAS3
|
||||
|Binary|✓|OAS2,OAS3
|
||||
|Boolean|✓|OAS2,OAS3
|
||||
|Date|✓|OAS2,OAS3
|
||||
|DateTime|✓|OAS2,OAS3
|
||||
|Password|✓|OAS2,OAS3
|
||||
|File|✓|OAS2
|
||||
|Uuid|✗|
|
||||
|Array|✓|OAS2,OAS3
|
||||
|Null|✗|OAS3
|
||||
|AnyType|✗|OAS2,OAS3
|
||||
|Object|✓|OAS2,OAS3
|
||||
|Maps|✓|ToolingExtension
|
||||
|CollectionFormat|✓|OAS2
|
||||
|CollectionFormatMulti|✓|OAS2
|
||||
|Enum|✓|OAS2,OAS3
|
||||
|ArrayOfEnum|✓|ToolingExtension
|
||||
|ArrayOfModel|✓|ToolingExtension
|
||||
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
|
||||
|ArrayOfCollectionOfModel|✓|ToolingExtension
|
||||
|ArrayOfCollectionOfEnum|✓|ToolingExtension
|
||||
|MapOfEnum|✓|ToolingExtension
|
||||
|MapOfModel|✓|ToolingExtension
|
||||
|MapOfCollectionOfPrimitives|✓|ToolingExtension
|
||||
|MapOfCollectionOfModel|✓|ToolingExtension
|
||||
|MapOfCollectionOfEnum|✓|ToolingExtension
|
||||
|
||||
### Documentation Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Readme|✗|ToolingExtension
|
||||
|Model|✓|ToolingExtension
|
||||
|Api|✓|ToolingExtension
|
||||
|
||||
### Global Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Host|✓|OAS2,OAS3
|
||||
|BasePath|✓|OAS2,OAS3
|
||||
|Info|✓|OAS2,OAS3
|
||||
|Schemes|✗|OAS2,OAS3
|
||||
|PartialSchemes|✓|OAS2,OAS3
|
||||
|Consumes|✓|OAS2
|
||||
|Produces|✓|OAS2
|
||||
|ExternalDocumentation|✓|OAS2,OAS3
|
||||
|Examples|✓|OAS2,OAS3
|
||||
|XMLStructureDefinitions|✗|OAS2,OAS3
|
||||
|MultiServer|✗|OAS3
|
||||
|ParameterizedServer|✗|OAS3
|
||||
|ParameterStyling|✗|OAS3
|
||||
|Callbacks|✗|OAS3
|
||||
|LinkObjects|✗|OAS3
|
||||
|
||||
### Parameter Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Path|✓|OAS2,OAS3
|
||||
|Query|✓|OAS2,OAS3
|
||||
|Header|✓|OAS2,OAS3
|
||||
|Body|✓|OAS2
|
||||
|FormUnencoded|✓|OAS2
|
||||
|FormMultipart|✓|OAS2
|
||||
|Cookie|✗|OAS3
|
||||
|
||||
### Schema Support Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Simple|✓|OAS2,OAS3
|
||||
|Composite|✓|OAS2,OAS3
|
||||
|Polymorphism|✗|OAS2,OAS3
|
||||
|Union|✗|OAS3
|
||||
|allOf|✗|OAS2,OAS3
|
||||
|anyOf|✗|OAS3
|
||||
|oneOf|✗|OAS3
|
||||
|not|✗|OAS3
|
||||
|
||||
### Security Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|BasicAuth|✗|OAS2,OAS3
|
||||
|ApiKey|✗|OAS2,OAS3
|
||||
|OpenIDConnect|✗|OAS3
|
||||
|BearerToken|✗|OAS3
|
||||
|OAuth2_Implicit|✗|OAS2,OAS3
|
||||
|OAuth2_Password|✗|OAS2,OAS3
|
||||
|OAuth2_ClientCredentials|✗|OAS2,OAS3
|
||||
|OAuth2_AuthorizationCode|✗|OAS2,OAS3
|
||||
|SignatureAuth|✗|OAS3
|
||||
|AWSV4Signature|✗|ToolingExtension
|
||||
|
||||
### Wire Format Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|JSON|✓|OAS2,OAS3
|
||||
|XML|✓|OAS2,OAS3
|
||||
|PROTOBUF|✗|ToolingExtension
|
||||
|Custom|✓|OAS2,OAS3
|
||||
@@ -103,18 +103,18 @@ docker run --rm \
|
||||
<!-- 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/6.6.0/openapi-generator-cli-6.6.0.jar`
|
||||
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.2.0/openapi-generator-cli-7.2.0.jar`
|
||||
|
||||
For **Mac/Linux** users:
|
||||
|
||||
```bash
|
||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.6.0/openapi-generator-cli-6.6.0.jar -O openapi-generator-cli.jar
|
||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.2.0/openapi-generator-cli-7.2.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.
|
||||
|
||||
```powershell
|
||||
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.6.0/openapi-generator-cli-6.6.0.jar
|
||||
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.2.0/openapi-generator-cli-7.2.0.jar
|
||||
```
|
||||
<!-- /RELEASE_VERSION -->
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.2.0</version>
|
||||
<version>7.3.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.2.0</version>
|
||||
<version>7.3.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -97,7 +97,7 @@ task validateGoodSpec(type: org.openapitools.generator.gradle.plugin.tasks.Valid
|
||||
[source,group]
|
||||
----
|
||||
plugins {
|
||||
id "org.openapi.generator" version "6.6.0"
|
||||
id "org.openapi.generator" version "7.2.0"
|
||||
}
|
||||
----
|
||||
|
||||
@@ -113,7 +113,7 @@ buildscript {
|
||||
// url "https://plugins.gradle.org/m2/"
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.openapitools:openapi-generator-gradle-plugin:6.6.0"
|
||||
classpath "org.openapitools:openapi-generator-gradle-plugin:7.2.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -761,7 +761,7 @@ buildscript {
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.2.1'
|
||||
classpath('org.openapitools:openapi-generator-gradle-plugin:6.6.0') {
|
||||
classpath('org.openapitools:openapi-generator-gradle-plugin:7.2.0') {
|
||||
exclude group: 'com.google.guava'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# RELEASE_VERSION
|
||||
openApiGeneratorVersion=7.2.0
|
||||
openApiGeneratorVersion=7.3.0-SNAPSHOT
|
||||
# /RELEASE_VERSION
|
||||
|
||||
# BEGIN placeholders
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.2.0</version>
|
||||
<version>7.3.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -19,5 +19,5 @@ gradle generateGoWithInvalidSpec # expected outcome: BUILD FAILED
|
||||
The samples can be tested against other versions of the plugin using the `openApiGeneratorVersion` property. For example:
|
||||
|
||||
```bash
|
||||
gradle -PopenApiGeneratorVersion=6.3.0 openApiValidate
|
||||
gradle -PopenApiGeneratorVersion=7.2.0 openApiValidate
|
||||
```
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# RELEASE_VERSION
|
||||
openApiGeneratorVersion=7.2.0
|
||||
openApiGeneratorVersion=7.3.0-SNAPSHOT
|
||||
# /RELEASE_VERSION
|
||||
|
||||
@@ -12,7 +12,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase)
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>6.3.0</version>
|
||||
<version>7.2.0</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.2.0</version>
|
||||
<version>7.3.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.2.0</version>
|
||||
<version>7.3.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.2.0</version>
|
||||
<version>7.3.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.2.0</version>
|
||||
<version>7.3.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.2.0</version>
|
||||
<version>7.3.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.2.0</version>
|
||||
<version>7.3.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.2.0</version>
|
||||
<version>7.3.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.2.0</version>
|
||||
<version>7.3.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,23 +17,35 @@
|
||||
|
||||
package org.openapitools.codegen.online;
|
||||
|
||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
||||
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.FieldPosition;
|
||||
import java.text.ParsePosition;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZoneOffset;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
import java.util.TimeZone;
|
||||
|
||||
|
||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
||||
public class RFC3339DateFormat extends DateFormat {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final DateTimeFormatter dtf = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
|
||||
private static final StdDateFormat sdf = new StdDateFormat()
|
||||
.withTimeZone(TimeZone.getTimeZone(ZoneId.systemDefault()))
|
||||
.withColonInTimeZone(true);
|
||||
|
||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
||||
@Override
|
||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||
String value = ISO8601Utils.format(date, true);
|
||||
String value = date.toInstant().atOffset(ZoneOffset.UTC).format(dtf);
|
||||
toAppendTo.append(value);
|
||||
return toAppendTo;
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public Date parse(String source, ParsePosition pos) {
|
||||
return sdf.parse(source, pos);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.2.0</version>
|
||||
<version>7.3.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
@@ -440,7 +440,6 @@
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>${lombok.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<repositories>
|
||||
|
||||
@@ -156,6 +156,9 @@ public class CodegenConstants {
|
||||
public static final String USE_DATETIME_OFFSET = "useDateTimeOffset";
|
||||
public static final String USE_DATETIME_OFFSET_DESC = "Use DateTimeOffset to model date-time properties";
|
||||
|
||||
public static final String USE_DATETIME_FOR_DATE = "useDateTimeForDate";
|
||||
public static final String USE_DATETIME_FOR_DATE_DESC = "Use DateTime to model date properties even if DateOnly supported. (.net 6.0+ only)";
|
||||
|
||||
public static final String ENSURE_UNIQUE_PARAMS = "ensureUniqueParams";
|
||||
public static final String ENSURE_UNIQUE_PARAMS_DESC = "Whether to ensure parameter names are unique in an operation (rename parameters that are not).";
|
||||
|
||||
|
||||
@@ -347,7 +347,7 @@ public class CodegenOperation {
|
||||
sb.append(", isVoid=").append(isVoid);
|
||||
sb.append(", isResponseBinary=").append(isResponseBinary);
|
||||
sb.append(", isResponseFile=").append(isResponseFile);
|
||||
sb.append(", isResponseFile=").append(isResponseOptional);
|
||||
sb.append(", isResponseOptional=").append(isResponseOptional);
|
||||
sb.append(", hasReference=").append(hasReference);
|
||||
sb.append(", hasDefaultResponse=").append(hasDefaultResponse);
|
||||
sb.append(", hasErrorResponseObject=").append(hasErrorResponseObject);
|
||||
|
||||
@@ -3724,6 +3724,10 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
return;
|
||||
}
|
||||
if (ModelUtils.isComposedSchema(schema)) {
|
||||
// fix issue #16797 and #15796, constructor fail by missing parent required params
|
||||
if (schema.getProperties() != null && !schema.getProperties().isEmpty()) {
|
||||
properties.putAll(schema.getProperties());
|
||||
}
|
||||
|
||||
if (schema.getAllOf() != null) {
|
||||
for (Object component : schema.getAllOf()) {
|
||||
@@ -3747,6 +3751,11 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
}
|
||||
|
||||
for (String r : required) {
|
||||
if (!properties.containsKey(r)) {
|
||||
LOGGER.error("Required var %s not in properties", r);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4192,6 +4201,9 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
if (original.getDeprecated() != null) {
|
||||
property.deprecated = p.getDeprecated();
|
||||
}
|
||||
if (original.getDescription() != null) {
|
||||
property.description = p.getDescription();
|
||||
}
|
||||
}
|
||||
|
||||
// set the default value
|
||||
@@ -4440,18 +4452,6 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
}
|
||||
|
||||
// check skipOperationExample, which can be set to true to avoid out of memory errors for large spec
|
||||
if (!isSkipOperationExample()) {
|
||||
// generate examples
|
||||
String exampleStatusCode = "200";
|
||||
for (String key : operation.getResponses().keySet()) {
|
||||
if (operation.getResponses().get(key) == methodResponse && !key.equals("default")) {
|
||||
exampleStatusCode = key;
|
||||
}
|
||||
}
|
||||
op.examples = new ExampleGenerator(schemas, this.openAPI).generateFromResponseSchema(exampleStatusCode, responseSchema, getProducesInfo(this.openAPI, operation));
|
||||
}
|
||||
|
||||
op.defaultResponse = toDefaultValue(responseSchema);
|
||||
op.returnType = cm.dataType;
|
||||
op.returnFormat = cm.dataFormat;
|
||||
@@ -4507,6 +4507,11 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
if (operation == null)
|
||||
throw new RuntimeException("operation cannot be null in fromOperation");
|
||||
|
||||
if (operation.getExtensions() != null && Boolean.TRUE.equals(operation.getExtensions().get("x-internal"))) {
|
||||
LOGGER.info("Operation ({} {} - {}) not generated since x-internal is set to true",
|
||||
httpMethod, path, operation.getOperationId());
|
||||
}
|
||||
|
||||
Map<String, Schema> schemas = ModelUtils.getSchemas(this.openAPI);
|
||||
CodegenOperation op = CodegenModelFactory.newInstance(CodegenModelType.OPERATION);
|
||||
Set<String> imports = new HashSet<>();
|
||||
@@ -4630,6 +4635,35 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
}
|
||||
|
||||
// check skipOperationExample, which can be set to true to avoid out of memory errors for large spec
|
||||
if (!isSkipOperationExample() && operation.getResponses() != null) {
|
||||
// generate examples
|
||||
ExampleGenerator generator = new ExampleGenerator(schemas, this.openAPI);
|
||||
List<Map<String, String>> examples = new ArrayList<>();
|
||||
|
||||
for (String statusCode : operation.getResponses().keySet()) {
|
||||
ApiResponse apiResponse = operation.getResponses().get(statusCode);
|
||||
Schema schema = unaliasSchema(ModelUtils.getSchemaFromResponse(openAPI, apiResponse));
|
||||
if (schema == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (apiResponse.getContent() != null) {
|
||||
Set<String> producesInfo = new ConcurrentSkipListSet<>(apiResponse.getContent().keySet());
|
||||
|
||||
String exampleStatusCode = statusCode;
|
||||
if (exampleStatusCode.equals("default")) {
|
||||
exampleStatusCode = "200";
|
||||
}
|
||||
List<Map<String, String>> examplesForResponse = generator.generateFromResponseSchema(exampleStatusCode, schema, producesInfo);
|
||||
if (examplesForResponse != null) {
|
||||
examples.addAll(examplesForResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
op.examples = examples;
|
||||
}
|
||||
|
||||
if (operation.getCallbacks() != null && !operation.getCallbacks().isEmpty()) {
|
||||
operation.getCallbacks().forEach((name, callback) -> {
|
||||
CodegenCallback c = fromCallback(name, callback, servers);
|
||||
@@ -7324,7 +7358,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
|
||||
protected void updateRequestBodyForMap(CodegenParameter codegenParameter, Schema schema, String name, Set<String> imports, String bodyParameterName) {
|
||||
if (StringUtils.isNotBlank(name)) {
|
||||
if (StringUtils.isNotBlank(name) && !(ModelUtils.isFreeFormObject(schema) && !ModelUtils.shouldGenerateFreeFormObjectModel(name, this))) {
|
||||
this.addBodyModelSchema(codegenParameter, name, schema, imports, bodyParameterName, true);
|
||||
} else {
|
||||
Schema inner = ModelUtils.getAdditionalProperties(schema);
|
||||
@@ -8168,51 +8202,6 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method has been kept to keep the introduction of ModelUtils.isAnyType as a non-breaking change
|
||||
* this way, existing forks of our generator can continue to use this method
|
||||
* TODO in 6.0.0 replace this method with ModelUtils.isAnyType
|
||||
* Return true if the schema value can be any type, i.e. it can be
|
||||
* the null value, integer, number, string, object or array.
|
||||
* One use case is when the "type" attribute in the OAS schema is unspecified.
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* arbitraryTypeValue:
|
||||
* description: This is an arbitrary type schema.
|
||||
* It is not a free-form object.
|
||||
* The value can be any type except the 'null' value.
|
||||
* arbitraryTypeNullableValue:
|
||||
* description: This is an arbitrary type schema.
|
||||
* It is not a free-form object.
|
||||
* The value can be any type, including the 'null' value.
|
||||
* nullable: true
|
||||
*
|
||||
* @param schema the OAS schema.
|
||||
* @return true if the schema value can be an arbitrary type.
|
||||
*/
|
||||
public boolean isAnyTypeSchema(Schema schema) {
|
||||
if (schema == null) {
|
||||
once(LOGGER).error("Schema cannot be null in isAnyTypeSchema check");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ModelUtils.isFreeFormObject(schema)) {
|
||||
// make sure it's not free form object
|
||||
return false;
|
||||
}
|
||||
|
||||
if (schema.getClass().equals(Schema.class) && schema.get$ref() == null && schema.getType() == null &&
|
||||
(schema.getProperties() == null || schema.getProperties().isEmpty()) &&
|
||||
schema.getAdditionalProperties() == null && schema.getNot() == null &&
|
||||
schema.getEnum() == null) {
|
||||
return true;
|
||||
// If and when type arrays are supported in a future OAS specification,
|
||||
// we could return true if the type array includes all possible JSON schema types.
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the given MIME is a JSON MIME.
|
||||
* JSON MIME examples:
|
||||
|
||||
@@ -508,17 +508,11 @@ public class DefaultGenerator implements Generator {
|
||||
|
||||
Schema schema = schemas.get(name);
|
||||
|
||||
if (ModelUtils.isFreeFormObject(schema)) { // check to see if it's a free-form object
|
||||
// there are 3 free form use cases
|
||||
// 1. free form with no validation that is not allOf included in any composed schemas
|
||||
// 2. free form with validation
|
||||
// 3. free form that is allOf included in any composed schemas
|
||||
// this use case arises when using interface schemas
|
||||
// generators may choose to make models for use case 2 + 3
|
||||
Schema refSchema = new Schema();
|
||||
refSchema.set$ref("#/components/schemas/" + name);
|
||||
Schema unaliasedSchema = config.unaliasSchema(refSchema);
|
||||
if (unaliasedSchema.get$ref() == null) {
|
||||
if (schema.getExtensions() != null && Boolean.TRUE.equals(schema.getExtensions().get("x-internal"))) {
|
||||
LOGGER.info("Model {} not generated since x-internal is set to true", name);
|
||||
continue;
|
||||
} else if (ModelUtils.isFreeFormObject(schema)) { // check to see if it's a free-form object
|
||||
if (!ModelUtils.shouldGenerateFreeFormObjectModel(name, config)) {
|
||||
LOGGER.info("Model {} not generated since it's a free-form object", name);
|
||||
continue;
|
||||
}
|
||||
@@ -949,7 +943,7 @@ public class DefaultGenerator implements Generator {
|
||||
LOGGER.info("Writing file " + ignoreFileNameTarget + " (which is always overwritten when the option `openapiGeneratorIgnoreFile` is enabled.)");
|
||||
new File(config.outputFolder()).mkdirs();
|
||||
if (!ignoreFile.createNewFile()) {
|
||||
throw new RuntimeException("Failed to create the file .openapi-generator-ignore: " + ignoreFileNameTarget);
|
||||
// file may already exist, do nothing
|
||||
}
|
||||
|
||||
String header = String.join("\n",
|
||||
|
||||
@@ -329,6 +329,8 @@ public interface IJsonSchemaValidationProperties {
|
||||
setIsFreeFormObject(true);
|
||||
// TODO: remove below later after updating generators to properly use isFreeFormObject
|
||||
setIsMap(true);
|
||||
} else if (ModelUtils.isMapSchema(p)) {
|
||||
setIsMap(true);
|
||||
} else if (ModelUtils.isTypeObjectSchema(p)) {
|
||||
setIsMap(true);
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ public class InlineModelResolver {
|
||||
|
||||
for (Map.Entry<String, PathItem> pathsEntry : paths.entrySet()) {
|
||||
PathItem path = pathsEntry.getValue();
|
||||
Map<HttpMethod, Operation> operationsMap = new LinkedHashMap<>(path.readOperationsMap());
|
||||
List<Map.Entry<HttpMethod, Operation>> toFlatten = new ArrayList<>(path.readOperationsMap().entrySet());
|
||||
|
||||
// use path name (e.g. /foo/bar) and HTTP verb to come up with a name
|
||||
// in case operationId is not defined later in other methods
|
||||
@@ -135,13 +135,13 @@ public class InlineModelResolver {
|
||||
Callback callback = callbackEntry.getValue();
|
||||
for (Map.Entry<String, PathItem> pathItemEntry : callback.entrySet()) {
|
||||
PathItem pathItem = pathItemEntry.getValue();
|
||||
operationsMap.putAll(pathItem.readOperationsMap());
|
||||
toFlatten.addAll(pathItem.readOperationsMap().entrySet());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (Map.Entry<HttpMethod, Operation> operationEntry : operationsMap.entrySet()) {
|
||||
for (Map.Entry<HttpMethod, Operation> operationEntry : toFlatten) {
|
||||
Operation operation = operationEntry.getValue();
|
||||
String inlineSchemaName = this.getInlineSchemaName(operationEntry.getKey(), pathname);
|
||||
flattenRequestBody(inlineSchemaName, operation);
|
||||
@@ -851,13 +851,21 @@ public class InlineModelResolver {
|
||||
} else {
|
||||
LOGGER.debug("Schema not yet handled in model resolver: {}", inner);
|
||||
}
|
||||
} else if (ModelUtils.isComposedSchema(property)) { // oneOf, anyOf, etc
|
||||
String propertyModelName = resolveModelName(property.getTitle(), path + "_" + key);
|
||||
gatherInlineModels(property, propertyModelName);
|
||||
propertyModelName = addSchemas(propertyModelName, property);
|
||||
Schema schema = new Schema().$ref(propertyModelName);
|
||||
schema.setRequired(property.getRequired());
|
||||
propsToUpdate.put(key, schema);
|
||||
} else if (ModelUtils.isComposedSchema(property)) { // oneOf, anyOf, allOf etc
|
||||
if (property.getAllOf() != null && property.getAllOf().size() == 1 // allOf with a single item
|
||||
&& (property.getOneOf() == null || property.getOneOf().isEmpty()) // not oneOf
|
||||
&& (property.getAnyOf() == null || property.getAnyOf().isEmpty()) // not anyOf
|
||||
&& (property.getProperties() == null || property.getProperties().isEmpty())) { // no property
|
||||
// don't do anything if it's allOf with a single item
|
||||
LOGGER.debug("allOf with a single item (which can be handled by default codegen) skipped by inline model resolver: {}", property);
|
||||
} else {
|
||||
String propertyModelName = resolveModelName(property.getTitle(), path + "_" + key);
|
||||
gatherInlineModels(property, propertyModelName);
|
||||
propertyModelName = addSchemas(propertyModelName, property);
|
||||
Schema schema = new Schema().$ref(propertyModelName);
|
||||
schema.setRequired(property.getRequired());
|
||||
propsToUpdate.put(key, schema);
|
||||
}
|
||||
} else {
|
||||
LOGGER.debug("Schema not yet handled in model resolver: {}", property);
|
||||
}
|
||||
|
||||
@@ -743,6 +743,16 @@ public class OpenAPINormalizer {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (schema.getTypes() != null && !schema.getTypes().isEmpty()) {
|
||||
// 3.1 spec
|
||||
if (schema.getTypes().size() ==1) { // 1 type only
|
||||
String type = (String) schema.getTypes().iterator().next();
|
||||
return type == null || "null".equals(type);
|
||||
} else { // more than 1 type so must not be just null
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if ((schema.getType() == null || schema.getType().equals("null")) && schema.get$ref() == null) {
|
||||
return true;
|
||||
}
|
||||
@@ -933,6 +943,11 @@ public class OpenAPINormalizer {
|
||||
return new Schema();
|
||||
}
|
||||
|
||||
// return schema if nothing in 3.1 spec types to normalize
|
||||
if (schema.getTypes() == null) {
|
||||
return schema;
|
||||
}
|
||||
|
||||
// process null
|
||||
if (schema.getTypes().contains("null")) {
|
||||
schema.setNullable(true);
|
||||
|
||||
@@ -27,6 +27,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
public class ExampleGenerator {
|
||||
@@ -36,6 +37,8 @@ public class ExampleGenerator {
|
||||
private static final String MIME_TYPE_JSON = "application/json";
|
||||
private static final String MIME_TYPE_XML = "application/xml";
|
||||
|
||||
protected final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd", Locale.ROOT);
|
||||
|
||||
private static final String EXAMPLE = "example";
|
||||
private static final String CONTENT_TYPE = "contentType";
|
||||
private static final String GENERATED_CONTENT_TYPE = "generatedContentType";
|
||||
@@ -54,6 +57,7 @@ public class ExampleGenerator {
|
||||
this.openAPI = openAPI;
|
||||
// use a fixed seed to make the "random" numbers reproducible.
|
||||
this.random = new Random("ExampleGenerator".hashCode());
|
||||
DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
}
|
||||
|
||||
public List<Map<String, String>> generateFromResponseSchema(String statusCode, Schema responseSchema, Set<String> producesInfo) {
|
||||
@@ -231,6 +235,11 @@ public class ExampleGenerator {
|
||||
LOGGER.debug("Resolving example for property {}...", property);
|
||||
if (property.getExample() != null) {
|
||||
LOGGER.debug("Example set in openapi spec, returning example: '{}'", property.getExample().toString());
|
||||
// When a property is of type Date, we want to ensure that we're returning a formatted Date.
|
||||
// And not returning the Date object directly.
|
||||
if (property.getExample() instanceof Date) {
|
||||
return DATE_FORMAT.format(property.getExample());
|
||||
}
|
||||
return property.getExample();
|
||||
} else if (ModelUtils.isBooleanSchema(property)) {
|
||||
Object defaultValue = property.getDefault();
|
||||
@@ -351,15 +360,57 @@ public class ExampleGenerator {
|
||||
return schema.getExample();
|
||||
} else if (schema.getProperties() != null) {
|
||||
LOGGER.debug("Creating example from model values");
|
||||
for (Object propertyName : schema.getProperties().keySet()) {
|
||||
Schema property = (Schema) schema.getProperties().get(propertyName.toString());
|
||||
values.put(propertyName.toString(), resolvePropertyToExample(propertyName.toString(), mediaType, property, processedModels));
|
||||
traverseSchemaProperties(mediaType, schema, processedModels, values);
|
||||
schema.setExample(values);
|
||||
return schema.getExample();
|
||||
} else if (ModelUtils.isAllOf(schema) || ModelUtils.isAllOfWithProperties(schema)) {
|
||||
LOGGER.debug("Resolving allOf model '{}' to example", name);
|
||||
List<Schema> interfaces = schema.getAllOf();
|
||||
for (Schema composed : interfaces) {
|
||||
traverseSchemaProperties(mediaType, composed, processedModels, values);
|
||||
if (composed.get$ref() != null) {
|
||||
String ref = ModelUtils.getSimpleRef(composed.get$ref());
|
||||
Schema resolved = ModelUtils.getSchema(openAPI, ref);
|
||||
if (resolved != null) {
|
||||
traverseSchemaProperties(mediaType, resolved, processedModels, values);
|
||||
}
|
||||
}
|
||||
}
|
||||
schema.setExample(values);
|
||||
return schema.getExample();
|
||||
} else if (ModelUtils.isAnyOf(schema) || ModelUtils.isOneOf(schema)) {
|
||||
LOGGER.debug("Resolving anyOf/oneOf model '{}' using the first schema to example", name);
|
||||
Optional<Schema> found = ModelUtils.getInterfaces(schema)
|
||||
.stream()
|
||||
.filter(this::hasValidRef)
|
||||
.findFirst();
|
||||
|
||||
if (found.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return resolvePropertyToExample(name, mediaType, found.get(), processedModels);
|
||||
} else {
|
||||
// TODO log an error message as the model does not have any properties
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void traverseSchemaProperties(String mediaType, Schema schema, Set<String> processedModels, Map<String, Object> values) {
|
||||
if (schema.getProperties() != null) {
|
||||
for (Object propertyName : schema.getProperties().keySet()) {
|
||||
Schema property = (Schema) schema.getProperties().get(propertyName.toString());
|
||||
values.put(propertyName.toString(), resolvePropertyToExample(propertyName.toString(), mediaType, property, processedModels));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean hasValidRef(Schema schema) {
|
||||
if (schema.get$ref() != null) {
|
||||
String ref = ModelUtils.getSimpleRef(schema.get$ref());
|
||||
Schema resolved = ModelUtils.getSchema(openAPI, ref);
|
||||
return resolved != null;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
||||
protected boolean optionalProjectFileFlag = true;
|
||||
protected boolean optionalMethodArgumentFlag = true;
|
||||
protected boolean useDateTimeOffsetFlag = false;
|
||||
protected boolean useDateTimeForDateFlag = false;
|
||||
protected boolean useCollection = false;
|
||||
protected boolean returnICollection = false;
|
||||
protected boolean netCoreProjectFileFlag = false;
|
||||
@@ -186,6 +187,8 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
||||
"DateTime",
|
||||
"DateTimeOffset?",
|
||||
"DateTimeOffset",
|
||||
"DateOnly?",
|
||||
"DateOnly",
|
||||
"Boolean",
|
||||
"Double",
|
||||
"Decimal",
|
||||
@@ -234,6 +237,11 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
||||
this.setTypeMapping();
|
||||
}
|
||||
|
||||
public void useDateTimeForDate(boolean flag) {
|
||||
this.useDateTimeForDateFlag = flag;
|
||||
this.setTypeMapping();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addParentFromContainer(CodegenModel model, Schema schema) {
|
||||
// we do not want to inherit simply because additionalProperties is true
|
||||
@@ -354,6 +362,13 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
||||
additionalProperties.put(CodegenConstants.USE_DATETIME_OFFSET, useDateTimeOffsetFlag);
|
||||
}
|
||||
|
||||
// {{useDateTimeForDate}}
|
||||
if (additionalProperties.containsKey(CodegenConstants.USE_DATETIME_FOR_DATE)) {
|
||||
useDateTimeForDate(convertPropertyToBooleanAndWriteBack(CodegenConstants.USE_DATETIME_FOR_DATE));
|
||||
} else {
|
||||
additionalProperties.put(CodegenConstants.USE_DATETIME_FOR_DATE, useDateTimeForDateFlag);
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(CodegenConstants.USE_COLLECTION)) {
|
||||
setUseCollection(convertPropertyToBooleanAndWriteBack(CodegenConstants.USE_COLLECTION));
|
||||
} else {
|
||||
@@ -1756,6 +1771,12 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
||||
return (this.getValueTypes().contains(var.dataType) || var.isEnum);
|
||||
}
|
||||
|
||||
protected boolean useNet60OrLater() { return false; }
|
||||
|
||||
protected boolean useDateOnly() {
|
||||
return useNet60OrLater() && !useDateTimeForDateFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setParameterExampleValue(CodegenParameter p) {
|
||||
String example;
|
||||
@@ -1820,16 +1841,18 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
||||
}
|
||||
example = "System.Text.Encoding.ASCII.GetBytes(\"" + escapeText(example) + "\")";
|
||||
} else if (p.isDate) {
|
||||
String dateType = typeMapping.get("date");
|
||||
if (example == null) {
|
||||
example = "DateTime.Parse(\"2013-10-20\")";
|
||||
example = dateType + ".Parse(\"2013-10-20\")";
|
||||
} else {
|
||||
example = "DateTime.Parse(\"" + example + "\")";
|
||||
example = dateType + ".Parse(\"" + example + "\")";
|
||||
}
|
||||
} else if (p.isDateTime) {
|
||||
String dateType = typeMapping.get("DateTime");
|
||||
if (example == null) {
|
||||
example = "DateTime.Parse(\"2013-10-20T19:20:30+01:00\")";
|
||||
example = dateType + ".Parse(\"2013-10-20T19:20:30+01:00\")";
|
||||
} else {
|
||||
example = "DateTime.Parse(\"" + example + "\")";
|
||||
example = dateType + ".Parse(\"" + example + "\")";
|
||||
}
|
||||
} else if (p.isDecimal) {
|
||||
if (example == null) {
|
||||
@@ -1993,7 +2016,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
||||
}
|
||||
|
||||
protected Set<String> getValueTypes() {
|
||||
return new HashSet<>(Arrays.asList("decimal", "bool", "int", "uint", "long", "ulong", "float", "double", "DateTime", "DateTimeOffset", "Guid"));
|
||||
return new HashSet<>(Arrays.asList("decimal", "bool", "int", "uint", "long", "ulong", "float", "double", "DateTime", "DateOnly", "DateTimeOffset", "Guid"));
|
||||
}
|
||||
|
||||
protected void setTypeMapping() {
|
||||
@@ -2012,7 +2035,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
||||
typeMapping.put("decimal", "decimal");
|
||||
typeMapping.put("BigDecimal", "decimal");
|
||||
typeMapping.put("DateTime", this.useDateTimeOffsetFlag ? "DateTimeOffset" : "DateTime");
|
||||
typeMapping.put("date", "DateTime");
|
||||
typeMapping.put("date", this.useDateOnly() ? "DateOnly" : "DateTime");
|
||||
typeMapping.put("file", "System.IO.Stream");
|
||||
typeMapping.put("array", "List");
|
||||
typeMapping.put("list", "List");
|
||||
|
||||
@@ -1736,7 +1736,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
String contentType = consumes.isEmpty() ? defaultContentType : consumes.get(0);
|
||||
operation.addExtension("x-content-type", contentType);
|
||||
}
|
||||
String accepts = getAccept(openAPI, operation);
|
||||
String accepts = getAccepts(openAPI, operation);
|
||||
operation.addExtension("x-accepts", accepts);
|
||||
}
|
||||
}
|
||||
@@ -1787,32 +1787,19 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
}
|
||||
}
|
||||
|
||||
private static String getAccept(OpenAPI openAPI, Operation operation) {
|
||||
String accepts = null;
|
||||
String defaultContentType = "application/json";
|
||||
Set<String> producesInfo = getProducesInfo(openAPI, operation);
|
||||
private static String getAccepts(OpenAPI openAPIArg, Operation operation) {
|
||||
final Set<String> producesInfo = getProducesInfo(openAPIArg, operation);
|
||||
if (producesInfo != null && !producesInfo.isEmpty()) {
|
||||
ArrayList<String> produces = new ArrayList<>(producesInfo);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String produce : produces) {
|
||||
if (defaultContentType.equalsIgnoreCase(produce)) {
|
||||
accepts = defaultContentType;
|
||||
break;
|
||||
} else {
|
||||
if (sb.length() > 0) {
|
||||
sb.append(",");
|
||||
}
|
||||
sb.append(produce);
|
||||
for (String produce : producesInfo) {
|
||||
if (sb.length() > 0) {
|
||||
sb.append(",");
|
||||
}
|
||||
sb.append(produce);
|
||||
}
|
||||
if (accepts == null) {
|
||||
accepts = sb.toString();
|
||||
}
|
||||
} else {
|
||||
accepts = defaultContentType;
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
return accepts;
|
||||
return "application/json"; // default media type
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1143,4 +1143,44 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
||||
return super.addMustacheLambdas()
|
||||
.put("escapeDollar", new EscapeChar("(?<!\\\\)\\$", "\\\\\\$"));
|
||||
}
|
||||
|
||||
protected interface DataTypeAssigner {
|
||||
void setReturnType(String returnType);
|
||||
|
||||
void setReturnContainer(String returnContainer);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param returnType The return type that needs to be converted
|
||||
* @param dataTypeAssigner An object that will assign the data to the respective fields in the model.
|
||||
*/
|
||||
protected void doDataTypeAssignment(final String returnType, DataTypeAssigner dataTypeAssigner) {
|
||||
if (returnType == null) {
|
||||
dataTypeAssigner.setReturnType("Unit");
|
||||
} else if (returnType.startsWith("kotlin.collections.List")) {
|
||||
int end = returnType.lastIndexOf(">");
|
||||
if (end > 0) {
|
||||
dataTypeAssigner.setReturnType(returnType.substring("kotlin.collections.List<".length(), end).trim());
|
||||
dataTypeAssigner.setReturnContainer("List");
|
||||
}
|
||||
} else if (returnType.startsWith("kotlin.collections.MutableList")) {
|
||||
int end = returnType.lastIndexOf(">");
|
||||
if (end > 0) {
|
||||
dataTypeAssigner.setReturnType(returnType.substring("kotlin.collections.MutableList<".length(), end).trim());
|
||||
dataTypeAssigner.setReturnContainer("List");
|
||||
}
|
||||
} else if (returnType.startsWith("kotlin.collections.Map")) {
|
||||
int end = returnType.lastIndexOf(">");
|
||||
if (end > 0) {
|
||||
dataTypeAssigner.setReturnType(returnType.substring("kotlin.collections.Map<".length(), end).split(",")[1].trim());
|
||||
dataTypeAssigner.setReturnContainer("Map");
|
||||
}
|
||||
} else if (returnType.startsWith("kotlin.collections.MutableMap")) {
|
||||
int end = returnType.lastIndexOf(">");
|
||||
if (end > 0) {
|
||||
dataTypeAssigner.setReturnType(returnType.substring("kotlin.collections.MutableMap<".length(), end).split(",")[1].trim());
|
||||
dataTypeAssigner.setReturnContainer("Map");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user