forked from loafle/openapi-generator-original
Compare commits
104 Commits
BryanAldri
...
fix-circle
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be28e0c829 | ||
|
|
286ea0c593 | ||
|
|
a1d733694e | ||
|
|
ce81a8dd3a | ||
|
|
3bdf3a5756 | ||
|
|
531f39f2b5 | ||
|
|
c75fbb312e | ||
|
|
1fa07bf46c | ||
|
|
a7240eeefe | ||
|
|
fa3e38a4b7 | ||
|
|
98ccf95e43 | ||
|
|
9e66c4f516 | ||
|
|
ce56a83ae4 | ||
|
|
4c73faf737 | ||
|
|
dcf472a034 | ||
|
|
5785743695 | ||
|
|
760d5e8168 | ||
|
|
4259e92776 | ||
|
|
61bdc6bf84 | ||
|
|
78ea8afa84 | ||
|
|
09530b4781 | ||
|
|
479cd522e0 | ||
|
|
1bc5eae034 | ||
|
|
066a840dd8 | ||
|
|
121c82f8fe | ||
|
|
a6cfef53fe | ||
|
|
358e8af2bf | ||
|
|
522b134cd9 | ||
|
|
eb47b9d836 | ||
|
|
29f7c2ea0b | ||
|
|
d30220b8df | ||
|
|
9fcbdb95d9 | ||
|
|
3d2ff493e6 | ||
|
|
40d4703950 | ||
|
|
536519c0ec | ||
|
|
7a23ac7615 | ||
|
|
3d65786117 | ||
|
|
eb96380928 | ||
|
|
00c76de2a9 | ||
|
|
cba756ffa6 | ||
|
|
4b5dfc430e | ||
|
|
e154903743 | ||
|
|
85c81bee5b | ||
|
|
43f59bab81 | ||
|
|
46260ee6f9 | ||
|
|
8f4cfa3955 | ||
|
|
93158ea4dc | ||
|
|
25283d46a7 | ||
|
|
c5ac7d485f | ||
|
|
8fa8530cd0 | ||
|
|
bd8cd8bf9f | ||
|
|
de41fd27d1 | ||
|
|
45aeae3d43 | ||
|
|
bf9c9a59d2 | ||
|
|
6d2f2c9ced | ||
|
|
812d89cbe5 | ||
|
|
357a708ebb | ||
|
|
ff0fe26890 | ||
|
|
ab8d359dc3 | ||
|
|
5ba608ff8a | ||
|
|
401c8d0feb | ||
|
|
4ea7f6088e | ||
|
|
77e9c1f03a | ||
|
|
8790f7c8b1 | ||
|
|
eceef28850 | ||
|
|
806b99e43a | ||
|
|
6180fea305 | ||
|
|
b143313cf7 | ||
|
|
7f0efe74a7 | ||
|
|
74044c3427 | ||
|
|
289425b8ee | ||
|
|
9fec13af85 | ||
|
|
b01c8be47f | ||
|
|
e87c4ea6c0 | ||
|
|
47891245e9 | ||
|
|
ea2ba0c349 | ||
|
|
9b3484cc99 | ||
|
|
cdfab4eee3 | ||
|
|
d87a70dd93 | ||
|
|
4e5a828c12 | ||
|
|
07d19baf89 | ||
|
|
cc40f40ead | ||
|
|
b16144094d | ||
|
|
f766f445da | ||
|
|
3e6f8753e9 | ||
|
|
d55a41e985 | ||
|
|
1a3d7d4ae6 | ||
|
|
2f03c70403 | ||
|
|
3a09ebbb7b | ||
|
|
8aa8e3892d | ||
|
|
b7c7ed087f | ||
|
|
24ddb33d0b | ||
|
|
b218e238f4 | ||
|
|
e7b5f348e7 | ||
|
|
f4271faf3b | ||
|
|
0a7e784c8c | ||
|
|
a447b5988d | ||
|
|
dc175c5335 | ||
|
|
e025a7ddfa | ||
|
|
35df38de38 | ||
|
|
f62aa5bd95 | ||
|
|
3a37ba33a7 | ||
|
|
d29196a1f0 | ||
|
|
474307675b |
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -10,7 +10,7 @@ assignees: ''
|
||||
#### Bug Report Checklist
|
||||
|
||||
- [ ] Have you provided a full/minimal spec to reproduce the issue?
|
||||
- [ ] Have you validated the input using an OpenAPI validator ([example](https://apidevtools.org/swagger-parser/online/))?
|
||||
- [ ] Have you validated the input using an OpenAPI validator ([example](https://apitools.dev/swagger-parser/online/))?
|
||||
- [ ] Have you [tested with the latest master](https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-to-test-with-the-latest-master-of-openapi-generator) to confirm the issue still exists?
|
||||
- [ ] Have you searched for related issues/PRs?
|
||||
- [ ] What's the actual output vs expected output?
|
||||
|
||||
4
.github/workflows/linux.yaml
vendored
4
.github/workflows/linux.yaml
vendored
@@ -45,7 +45,7 @@ jobs:
|
||||
${{ runner.os }}-gradle-
|
||||
|
||||
- name: Setup Maven
|
||||
uses: s4u/setup-maven-action@v1.16.0
|
||||
uses: s4u/setup-maven-action@v1.18.0
|
||||
with:
|
||||
java-version: ${{ matrix.java }}
|
||||
maven-version: 3.8.8
|
||||
@@ -87,7 +87,7 @@ jobs:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Maven
|
||||
uses: s4u/setup-maven-action@v1.16.0
|
||||
uses: s4u/setup-maven-action@v1.18.0
|
||||
with:
|
||||
java-version: 11
|
||||
maven-version: 3.8.8
|
||||
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
- samples/server/petstore/aspnet/fastendpoints-useValidators
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-dotnet@v4.1.0
|
||||
- uses: actions/setup-dotnet@v4.2.0
|
||||
with:
|
||||
dotnet-version: '8.0.x'
|
||||
- name: Build
|
||||
|
||||
@@ -16,7 +16,7 @@ on:
|
||||
jobs:
|
||||
build:
|
||||
name: Build .Net projects
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
# - samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-dotnet@v4.1.0
|
||||
- uses: actions/setup-dotnet@v4.2.0
|
||||
with:
|
||||
dotnet-version: 3.1.*
|
||||
- name: Build
|
||||
|
||||
48
.github/workflows/samples-dotnet.yaml
vendored
48
.github/workflows/samples-dotnet.yaml
vendored
@@ -1,48 +0,0 @@
|
||||
name: Samples C# .Net 8 Clients
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- samples/client/petstore/csharp/generichost/latest/**
|
||||
- samples/client/petstore/csharp/generichost/net8/**
|
||||
- samples/client/petstore/csharp/httpclient/net8/**
|
||||
- samples/client/petstore/csharp/restsharp/net8/**
|
||||
- samples/client/petstore/csharp/unityWebRequest/net8/**
|
||||
pull_request:
|
||||
paths:
|
||||
- samples/client/petstore/csharp/generichost/latest/**
|
||||
- samples/client/petstore/csharp/generichost/net8/**
|
||||
- samples/client/petstore/csharp/httpclient/net8/**
|
||||
- samples/client/petstore/csharp/restsharp/net8/**
|
||||
- samples/client/petstore/csharp/unityWebRequest/net8/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build .Net projects
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
- samples/client/petstore/csharp/generichost/latest/Tags
|
||||
- samples/client/petstore/csharp/generichost/net8/AllOf
|
||||
- samples/client/petstore/csharp/generichost/net8/AnyOf
|
||||
- samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare
|
||||
- samples/client/petstore/csharp/generichost/net8/FormModels
|
||||
- samples/client/petstore/csharp/generichost/net8/ManualPetstoreTests
|
||||
- samples/client/petstore/csharp/generichost/net8/ManualSourceGenerationTests
|
||||
- samples/client/petstore/csharp/generichost/net8/NullReferenceTypes
|
||||
- samples/client/petstore/csharp/generichost/net8/OneOf
|
||||
- samples/client/petstore/csharp/generichost/net8/Petstore
|
||||
- samples/client/petstore/csharp/generichost/net8/SourceGeneration
|
||||
- samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-dotnet@v4.1.0
|
||||
with:
|
||||
dotnet-version: '8.0.x'
|
||||
- name: Build
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: dotnet build Org.OpenAPITools.sln
|
||||
- name: Test
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: dotnet test Org.OpenAPITools.sln
|
||||
@@ -1,33 +0,0 @@
|
||||
name: Samples C# .Net 6 Client Echo API
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- samples/client/echo_api/csharp-restsharp/**
|
||||
pull_request:
|
||||
paths:
|
||||
- samples/client/echo_api/csharp-restsharp/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build .Net clients
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
# clients
|
||||
- samples/client/echo_api/csharp-restsharp/
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-dotnet@v4.1.0
|
||||
with:
|
||||
dotnet-version: '6.0.x'
|
||||
- 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 &)
|
||||
- name: Build
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: |
|
||||
dotnet build Org.OpenAPITools.sln
|
||||
dotnet test Org.OpenAPITools.sln
|
||||
26
.github/workflows/samples-dotnet6-client.yaml
vendored
26
.github/workflows/samples-dotnet6-client.yaml
vendored
@@ -1,26 +0,0 @@
|
||||
name: Samples C# .Net 6 Client
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- samples/client/petstore/csharp/restsharp/net6/**
|
||||
pull_request:
|
||||
paths:
|
||||
- samples/client/petstore/csharp/restsharp/net6/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build .Net clients
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
- samples/client/petstore/csharp/restsharp/net6/ParameterMappings/
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-dotnet@v4.1.0
|
||||
with:
|
||||
dotnet-version: '6.0.x'
|
||||
- name: Build
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: dotnet build Org.OpenAPITools.sln
|
||||
@@ -25,7 +25,7 @@ jobs:
|
||||
- samples/server/petstore/aspnetcore-6.0-useSwashBuckle
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-dotnet@v4.1.0
|
||||
- uses: actions/setup-dotnet@v4.2.0
|
||||
with:
|
||||
dotnet-version: '6.0.x'
|
||||
- name: Build
|
||||
|
||||
33
.github/workflows/samples-dotnet8-client-echo-api.yaml
vendored
Normal file
33
.github/workflows/samples-dotnet8-client-echo-api.yaml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
name: Samples C# .Net 8 Client Echo API
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- samples/client/echo_api/csharp/restsharp/net8/**
|
||||
pull_request:
|
||||
paths:
|
||||
- samples/client/echo_api/csharp/restsharp/net8/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build .Net clients
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
# clients
|
||||
- samples/client/echo_api/csharp/restsharp/net8/EchoApi
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-dotnet@v4.2.0
|
||||
with:
|
||||
dotnet-version: '8.0.x'
|
||||
- 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 &)
|
||||
- name: Build
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: |
|
||||
dotnet build Org.OpenAPITools.sln
|
||||
dotnet test Org.OpenAPITools.sln
|
||||
26
.github/workflows/samples-dotnet8-client.yaml
vendored
Normal file
26
.github/workflows/samples-dotnet8-client.yaml
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
name: Samples C# .Net 8 Client
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- samples/client/petstore/csharp/restsharp/net8/**
|
||||
pull_request:
|
||||
paths:
|
||||
- samples/client/petstore/csharp/restsharp/net8/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build .Net clients
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
- samples/client/petstore/csharp/restsharp/net8/ParameterMappings/
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-dotnet@v4.2.0
|
||||
with:
|
||||
dotnet-version: '8.0.x'
|
||||
- name: Build
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: dotnet build Org.OpenAPITools.sln
|
||||
@@ -23,9 +23,10 @@ jobs:
|
||||
- samples/server/petstore/aspnetcore-8.0-pocoModels
|
||||
- samples/server/petstore/aspnetcore-8.0-project4Models
|
||||
- samples/server/petstore/aspnetcore-8.0-useSwashBuckle
|
||||
- samples/server/petstore/aspnetcore-8.0-use-centralized-package-version-management
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-dotnet@v4.1.0
|
||||
- uses: actions/setup-dotnet@v4.2.0
|
||||
with:
|
||||
dotnet-version: '8.0.x'
|
||||
- name: Build
|
||||
|
||||
45
.github/workflows/samples-dotnet8.yaml
vendored
Normal file
45
.github/workflows/samples-dotnet8.yaml
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
name: Samples C# .Net 8 Clients
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- samples/client/petstore/csharp/generichost/net8/**
|
||||
- samples/client/petstore/csharp/httpclient/net8/**
|
||||
- samples/client/petstore/csharp/restsharp/net8/**
|
||||
- samples/client/petstore/csharp/unityWebRequest/net8/**
|
||||
pull_request:
|
||||
paths:
|
||||
- samples/client/petstore/csharp/generichost/net8/**
|
||||
- samples/client/petstore/csharp/httpclient/net8/**
|
||||
- samples/client/petstore/csharp/restsharp/net8/**
|
||||
- samples/client/petstore/csharp/unityWebRequest/net8/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build .Net projects
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
- samples/client/petstore/csharp/generichost/net8/AllOf
|
||||
- samples/client/petstore/csharp/generichost/net8/AnyOf
|
||||
- samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare
|
||||
- samples/client/petstore/csharp/generichost/net8/FormModels
|
||||
- samples/client/petstore/csharp/generichost/net8/ManualPetstoreTests
|
||||
- samples/client/petstore/csharp/generichost/net8/ManualSourceGenerationTests
|
||||
- samples/client/petstore/csharp/generichost/net8/NullReferenceTypes
|
||||
- samples/client/petstore/csharp/generichost/net8/OneOf
|
||||
- samples/client/petstore/csharp/generichost/net8/Petstore
|
||||
- samples/client/petstore/csharp/generichost/net8/SourceGeneration
|
||||
- samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-dotnet@v4.2.0
|
||||
with:
|
||||
dotnet-version: '8.0.x'
|
||||
- name: Build
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: dotnet build Org.OpenAPITools.sln
|
||||
- name: Test
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: dotnet test Org.OpenAPITools.sln
|
||||
54
.github/workflows/samples-dotnet9.yaml
vendored
Normal file
54
.github/workflows/samples-dotnet9.yaml
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
name: Samples C# .Net 9 Clients
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- samples/client/petstore/csharp/generichost/latest/**
|
||||
- samples/client/petstore/csharp/generichost/net9/**
|
||||
- samples/client/petstore/csharp/httpclient/net9/**
|
||||
- samples/client/petstore/csharp/restsharp/net9/**
|
||||
- samples/client/petstore/csharp/unityWebRequest/net9/**
|
||||
pull_request:
|
||||
paths:
|
||||
- samples/client/petstore/csharp/generichost/latest/**
|
||||
- samples/client/petstore/csharp/generichost/net9/**
|
||||
- samples/client/petstore/csharp/httpclient/net9/**
|
||||
- samples/client/petstore/csharp/restsharp/net9/**
|
||||
- samples/client/petstore/csharp/unityWebRequest/net9/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build .Net projects
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
- samples/client/petstore/csharp/generichost/latest/Tags
|
||||
- samples/client/petstore/csharp/generichost/net9/AllOf
|
||||
- samples/client/petstore/csharp/generichost/net9/AnyOf
|
||||
- samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare
|
||||
- samples/client/petstore/csharp/generichost/net9/FormModels
|
||||
# - samples/client/petstore/csharp/generichost/net9/ManualPetstoreTests
|
||||
# - samples/client/petstore/csharp/generichost/net9/ManualSourceGenerationTests
|
||||
- samples/client/petstore/csharp/generichost/net9/NullReferenceTypes
|
||||
- samples/client/petstore/csharp/generichost/net9/OneOf
|
||||
- samples/client/petstore/csharp/generichost/net9/Petstore
|
||||
- samples/client/petstore/csharp/generichost/net9/SourceGeneration
|
||||
- samples/client/petstore/csharp/generichost/net9/UseDateTimeForDate
|
||||
# restsharp
|
||||
- samples/client/petstore/csharp/restsharp/net9/EnumMappings
|
||||
# httpclient
|
||||
- samples/client/petstore/csharp/httpclient/net9/Petstore
|
||||
# unity
|
||||
#- samples/client/petstore/csharp/unityWebRequest/net9/Petstore
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-dotnet@v4.2.0
|
||||
with:
|
||||
dotnet-version: '9.0.101'
|
||||
- name: Build
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: dotnet build Org.OpenAPITools.sln
|
||||
- name: Test
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: dotnet test Org.OpenAPITools.sln
|
||||
@@ -14,6 +14,7 @@ on:
|
||||
- samples/client/others/java/okhttp-gson-oneOf-array/**
|
||||
- samples/client/others/java/resttemplate-useAbstractionForFiles/**
|
||||
- samples/client/others/java/webclient-useAbstractionForFiles/**
|
||||
- samples/client/petstore/java/webclient-useSingleRequestParameter/**
|
||||
- samples/client/others/java/jersey2-oneOf-duplicates/**
|
||||
- samples/client/others/java/jersey2-oneOf-Mixed/**
|
||||
- samples/client/others/java/resttemplate-list-schema-validation/**
|
||||
@@ -31,6 +32,7 @@ on:
|
||||
- samples/client/others/java/okhttp-gson-oneOf-array/**
|
||||
- samples/client/others/java/resttemplate-useAbstractionForFiles/**
|
||||
- samples/client/others/java/webclient-useAbstractionForFiles/**
|
||||
- samples/client/petstore/java/webclient-useSingleRequestParameter/**
|
||||
- samples/client/others/java/jersey2-oneOf-duplicates/**
|
||||
- samples/client/others/java/jersey2-oneOf-Mixed/**
|
||||
- samples/client/others/java/resttemplate-list-schema-validation/**
|
||||
@@ -57,6 +59,7 @@ jobs:
|
||||
- samples/client/petstore/java/webclient
|
||||
- samples/client/petstore/java/webclient-nullable-arrays
|
||||
- samples/client/petstore/java/webclient-swagger2
|
||||
- samples/client/petstore/java/webclient-useSingleRequestParameter
|
||||
- samples/client/petstore/java/vertx
|
||||
- samples/client/petstore/java/jersey2-java8-localdatetime
|
||||
- samples/client/petstore/java/google-api-client
|
||||
|
||||
@@ -5,12 +5,14 @@ on:
|
||||
paths:
|
||||
- samples/client/petstore/java/resttemplate-jakarta/**
|
||||
- samples/client/petstore/java/webclient-jakarta/**
|
||||
- samples/client/petstore/java/restclient-*/**
|
||||
- samples/client/petstore/java/restclient-*/**
|
||||
- samples/client/petstore/java/webclient-useSingleRequestParameter/**
|
||||
pull_request:
|
||||
paths:
|
||||
- samples/client/petstore/java/resttemplate-jakarta/**
|
||||
- samples/client/petstore/java/webclient-jakarta/**
|
||||
- samples/client/petstore/java/restclient-*/**
|
||||
- samples/client/petstore/java/webclient-useSingleRequestParameter/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build Java Client JDK17
|
||||
@@ -26,6 +28,7 @@ jobs:
|
||||
- samples/client/petstore/java/restclient-nullable-arrays
|
||||
- samples/client/petstore/java/restclient-swagger2
|
||||
- samples/client/petstore/java/restclient-useSingleRequestParameter
|
||||
- samples/client/petstore/java/webclient-useSingleRequestParameter
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-java@v4
|
||||
|
||||
@@ -19,6 +19,7 @@ jobs:
|
||||
# clients
|
||||
- samples/client/echo_api/kotlin-jvm-spring-3-restclient
|
||||
- samples/client/echo_api/kotlin-model-prefix-type-mappings
|
||||
- samples/client/echo_api/kotlin-jvm-okhttp
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-java@v4
|
||||
|
||||
@@ -41,6 +41,7 @@ jobs:
|
||||
- samples/server/petstore/kotlin-server/javalin
|
||||
- samples/server/petstore/kotlin-server/javalin-6
|
||||
- samples/server/petstore/kotlin-server/ktor
|
||||
- samples/server/petstore/kotlin-server/ktor2
|
||||
# comment out due to gradle build failure
|
||||
# - samples/server/petstore/kotlin-spring-default/
|
||||
steps:
|
||||
|
||||
@@ -23,6 +23,7 @@ jobs:
|
||||
sample:
|
||||
- samples/server/petstore/kotlin-server/javalin-6
|
||||
- samples/server/petstore/kotlin-server/ktor
|
||||
- samples/server/petstore/kotlin-server/ktor2
|
||||
- samples/server/petstore/kotlin-server-required-and-nullable-properties
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
2
.github/workflows/samples-kotlin-server.yaml
vendored
2
.github/workflows/samples-kotlin-server.yaml
vendored
@@ -34,10 +34,12 @@ jobs:
|
||||
- samples/server/petstore/kotlin-springboot-delegate
|
||||
- samples/server/petstore/kotlin-springboot-modelMutable
|
||||
- samples/server/petstore/kotlin-springboot-reactive
|
||||
- samples/server/petstore/kotlin-springboot-reactive-without-flow
|
||||
- samples/server/petstore/kotlin-springboot-source-swagger1
|
||||
- samples/server/petstore/kotlin-springboot-source-swagger2
|
||||
- samples/server/petstore/kotlin-springboot-springfox
|
||||
- samples/server/petstore/kotlin-server/ktor
|
||||
- samples/server/petstore/kotlin-server/ktor2
|
||||
- samples/server/petstore/kotlin-server/jaxrs-spec
|
||||
- samples/server/petstore/kotlin-server/jaxrs-spec-mutiny
|
||||
- samples/server/petstore/kotlin-server-modelMutable
|
||||
|
||||
54
.github/workflows/samples-ruby-petstore.yaml
vendored
Normal file
54
.github/workflows/samples-ruby-petstore.yaml
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
name: Samples Ruby Petstore
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- samples/client/petstore/ruby/**
|
||||
- samples/client/petstore/ruby-faraday/**
|
||||
- samples/client/petstore/ruby-httpx/**
|
||||
- samples/client/petstore/ruby-autoload/**
|
||||
pull_request:
|
||||
paths:
|
||||
- samples/client/petstore/ruby/**
|
||||
- samples/client/petstore/ruby-faraday/**
|
||||
- samples/client/petstore/ruby-httpx/**
|
||||
- samples/client/petstore/ruby-autoload/**
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build Ruby
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
- samples/client/petstore/ruby/
|
||||
- samples/client/petstore/ruby-faraday/
|
||||
- samples/client/petstore/ruby-httpx/
|
||||
- samples/client/petstore/ruby-autoload/
|
||||
services:
|
||||
petstore-api:
|
||||
image: swaggerapi/petstore
|
||||
ports:
|
||||
- 80:8080
|
||||
env:
|
||||
SWAGGER_HOST: http://petstore.swagger.io
|
||||
SWAGGER_BASE_PATH: /v2
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Add hosts to /etc/hosts
|
||||
run: |
|
||||
sudo echo "127.0.0.1 petstore.swagger.io" | sudo tee -a /etc/hosts
|
||||
cat /etc/hosts
|
||||
sleep 30
|
||||
- uses: actions/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 3.0
|
||||
bundler-cache: true
|
||||
- name: Install bundle
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: bundle install
|
||||
- name: Run rspec
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: rspec
|
||||
2
.github/workflows/samples-scala.yaml
vendored
2
.github/workflows/samples-scala.yaml
vendored
@@ -40,6 +40,8 @@ jobs:
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 8
|
||||
- name: Setup sbt launcher
|
||||
uses: sbt/setup-sbt@v1
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
|
||||
2
.github/workflows/windows.yaml
vendored
2
.github/workflows/windows.yaml
vendored
@@ -39,7 +39,7 @@ jobs:
|
||||
${{ runner.os }}-build-${{ env.cache-name }}-
|
||||
${{ runner.os }}-build-
|
||||
- name: Setup Maven
|
||||
uses: s4u/setup-maven-action@v1.16.0
|
||||
uses: s4u/setup-maven-action@v1.18.0
|
||||
with:
|
||||
java-version: ${{ matrix.java }}
|
||||
maven-version: 3.8.8
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -220,6 +220,7 @@ samples/client/petstore/kotlin*/src/main/kotlin/test/
|
||||
samples/client/petstore/kotlin*/build/
|
||||
samples/server/others/kotlin-server/jaxrs-spec/build/
|
||||
samples/client/echo_api/kotlin-jvm-spring-3-restclient/build/
|
||||
samples/client/echo_api/kotlin-jvm-okhttp/build/
|
||||
|
||||
# haskell
|
||||
.stack-work
|
||||
|
||||
@@ -15,12 +15,22 @@ if [ "$NODE_INDEX" = "1" ]; then
|
||||
|
||||
sudo apt-get -y install cpanminus
|
||||
|
||||
# install rust
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
source "$HOME/.cargo/env"
|
||||
|
||||
echo "Testing perl"
|
||||
(cd samples/client/petstore/perl && /bin/bash ./test.bash)
|
||||
|
||||
echo "Testing ruby"
|
||||
(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)
|
||||
(cd samples/client/petstore/ruby-autoload && mvn integration-test)
|
||||
|
||||
echo "Testing rust"
|
||||
(cd samples/server/petstore/rust-axum && mvn integration-test)
|
||||
|
||||
elif [ "$NODE_INDEX" = "2" ]; then
|
||||
echo "Running node $NODE_INDEX to test Go"
|
||||
# install haskell
|
||||
@@ -121,6 +131,7 @@ else
|
||||
(cd samples/client/others/java/okhttp-gson-streaming && mvn integration-test)
|
||||
(cd samples/client/petstore/java/okhttp-gson && mvn integration-test)
|
||||
(cd samples/client/petstore/java/okhttp-gson-3.1 && mvn integration-test)
|
||||
(cd samples/client/petstore/java/okhttp-gson-dynamicOperations && mvn integration-test)
|
||||
(cd samples/client/petstore/java/resteasy && mvn integration-test)
|
||||
(cd samples/client/petstore/java-micronaut-client && mvn integration-test)
|
||||
(cd samples/client/petstore/java/apache-httpclient && mvn integration-test)
|
||||
|
||||
51
README.md
51
README.md
@@ -6,7 +6,7 @@
|
||||
[](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.openapitools%22%20AND%20a%3A%22openapi-generator%22)
|
||||
[](./LICENSE)
|
||||
[](https://opencollective.com/openapi_generator)
|
||||
[](https://join.slack.com/t/openapi-generator/shared_invite/zt-2uoef5v0g-XGwo8~2oJ3EoziDSO1CmdQ)
|
||||
[](https://join.slack.com/t/openapi-generator/shared_invite/zt-2wmkn4s8g-n19PJ99Y6Vei74WMUIehQA)
|
||||
[](https://twitter.com/oas_generator)
|
||||
[](https://gitpod.io/#https://github.com/OpenAPITools/openapi-generator)
|
||||
[](https://conan.io/center/recipes/openapi-generator)
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
<div align="center">
|
||||
|
||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.11.0`):
|
||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.12.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)
|
||||
@@ -106,6 +106,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se
|
||||
- [1.5 - Homebrew](#15---homebrew)
|
||||
- [1.6 - Docker](#16---docker)
|
||||
- [1.7 - NPM](#17---npm)
|
||||
- [1.8 - pip](#18---pip)
|
||||
- [2 - Getting Started](#2---getting-started)
|
||||
- [3 - Usage](#3---usage)
|
||||
- [3.1 - Customization](#31---customization)
|
||||
@@ -129,8 +130,8 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
|
||||
|
||||
| OpenAPI Generator Version | Release Date | Notes |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- |
|
||||
| 7.11.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.11.0-SNAPSHOT/) | 20.12.2024 | Minor release with breaking changes (with fallback) |
|
||||
| [7.10.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.10.0) (latest stable release) | 18.11.2024 | Minor release with breaking changes (with fallback) |
|
||||
| 7.12.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.12.0-SNAPSHOT/) | 17.02.2024 | Minor release with breaking changes (with fallback) |
|
||||
| [7.11.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.11.0) (latest stable release) | 20.01.2024 | 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) |
|
||||
@@ -141,7 +142,7 @@ OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0, 3.1 (beta support)
|
||||
|
||||
For old releases, please refer to the [**Release**](https://github.com/OpenAPITools/openapi-generator/releases) page.
|
||||
|
||||
For decomissioned generators/libraries/frameworks, please refer to [the "Decommission" label](https://github.com/OpenAPITools/openapi-generator/issues?q=label%3ADecommission+is%3Amerged+) in the pull request page.
|
||||
For decommissioned generators/libraries/frameworks, please refer to [the "Decommission" label](https://github.com/OpenAPITools/openapi-generator/issues?q=label%3ADecommission+is%3Amerged+) in the pull request page.
|
||||
|
||||
## [1.2 - Artifacts on Maven Central](#table-of-contents)
|
||||
|
||||
@@ -193,16 +194,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.10.0/openapi-generator-cli-7.10.0.jar`
|
||||
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.11.0/openapi-generator-cli-7.11.0.jar`
|
||||
|
||||
For **Mac/Linux** users:
|
||||
```sh
|
||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.10.0/openapi-generator-cli-7.10.0.jar -O openapi-generator-cli.jar
|
||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.11.0/openapi-generator-cli-7.11.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.10.0/openapi-generator-cli-7.10.0.jar
|
||||
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.11.0/openapi-generator-cli-7.11.0.jar
|
||||
```
|
||||
|
||||
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
|
||||
@@ -437,7 +438,7 @@ openapi-generator-cli version
|
||||
To use a specific version of "openapi-generator-cli"
|
||||
|
||||
```sh
|
||||
openapi-generator-cli version-manager set 7.10.0
|
||||
openapi-generator-cli version-manager set 7.11.0
|
||||
```
|
||||
|
||||
Or install it as dev-dependency:
|
||||
@@ -449,6 +450,29 @@ npm install @openapitools/openapi-generator-cli -D
|
||||
|
||||
You can use [locally built JARs](https://github.com/OpenAPITools/openapi-generator-cli?tab=readme-ov-file#use-locally-built-jar) or [`SNAPSHOT` versions](https://github.com/OpenAPITools/openapi-generator-cli?tab=readme-ov-file#use-nightly-snapshot-build) as well.
|
||||
|
||||
### [1.8 - pip](#table-of-contents)
|
||||
|
||||
|
||||
> **Platform(s)**: Linux, macOS, Windows
|
||||
**Install** via [PyPI](https://pypi.org/) (`java` executable is needed to run):
|
||||
|
||||
```
|
||||
pip install openapi-generator-cli
|
||||
```
|
||||
|
||||
To install a specific version
|
||||
```
|
||||
pip install openapi-generator-cli==7.11.0
|
||||
```
|
||||
|
||||
You can also install with [jdk4py](https://github.com/activeviam/jdk4py) instead of java binary. (python>=3.10 is required)
|
||||
|
||||
```
|
||||
pip install openapi-generator-cli[jdk4py]
|
||||
```
|
||||
|
||||
Ref: https://github.com/openAPITools/openapi-generator-pip
|
||||
|
||||
## [2 - Getting Started](#table-of-contents)
|
||||
|
||||
To generate a PHP client for [petstore.yaml](https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml), please run the following
|
||||
@@ -464,7 +488,7 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat
|
||||
(if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php -o c:\temp\php_api_client`)
|
||||
|
||||
<!-- RELEASE_VERSION -->
|
||||
You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.10.0/openapi-generator-cli-7.10.0.jar)
|
||||
You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.11.0/openapi-generator-cli-7.11.0.jar)
|
||||
<!-- /RELEASE_VERSION -->
|
||||
|
||||
To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate`
|
||||
@@ -944,6 +968,10 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
||||
- 2024-03-04 - [Generating TypeScript Types with OpenAPI for REST API Consumption](https://www.pullrequest.com/blog/generating-typescript-types-with-openapi-for-rest-api-consumption/) by [PullRequest](https://www.pullrequest.com/)
|
||||
- 2024-03-07 - [Fully typed Web Apps with OpenAPI (Part 1)](https://medium.com/@gfox1984/fully-typed-web-apps-with-openapi-part-1-595d55766670) by [Guillaume Renard](https://medium.com/@gfox1984)
|
||||
- 2024-03-08 - [Laravel OpenAPIによる "辛くない" スキーマ駆動開発](https://fortee.jp/phperkaigi-2024/proposal/9e2e6c38-d078-4efa-99b4-83ebf9033b34) by [KentarouTakeda](https://twitter.com/KentarouTakeda)
|
||||
- 2024-04-04 - [Working with OpenAPI using Rust](https://www.shuttle.dev/blog/2024/04/04/using-openapi-rust) by [Joshua Mo](https://twitter.com/joshmo_dev)
|
||||
- 2024-04-08 - [Implement API first strategy with OpenAPI generator plugin](https://medium.com/javarevisited/implement-api-first-strategy-with-openapi-generator-plugin-e4bbe7f0d778) by [Rui Zhou](https://medium.com/@wirelesser)
|
||||
- 2024-05-06 - [OpenAPI Generator Custom Templates](https://www.javacodegeeks.com/openapi-generator-custom-templates.html) by [Mary Zheng](https://www.javacodegeeks.com/author/mary-zheng)
|
||||
|
||||
|
||||
## [6 - About Us](#table-of-contents)
|
||||
|
||||
@@ -1139,6 +1167,7 @@ Here is a list of template creators:
|
||||
* GraphQL: @wing328 [:heart:](https://www.patreon.com/wing328)
|
||||
* Ktorm: @Luiz-Monad
|
||||
* MySQL: [@ybelenko](https://github.com/ybelenko)
|
||||
* PostgreSQL: [@iri](https://github.com/iri)
|
||||
* Postman Collection: @gcatanese
|
||||
* Protocol Buffer: @wing328
|
||||
* WSDL: @adessoDpd
|
||||
@@ -1181,7 +1210,7 @@ If you want to join the committee, please kindly apply by sending an email to te
|
||||
| Android | @jaz-ah (2017/09) |
|
||||
| Apex | |
|
||||
| Bash | @frol (2017/07) @bkryza (2017/08) @kenjones-cisco (2017/09) |
|
||||
| C | @zhemant (2018/11) @ityuhui (2019/12) @michelealbano (2020/03) |
|
||||
| C | @zhemant (2018/11) @ityuhui (2019/12) @michelealbano (2020/03) @eafer (2024/12) |
|
||||
| C++ | @ravinikam (2017/07) @stkrwork (2017/07) @etherealjoy (2018/02) @martindelille (2018/03) @muttleyxd (2019/08) |
|
||||
| C# | @mandrean (2017/08) @shibayan (2020/02) @Blackclaws (2021/03) @lucamazzanti (2021/05) @iBicha (2023/07) |
|
||||
| Clojure | |
|
||||
|
||||
20
appveyor.yml
20
appveyor.yml
@@ -43,6 +43,18 @@ build_script:
|
||||
#- dotnet build samples\client\petstore\csharp\OpenAPIClient-ConditionalSerialization\Org.OpenAPITools.sln
|
||||
|
||||
test_script:
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net9\AllOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net9\AnyOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net9\AnyOfNoCompare\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net9\FormModels\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
# - dotnet test samples\client\petstore\csharp\generichost\net9\ManualSourceGenerationTests\ManualTests.Latest.UseSourceGeneration\ManualTests.Latest.UseSourceGeneration.csproj
|
||||
# - dotnet test samples\client\petstore\csharp\generichost\net9\ManualPetstoreTests\OpenAPIClient-generichost-manual-tests\OpenAPIClient-generichost-manual-tests.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net9\NullReferenceTypes\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net9\OneOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net9\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net9\SourceGeneration\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net9\UseDateTimeForDate\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net8\AllOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net8\AnyOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net8\AnyOfNoCompare\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
@@ -78,10 +90,10 @@ test_script:
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\net4.7\MultipleFrameworks\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\net4.7\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\net4.8\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\net6\ParameterMappings\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\net7\EnumMappings\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\net7\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\net7\UseDateTimeForDate\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\net8\ParameterMappings\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\net8\EnumMappings\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\net8\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\net8\UseDateTimeForDate\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\standard2.0\ConditionalSerialization\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\standard2.0\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
generatorName: aspnetcore
|
||||
outputDir: samples/server/petstore/aspnetcore-8.0-use-centralized-package-version-management
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0
|
||||
additionalProperties:
|
||||
packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}'
|
||||
aspnetCoreVersion: "8.0"
|
||||
userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37'
|
||||
centralizedPackageVersionManagement: "enable"
|
||||
15
bin/configs/csharp-generichost-net9-allOf.yaml
Normal file
15
bin/configs/csharp-generichost-net9-allOf.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/generichost/net9/AllOf
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/allOf.yaml
|
||||
library: generichost
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
useCompareNetObjects: true
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
nullableReferenceTypes: true
|
||||
equatable: true
|
||||
targetFramework: net9.0
|
||||
modelPropertySorting: alphabetical
|
||||
operationParameterSorting: alphabetical
|
||||
15
bin/configs/csharp-generichost-net9-anyOf.yaml
Normal file
15
bin/configs/csharp-generichost-net9-anyOf.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/generichost/net9/AnyOf
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/anyOf.yaml
|
||||
library: generichost
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
useCompareNetObjects: true
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
nullableReferenceTypes: true
|
||||
equatable: true
|
||||
targetFramework: net9.0
|
||||
modelPropertySorting: alphabetical
|
||||
operationParameterSorting: alphabetical
|
||||
15
bin/configs/csharp-generichost-net9-anyOfNoCompare.yaml
Normal file
15
bin/configs/csharp-generichost-net9-anyOfNoCompare.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/anyOf.yaml
|
||||
library: generichost
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
useCompareNetObjects: false
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
nullableReferenceTypes: true
|
||||
equatable: true
|
||||
targetFramework: net9.0
|
||||
modelPropertySorting: alphabetical
|
||||
operationParameterSorting: alphabetical
|
||||
18
bin/configs/csharp-generichost-net9-formModels.yaml
Normal file
18
bin/configs/csharp-generichost-net9-formModels.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/generichost/net9/FormModels
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
|
||||
library: generichost
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
useCompareNetObjects: true
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
nullableReferenceTypes: false
|
||||
equatable: true
|
||||
targetFramework: net9.0
|
||||
skipFormModel: false
|
||||
modelPropertySorting: alphabetical
|
||||
operationParameterSorting: alphabetical
|
||||
inlineSchemaOptions:
|
||||
RESOLVE_INLINE_ENUMS: true
|
||||
@@ -0,0 +1,15 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/generichost/net9/SourceGeneration
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
|
||||
library: generichost
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
useCompareNetObjects: true
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
useSourceGeneration: true
|
||||
equatable: true
|
||||
targetFramework: net9.0
|
||||
modelPropertySorting: alphabetical
|
||||
operationParameterSorting: alphabetical
|
||||
15
bin/configs/csharp-generichost-net9-nrt.yaml
Normal file
15
bin/configs/csharp-generichost-net9-nrt.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/generichost/net9/NullReferenceTypes
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
|
||||
library: generichost
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
useCompareNetObjects: true
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
nullableReferenceTypes: true
|
||||
equatable: true
|
||||
targetFramework: net9.0
|
||||
modelPropertySorting: alphabetical
|
||||
operationParameterSorting: alphabetical
|
||||
15
bin/configs/csharp-generichost-net9-oneOf.yaml
Normal file
15
bin/configs/csharp-generichost-net9-oneOf.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/generichost/net9/OneOf
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOf.yaml
|
||||
library: generichost
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
useCompareNetObjects: true
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
nullableReferenceTypes: true
|
||||
equatable: true
|
||||
targetFramework: net9.0
|
||||
modelPropertySorting: alphabetical
|
||||
operationParameterSorting: alphabetical
|
||||
12
bin/configs/csharp-generichost-net9-useDateTimeForDate.yaml
Normal file
12
bin/configs/csharp-generichost-net9-useDateTimeForDate.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/generichost/net9/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
|
||||
targetFramework: net9.0
|
||||
modelPropertySorting: alphabetical
|
||||
operationParameterSorting: alphabetical
|
||||
15
bin/configs/csharp-generichost-net9.yaml
Normal file
15
bin/configs/csharp-generichost-net9.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/generichost/net9/Petstore
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
|
||||
library: generichost
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
useCompareNetObjects: true
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
nullableReferenceTypes: false
|
||||
equatable: true
|
||||
targetFramework: net9.0
|
||||
modelPropertySorting: alphabetical
|
||||
operationParameterSorting: alphabetical
|
||||
13
bin/configs/csharp-httpclient-net9.yaml
Normal file
13
bin/configs/csharp-httpclient-net9.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
# for .net standard httpclient
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/httpclient/net9/Petstore
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
library: httpclient
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
useCompareNetObjects: true
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
useOneOfDiscriminatorLookup: true
|
||||
targetFramework: net9.0
|
||||
equatable: true
|
||||
@@ -1,10 +0,0 @@
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/echo_api/csharp-restsharp
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/echo_api.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{322C8CAF-0156-40C1-AE42-D59761FB9B6C}'
|
||||
targetFramework: net6.0
|
||||
setCompareNetObjects: "true"
|
||||
hideGenerationTimestamp: "true"
|
||||
equatable: true
|
||||
@@ -1,19 +0,0 @@
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/restsharp/net6/ParameterMappings
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/name-parameter-mappings.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
nameMappings:
|
||||
_type: UnderscoreType
|
||||
type_: TypeWithUnderscore
|
||||
http_debug_operation: HttpDebugOperation
|
||||
parameterNameMappings:
|
||||
_type: UnderscoreType
|
||||
type_: TypeWithUnderscore
|
||||
http_debug_operation: HttpDebugOperation
|
||||
modelNameMappings:
|
||||
Environment: Env
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
hideGenerationTimestamp: "true"
|
||||
targetFramework: net6.0
|
||||
equatable: true
|
||||
@@ -1,9 +0,0 @@
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/restsharp/net7/Petstore
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
targetFramework: net7.0
|
||||
useCompareNetObjects: "true"
|
||||
equatable: true
|
||||
@@ -1,9 +0,0 @@
|
||||
# for .net standard
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/restsharp/net7/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,14 +0,0 @@
|
||||
# for .net standard
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/restsharp/net7/EnumMappings
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature-oneof-primitive-types.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
useCompareNetObjects: true
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
useOneOfDiscriminatorLookup: true
|
||||
targetFramework: net7.0
|
||||
equatable: true
|
||||
enumNameMappings:
|
||||
delivered: Shipped
|
||||
9
bin/configs/csharp-restsharp-net8-compareNetObjects.yaml
Normal file
9
bin/configs/csharp-restsharp-net8-compareNetObjects.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/restsharp/net8/Petstore
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
targetFramework: net8.0
|
||||
useCompareNetObjects: "true"
|
||||
equatable: true
|
||||
10
bin/configs/csharp-restsharp-net8-echo-api.yaml
Normal file
10
bin/configs/csharp-restsharp-net8-echo-api.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/echo_api/csharp/restsharp/net8/EchoApi
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/echo_api.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{322C8CAF-0156-40C1-AE42-D59761FB9B6C}'
|
||||
targetFramework: net8.0
|
||||
setCompareNetObjects: "true"
|
||||
hideGenerationTimestamp: "true"
|
||||
equatable: true
|
||||
19
bin/configs/csharp-restsharp-net8-name-mappings.yaml
Normal file
19
bin/configs/csharp-restsharp-net8-name-mappings.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/restsharp/net8/ParameterMappings
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/name-parameter-mappings.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
nameMappings:
|
||||
_type: UnderscoreType
|
||||
type_: TypeWithUnderscore
|
||||
http_debug_operation: HttpDebugOperation
|
||||
parameterNameMappings:
|
||||
_type: UnderscoreType
|
||||
type_: TypeWithUnderscore
|
||||
http_debug_operation: HttpDebugOperation
|
||||
modelNameMappings:
|
||||
Environment: Env
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
hideGenerationTimestamp: "true"
|
||||
targetFramework: net8.0
|
||||
equatable: true
|
||||
@@ -0,0 +1,9 @@
|
||||
# for .net standard
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/restsharp/net8/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: net8.0
|
||||
useDateTimeForDate: true
|
||||
14
bin/configs/csharp-restsharp-net8.yaml
Normal file
14
bin/configs/csharp-restsharp-net8.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
# for .net standard
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/restsharp/net8/EnumMappings
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature-oneof-primitive-types.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
useCompareNetObjects: true
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
useOneOfDiscriminatorLookup: true
|
||||
targetFramework: net8.0
|
||||
equatable: true
|
||||
enumNameMappings:
|
||||
delivered: Shipped
|
||||
14
bin/configs/csharp-restsharp-net9.yaml
Normal file
14
bin/configs/csharp-restsharp-net9.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
# for .net standard
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/restsharp/net9/EnumMappings
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature-oneof-primitive-types.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
useCompareNetObjects: true
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
useOneOfDiscriminatorLookup: true
|
||||
targetFramework: net9.0
|
||||
equatable: true
|
||||
enumNameMappings:
|
||||
delivered: Shipped
|
||||
9
bin/configs/csharp-unityWebRequest-net9.yaml
Normal file
9
bin/configs/csharp-unityWebRequest-net9.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
# for .net Unity
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/unityWebRequest/net9/Petstore
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
library: unityWebRequest
|
||||
additionalProperties:
|
||||
targetFramework: net9.0
|
||||
equatable: true
|
||||
@@ -15,6 +15,7 @@ additionalProperties:
|
||||
useOneOfDiscriminatorLookup: true
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
useReflectionEqualsHashCode:: true
|
||||
removeEnumValuePrefix: true
|
||||
enumNameMappings:
|
||||
s: LOWER_CASE_S
|
||||
S: UPPER_CASE_S
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
generatorName: java
|
||||
outputDir: samples/client/petstore/java/webclient-useSingleRequestParameter
|
||||
library: webclient
|
||||
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
|
||||
additionalProperties:
|
||||
artifactId: singleparam-webclient
|
||||
hideGenerationTimestamp: "true"
|
||||
useSingleRequestParameter: true
|
||||
@@ -5,6 +5,7 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/javascript/petstore-
|
||||
templateDir: modules/openapi-generator/src/main/resources/Javascript
|
||||
additionalProperties:
|
||||
appName: PetstoreClient
|
||||
skipDefaultUserAgent: true
|
||||
modelNameMappings:
|
||||
HealthCheckResult: HealthCheckStatus
|
||||
parameterNameMappings:
|
||||
|
||||
8
bin/configs/kotlin-jvm-okhttp-echo-api.yaml
Normal file
8
bin/configs/kotlin-jvm-okhttp-echo-api.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
generatorName: kotlin
|
||||
outputDir: samples/client/echo_api/kotlin-jvm-okhttp
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/echo_api.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/kotlin-client
|
||||
modelNamePrefix: Api
|
||||
additionalProperties:
|
||||
library: jvm-okhttp4
|
||||
artifactId: kotlin-jvm-okhttp-echo-api
|
||||
8
bin/configs/kotlin-jvm-okhttp-non-ascii-headers.yaml
Normal file
8
bin/configs/kotlin-jvm-okhttp-non-ascii-headers.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
generatorName: kotlin
|
||||
outputDir: samples/client/others/kotlin-jvm-okhttp-non-ascii-headers
|
||||
library: jvm-okhttp4
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/kotlin-client
|
||||
additionalProperties:
|
||||
useNonAsciiHeaders: true
|
||||
artifactId: kotlin-petstore-jvm-okhttp-non-ascii-headers
|
||||
8
bin/configs/kotlin-server-ktor2.yaml
Normal file
8
bin/configs/kotlin-server-ktor2.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
generatorName: kotlin-server
|
||||
outputDir: samples/server/petstore/kotlin-server/ktor2
|
||||
library: ktor2
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/kotlin-server
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
serializableModel: "true"
|
||||
13
bin/configs/kotlin-spring-boot-reactive-without-flow.yaml
Normal file
13
bin/configs/kotlin-spring-boot-reactive-without-flow.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
generatorName: kotlin-spring
|
||||
outputDir: samples/server/petstore/kotlin-springboot-reactive-without-flow
|
||||
library: spring-boot
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/kotlin-spring
|
||||
additionalProperties:
|
||||
documentationProvider: springdoc
|
||||
annotationLibrary: swagger2
|
||||
useSwaggerUI: "true"
|
||||
serviceImplementation: "true"
|
||||
reactive: "true"
|
||||
beanValidations: "true"
|
||||
useFlowForArrayReturnType: "false"
|
||||
@@ -1,7 +1,7 @@
|
||||
generatorName: kotlin-spring
|
||||
outputDir: samples/server/petstore/kotlin-springboot-reactive
|
||||
library: spring-boot
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/kotlin-spring
|
||||
additionalProperties:
|
||||
documentationProvider: springdoc
|
||||
@@ -10,3 +10,5 @@ additionalProperties:
|
||||
serviceImplementation: "true"
|
||||
reactive: "true"
|
||||
beanValidations: "true"
|
||||
# the following option is set to true by default
|
||||
#useFlowForArrayReturnType: "true"
|
||||
|
||||
11
bin/configs/manual/rust-axum-oneof-v3.yaml
Normal file
11
bin/configs/manual/rust-axum-oneof-v3.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
generatorName: rust-axum
|
||||
outputDir: samples/server/petstore/rust-axum/output/rust-axum-oneof
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/rust-axum/rust-axum-oneof.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/rust-axum
|
||||
generateAliasAsModel: true
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
packageName: rust-axum-oneof
|
||||
globalProperties:
|
||||
skipFormModel: "false"
|
||||
enablePostProcessFile: true
|
||||
5
bin/configs/postgresql-schema-petstore.yaml
Normal file
5
bin/configs/postgresql-schema-petstore.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
generatorName: postgresql-schema
|
||||
outputDir: samples/schema/petstore/postgresql
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/postgresql-schema
|
||||
|
||||
0
bin/utils/openapi-generator-cli.sh
Normal file → Executable file
0
bin/utils/openapi-generator-cli.sh
Normal file → Executable file
@@ -6,7 +6,7 @@
|
||||
sha256: b98a6043573332de4f049db50b36bce7b5fada8511769da97f6561066a0f8c5c
|
||||
- filename: "samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools.Test/linux-logo.png"
|
||||
sha256: 0a67c32728197e942b13bdda064b73793f12f5c795f1e5cf35a3adf69c973230
|
||||
# java okhttp gson test files
|
||||
# java test files
|
||||
- filename: "samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ClientTest.java"
|
||||
sha256: 325fdd5d7e2c97790c0fb44f712ab7b2ba022d7e1a5b0056f47b07f342682b6d
|
||||
- filename: "samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java"
|
||||
@@ -15,3 +15,42 @@
|
||||
sha256: 8b1b8f2a2ad00ccb090873a94a5f73e328b98317d2ec715f53bd7a1accb2a023
|
||||
- filename: "samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/PetTest.java"
|
||||
sha256: a1f8a70bf7b0c382a8def5bacf7b1fb189e687fabb40235aa799001e0597f545
|
||||
- filename: "samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/api/AuthApiTest.java"
|
||||
sha256: 26f2dd90f9075e51add1cd7e88869a1e9345d9dbacf01199c1bf8a49395a8648
|
||||
- filename: "samples/client/echo_api/java/feign-gson/src/test/java/org/openapitools/client/api/AuthApiTest.java"
|
||||
sha256: b45d2ff04ad65e39a4d67a86a37d1a406e125df392f51ef0484d6c8da8b10454
|
||||
- filename: "samples/client/echo_api/java/okhttp-gson/src/test/java/org/openapitools/client/api/AuthApiTest.java"
|
||||
sha256: 761d101afddb8920f640c91741b5e7af56ebd753c80d537e0aaa4e1021887666
|
||||
- filename: "samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/api/BodyApiTest.java"
|
||||
sha256: 04715cabbe9bd27ff98dd56e3db489ebc9ffbf98d9af104a6707b0a40ab4f8fe
|
||||
- filename: "samples/client/echo_api/java/resttemplate/src/test/java/org/openapitools/client/api/AuthApiTest.java"
|
||||
sha256: 38193bbad7f3eef087bc1474352e484178b14a2b8c0e0ba0cd4e4960516a14f9
|
||||
- filename: "samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/PetApiTest.java"
|
||||
sha256: 24c6a39a9d7327d397dc038c368a19c84f14ed96a69fe28d53719b3eaf0a725c
|
||||
- filename: "samples/client/petstore/java/jersey3/src/test/java/org/openapitools/client/api/PetApiTest.java"
|
||||
sha256: 5e9f471d34310f94895751bb96cc79583376f043593c3a387c82077c70f8102f
|
||||
- filename: "samples/client/petstore/java/jersey3/src/test/java/org/openapitools/client/model/MammalTest.java"
|
||||
sha256: 67a9e63e13ebddac21cb236aa015edce30f5d3bd8d6adcf50044cad00d48c45e
|
||||
- filename: "samples/client/petstore/java/jersey3/src/test/java/org/openapitools/client/model/ZebraTest.java"
|
||||
sha256: 15eeb6d8a9a79d0f1930b861540d9c5780d6c49ea4fdb68269ac3e7ec481e142
|
||||
- filename: "samples/client/petstore/java/okhttp-gson-3.1/src/test/java/org/openapitools/client/api/PetApiTest.java"
|
||||
sha256: d8f7fff724f81e666daf115cc25f8347e1fda4e861aa30df0dae3fa50c91404c
|
||||
- filename: "samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/api/PetApiTest.java"
|
||||
sha256: 0cc079be64fe261b46f89976be2cbfad4fe5173dbe0d4b45303570299b0b5ecc
|
||||
- filename: "samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java"
|
||||
sha256: 3c41eb12d126f90392d97e3250b53ea9dce1663fb714a19339445b9da734d634
|
||||
- filename: "samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/PetApiTest.java"
|
||||
sha256: 68ed9228c99ecf2ff3842074242d3be7565da3b702b7f46008a5e119ef15c167
|
||||
- filename: "samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/test/java/org/openapitools/client/model/MySchemaNameCharactersTest.java"
|
||||
sha256: f0a82dd21d10f199bc403241fc9c7f4a8fa5e2d1646fd06f7941c2e528a1da45
|
||||
- filename: "samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/PetApiTest.java"
|
||||
sha256: 5e9f471d34310f94895751bb96cc79583376f043593c3a387c82077c70f8102f
|
||||
- filename: "samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/MammalTest.java"
|
||||
sha256: 67a9e63e13ebddac21cb236aa015edce30f5d3bd8d6adcf50044cad00d48c45e
|
||||
- filename: "samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ZebraTest.java"
|
||||
sha256: 15eeb6d8a9a79d0f1930b861540d9c5780d6c49ea4fdb68269ac3e7ec481e142
|
||||
# rust axum test files
|
||||
- filename: "samples/server/petstore/rust-axum/output/rust-axum-oneof/tests/oneof_with_discriminator.rs"
|
||||
sha256: 2d4f5a069fdcb3057bb078d5e75b3de63cd477b97725e457079df24bd2c30600
|
||||
- filename: "samples/server/petstore/rust-axum/output/openapi-v3/tests/oneof_untagged.rs"
|
||||
sha256: e72fbf81a9849dc7abb7e2169f2fc355c8b1cf991c0e2ffc083126abd9e966e7
|
||||
|
||||
@@ -10,7 +10,7 @@ sidebar_label: "Release Notes: 3.0.0"
|
||||
* e58dc2c77 Fix COPY in Dockerfile (#64)
|
||||
* 9d7feaaeb Fix online generator (docker push) (#58)
|
||||
* 9247cd01e Changes for Docker
|
||||
* 64037ee59 update docker-related files to ues jdk8
|
||||
* 64037ee59 update docker-related files to use jdk8
|
||||
|
||||
* ## Plug-ins
|
||||
* b6b8c0db8 \[gradle-plugin] Initial implementation (#162)
|
||||
|
||||
@@ -266,7 +266,7 @@ Upon first code generation, you may also pass the CLI option `--ignore-file-over
|
||||
|
||||
Editor support for `.openapi-generator-ignore` files is available in IntelliJ via the [.ignore plugin](https://plugins.jetbrains.com/plugin/7495--ignore).
|
||||
|
||||
One may want to pre-populate `.openapi-generator-ignore` with a list of entries during the code generation process and the global/general option `openapiGeneatorIgnoreList` (e.g. --openapi-generator-ignore-list in CLI) can do exactly that. For example,
|
||||
One may want to pre-populate `.openapi-generator-ignore` with a list of entries during the code generation process and the global/general option `openapiGeneratorIgnoreList` (e.g. --openapi-generator-ignore-list in CLI) can do exactly that. For example,
|
||||
```
|
||||
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g spring -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -o /tmp/spring --additional-properties useTags=true --openapi-generator-ignore-list "README.md,pom.xml,docs/*.md,src/main/java/org/openapitools/model/*"
|
||||
```
|
||||
@@ -434,9 +434,9 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat
|
||||
```
|
||||
will rename SOLD to UNAVAILABLE instead.
|
||||
|
||||
Not all generators support thess features yet. Please give it a try to confirm the behaviour and open an issue (ticket) to let us know which generators you would like to have this feature enabled and we'll prioritize accordingly. We also welcome PRs to add these features to generators. Related PRs for reference: #16209, #16234 (modelNameMappings), #16194, #16206 (nameMappings, parameterNameMappings), #17108 (enumNameMappings).
|
||||
Not all generators support these features yet. Please give it a try to confirm the behaviour and open an issue (ticket) to let us know which generators you would like to have this feature enabled and we'll prioritize accordingly. We also welcome PRs to add these features to generators. Related PRs for reference: #16209, #16234 (modelNameMappings), #16194, #16206 (nameMappings, parameterNameMappings), #17108 (enumNameMappings).
|
||||
|
||||
NOTE: some generators use `baseName` (original name obtained direclty from OpenAPI spec, e.g. `shipping-date`) mustache tag in the templates so the mapping feature won't work.
|
||||
NOTE: some generators use `baseName` (original name obtained directly from OpenAPI spec, e.g. `shipping-date`) mustache tag in the templates so the mapping feature won't work.
|
||||
|
||||
To map `operationId` (used in method naming) to something else, use `operationIdNameMappings` option, e.g.
|
||||
|
||||
@@ -480,7 +480,7 @@ paths:
|
||||
|
||||
## Inline Schema Naming
|
||||
|
||||
Inline schemas are created as separate schemas automatically and the auto-generated schema name may not look good to everyone. One can customize the name using the `title` field or the `inlineSchemaNameMapping` option. For exmaple, run the following,
|
||||
Inline schemas are created as separate schemas automatically and the auto-generated schema name may not look good to everyone. One can customize the name using the `title` field or the `inlineSchemaNameMapping` option. For example, run the following,
|
||||
|
||||
```
|
||||
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/inline_model_resolver.yaml -o /tmp/java3/ --skip-validate-spec --inline-schema-name-mappings inline_object_2=SomethingMapped,inline_object_4=nothing_new
|
||||
@@ -503,7 +503,7 @@ Another useful option is `inlineSchemaOptions`, which allows you to customize ho
|
||||
- `ARRAY_ITEM_SUFFIX` sets the array item suffix
|
||||
- `MAP_ITEM_SUFFIX` set the map item suffix
|
||||
- `SKIP_SCHEMA_REUSE=true` is a special value to skip reusing inline schemas during refactoring
|
||||
- `REFACTOR_ALLOF_INLINE_SCHEMAS=true` will restore the 6.x (or below) behaviour to refactor allOf inline schemas into $ref. (v7.0.0 will skip the refactoring of these allOf inline schmeas by default)
|
||||
- `REFACTOR_ALLOF_INLINE_SCHEMAS=true` will restore the 6.x (or below) behaviour to refactor allOf inline schemas into $ref. (v7.0.0 will skip the refactoring of these allOf inline schemas by default)
|
||||
- `RESOLVE_INLINE_ENUMS=true` will refactor inline enum definitions into $ref
|
||||
|
||||
## OpenAPI Normalizer
|
||||
@@ -524,7 +524,7 @@ Example:
|
||||
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/allOf_extension_parent.yaml -o /tmp/java-okhttp/ --openapi-normalizer REF_AS_PARENT_IN_ALLOF=true
|
||||
```
|
||||
|
||||
- `REMOVE_ANYOF_ONEOF_AND_KEEP_PROPERTIES_ONLY`: when set to `true`, oneOf/anyOf schema with only required properies only in a schema with properties will be removed. [(example)](https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/3_0/removeAnyOfOneOfAndKeepPropertiesOnly_test.yaml)
|
||||
- `REMOVE_ANYOF_ONEOF_AND_KEEP_PROPERTIES_ONLY`: when set to `true`, oneOf/anyOf schema with only required properties only in a schema with properties will be removed. [(example)](https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/3_0/removeAnyOfOneOfAndKeepPropertiesOnly_test.yaml)
|
||||
|
||||
Example:
|
||||
```
|
||||
|
||||
@@ -5,7 +5,9 @@ title: "FAQ: General"
|
||||
|
||||
## Do you have a chat room?
|
||||
|
||||
[](https://join.slack.com/t/openapi-generator/shared_invite/zt-2uoef5v0g-XGwo8~2oJ3EoziDSO1CmdQ)
|
||||
Yes, we use Slack.
|
||||
|
||||
[](https://join.slack.com/t/openapi-generator/shared_invite/zt-2wmkn4s8g-n19PJ99Y6Vei74WMUIehQA)
|
||||
|
||||
## What is the governance structure of the OpenAPI Generator project?
|
||||
|
||||
|
||||
@@ -168,6 +168,7 @@ The following generators are available:
|
||||
* [graphql-schema](generators/graphql-schema.md)
|
||||
* [ktorm-schema (beta)](generators/ktorm-schema.md)
|
||||
* [mysql-schema](generators/mysql-schema.md)
|
||||
* [postgresql-schema (beta)](generators/postgresql-schema.md)
|
||||
* [postman-collection (beta)](generators/postman-collection.md)
|
||||
* [protobuf-schema (beta)](generators/protobuf-schema.md)
|
||||
* [wsdl-schema (beta)](generators/wsdl-schema.md)
|
||||
|
||||
@@ -40,7 +40,7 @@ The following generators are available:
|
||||
* [php-dt](php-dt.md)
|
||||
* [powershell](powershell.md)
|
||||
* [python](python.md)
|
||||
* [python-legacy](python-legacy.md)
|
||||
* [python-pydantic-v1](python-pydantic-v1.md)
|
||||
* [r](r.md)
|
||||
* [ruby](ruby.md)
|
||||
* [rust](rust.md)
|
||||
@@ -100,6 +100,7 @@ The following generators are available:
|
||||
* [php-symfony](php-symfony.md)
|
||||
* [python-aiohttp](python-aiohttp.md)
|
||||
* [python-blueplanet](python-blueplanet.md)
|
||||
* [python-fastapi](python-fastapi.md)
|
||||
* [python-flask](python-flask.md)
|
||||
* [ruby-on-rails](ruby-on-rails.md)
|
||||
* [ruby-sinatra](ruby-sinatra.md)
|
||||
|
||||
@@ -20,6 +20,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
| ------ | ----------- | ------ | ------- |
|
||||
|aspnetCoreVersion|ASP.NET Core version: 6.0, 5.0, 3.1, 3.0, 2.2, 2.1, 2.0 (deprecated)|<dl><dt>**2.0**</dt><dd>ASP.NET Core 2.0</dd><dt>**2.1**</dt><dd>ASP.NET Core 2.1</dd><dt>**2.2**</dt><dd>ASP.NET Core 2.2</dd><dt>**3.0**</dt><dd>ASP.NET Core 3.0</dd><dt>**3.1**</dt><dd>ASP.NET Core 3.1</dd><dt>**5.0**</dt><dd>ASP.NET Core 5.0</dd><dt>**6.0**</dt><dd>ASP.NET Core 6.0</dd><dt>**7.0**</dt><dd>ASP.NET Core 7.0</dd><dt>**8.0**</dt><dd>ASP.NET Core 8.0</dd></dl>|8.0|
|
||||
|buildTarget|Target to build an application or library|<dl><dt>**program**</dt><dd>Generate code for a standalone server</dd><dt>**library**</dt><dd>Generate code for a server abstract class library</dd></dl>|program|
|
||||
|centralizedPackageVersionManagement|Option to control the usage of centralized package version management. https://devblogs.microsoft.com/nuget/introducing-central-package-management/#disabling-central-package-management|<dl><dt>**optout**</dt><dd>Opt out of centralized package version management. Set this if you have a Directory.Packages.pros file but want this project to ignore it.</dd><dt>**default**</dt><dd>Property in project won't be used</dd><dt>**enable**</dt><dd>Centralized package version management will be used</dd></dl>|null|
|
||||
|classModifier|Class Modifier for controller classes: Empty string or abstract.| ||
|
||||
|compatibilityVersion|ASP.Net Core CompatibilityVersion| |Version_2_2|
|
||||
|enumNameSuffix|Suffix that will be appended to all enum names.| |Enum|
|
||||
|
||||
@@ -47,7 +47,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|releaseNote|Release note, default to 'Minor update'.| |Minor update|
|
||||
|returnICollection|Return ICollection<T> instead of the concrete type.| |false|
|
||||
|sourceFolder|source folder for generated code| |src|
|
||||
|targetFramework|The target .NET framework version. To target multiple frameworks, use `;` as the separator, e.g. `netstandard2.1;netcoreapp3.1`|<dl><dt>**netstandard1.3**</dt><dd>.NET Standard 1.3</dd><dt>**netstandard1.4**</dt><dd>.NET Standard 1.4</dd><dt>**netstandard1.5**</dt><dd>.NET Standard 1.5</dd><dt>**netstandard1.6**</dt><dd>.NET Standard 1.6</dd><dt>**netstandard2.0**</dt><dd>.NET Standard 2.0</dd><dt>**netstandard2.1**</dt><dd>.NET Standard 2.1</dd><dt>**net47**</dt><dd>.NET Framework 4.7</dd><dt>**net48**</dt><dd>.NET Framework 4.8</dd><dt>**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|
|
||||
|targetFramework|The target .NET framework version. To target multiple frameworks, use `;` as the separator, e.g. `netstandard2.1;netcoreapp3.1`|<dl><dt>**netstandard1.3**</dt><dd>.NET Standard 1.3</dd><dt>**netstandard1.4**</dt><dd>.NET Standard 1.4</dd><dt>**netstandard1.5**</dt><dd>.NET Standard 1.5</dd><dt>**netstandard1.6**</dt><dd>.NET Standard 1.6</dd><dt>**netstandard2.0**</dt><dd>.NET Standard 2.0</dd><dt>**netstandard2.1**</dt><dd>.NET Standard 2.1</dd><dt>**net47**</dt><dd>.NET Framework 4.7</dd><dt>**net48**</dt><dd>.NET Framework 4.8</dd><dt>**net8.0**</dt><dd>.NET 8.0 (End of Support 10 November 2026)</dd><dt>**net9.0**</dt><dd>.NET 9.0 (End of Support 12 May 2026)</dd></dl>|net9.0|
|
||||
|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|
|
||||
|
||||
@@ -100,7 +100,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|useRuntimeException|Use RuntimeException instead of Exception. Only jersey2, jersey3, okhttp-gson, vertx, microprofile support this option.| |false|
|
||||
|useRxJava2|Whether to use the RxJava2 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false|
|
||||
|useRxJava3|Whether to use the RxJava3 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false|
|
||||
|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY jersey2, jersey3, okhttp-gson, microprofile, Spring RestClient support this option.| |false|
|
||||
|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY jersey2, jersey3, okhttp-gson, microprofile, Spring RestClient, Spring WebClient support this option.| |false|
|
||||
|webclientBlockingOperations|Making all WebClient operations blocking(sync). Note that if on operation 'x-webclient-blocking: false' then such operation won't be sync| |false|
|
||||
|withAWSV4Signature|whether to include AWS v4 signature support (only available for okhttp-gson library)| |false|
|
||||
|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|
|
||||
|
||||
@@ -100,7 +100,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|useRuntimeException|Use RuntimeException instead of Exception. Only jersey2, jersey3, okhttp-gson, vertx, microprofile support this option.| |false|
|
||||
|useRxJava2|Whether to use the RxJava2 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false|
|
||||
|useRxJava3|Whether to use the RxJava3 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false|
|
||||
|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY jersey2, jersey3, okhttp-gson, microprofile, Spring RestClient support this option.| |false|
|
||||
|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY jersey2, jersey3, okhttp-gson, microprofile, Spring RestClient, Spring WebClient support this option.| |false|
|
||||
|webclientBlockingOperations|Making all WebClient operations blocking(sync). Note that if on operation 'x-webclient-blocking: false' then such operation won't be sync| |false|
|
||||
|withAWSV4Signature|whether to include AWS v4 signature support (only available for okhttp-gson library)| |false|
|
||||
|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|
|
||||
|
||||
@@ -38,6 +38,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|projectDescription|description of the project (Default: using info.description or "Client library of <projectName>")| |null|
|
||||
|projectName|name of the project (Default: generated from info.title or "openapi-js-client")| |null|
|
||||
|projectVersion|version of the project (Default: using info.version or "1.0.0")| |null|
|
||||
|skipDefaultUserAgent|Skip setting default user-agent in ApiClient.js| |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|
|
||||
|sourceFolder|source folder for generated code| |src|
|
||||
|
||||
@@ -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><dt>**javalin5**</dt><dd>Javalin 5</dd><dt>**javalin6**</dt><dd>Javalin 6</dd></dl>|ktor|
|
||||
|library|library template (sub-template)|<dl><dt>**ktor**</dt><dd>ktor framework</dd><dt>**ktor2**</dt><dd>ktor (2.x) framework</dd><dt>**jaxrs-spec**</dt><dd>JAX-RS spec only</dd><dt>**javalin5**</dt><dd>Javalin 5</dd><dt>**javalin6**</dt><dd>Javalin 6</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|
|
||||
|
||||
@@ -52,6 +52,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|title|server title name or client service name| |OpenAPI Kotlin Spring|
|
||||
|useBeanValidation|Use BeanValidation API annotations to validate data types| |true|
|
||||
|useFeignClientUrl|Whether to generate Feign client with url parameter.| |true|
|
||||
|useFlowForArrayReturnType|Whether to use Flow for array/collection return types when reactive is enabled. If false, will use List instead.| |true|
|
||||
|useSpringBoot3|Generate code and provide dependencies for use with Spring Boot 3.x. (Use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.| |false|
|
||||
|useSwaggerUI|Open the OpenApi specification in swagger-ui. Will also import and configure needed dependencies| |true|
|
||||
|useTags|Whether to use tags for creating interface and controller class names| |false|
|
||||
|
||||
@@ -47,8 +47,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null|
|
||||
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null|
|
||||
|sourceFolder|source folder for generated code| |src/main/kotlin|
|
||||
|supportAndroidApiLevel25AndBelow|[WARNING] This flag will generate code that has a known security vulnerability. It uses `kotlin.io.createTempFile` instead of `java.nio.file.Files.createTempFile` in order to support Android API level 25 and bellow. For more info, please check the following links https://github.com/OpenAPITools/openapi-generator/security/advisories/GHSA-23x4-m842-fmwf, https://github.com/OpenAPITools/openapi-generator/pull/9284| |false|
|
||||
|supportAndroidApiLevel25AndBelow|[WARNING] This flag will generate code that has a known security vulnerability. It uses `kotlin.io.createTempFile` instead of `java.nio.file.Files.createTempFile` in order to support Android API level 25 and below. For more info, please check the following links https://github.com/OpenAPITools/openapi-generator/security/advisories/GHSA-23x4-m842-fmwf, https://github.com/OpenAPITools/openapi-generator/pull/9284| |false|
|
||||
|useCoroutines|Whether to use the Coroutines adapter with the retrofit2 library.| |false|
|
||||
|useNonAsciiHeaders|Allow to use non-ascii headers with the okhttp library| |false|
|
||||
|useRxJava3|Whether to use the RxJava3 adapter with the retrofit2 library.| |false|
|
||||
|useSettingsGradle|Whether the project uses settings.gradle.| |false|
|
||||
|useSpringBoot3|Whether to use the Spring Boot 3 with the jvm-spring-webclient library.| |false|
|
||||
|
||||
1031
docs/generators/postgresql-schema.md
Normal file
1031
docs/generators/postgresql-schema.md
Normal file
File diff suppressed because it is too large
Load Diff
@@ -33,6 +33,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|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|
|
||||
|modelPackage|package for generated models| |null|
|
||||
|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
|
||||
|pekkoHttpVersion|The version of pekko-http| |1.1.0|
|
||||
|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|
|
||||
|
||||
@@ -56,7 +56,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|useCustomDateWithoutTime|Uses a custom type to decode and encode dates without time information to support OpenAPIs date format (default: false)| |false|
|
||||
|useJsonEncodable|Make models conform to JSONEncodable protocol (default: true)| |true|
|
||||
|useSPMFileStructure|Use SPM file structure and set the source path to Sources/{{projectName}} (default: false).| |null|
|
||||
|validatable|Make validation rules and validator for model properies (default: true)| |true|
|
||||
|validatable|Make validation rules and validator for model properties (default: true)| |true|
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|useCustomDateWithoutTime|Uses a custom type to decode and encode dates without time information to support OpenAPIs date format (default: false)| |false|
|
||||
|useJsonEncodable|Make models conform to JSONEncodable protocol (default: true)| |true|
|
||||
|useSPMFileStructure|Use SPM file structure and set the source path to Sources/{{projectName}} (default: true).| |null|
|
||||
|validatable|Make validation rules and validator for model properies (default: true)| |true|
|
||||
|validatable|Make validation rules and validator for model properties (default: true)| |true|
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
|
||||
@@ -77,6 +77,22 @@ Then, **generate** a ruby client from a valid [petstore.yaml](https://raw.github
|
||||
openapi-generator-cli generate -i petstore.yaml -g ruby
|
||||
```
|
||||
|
||||
## PyPI
|
||||
|
||||
> **Platform(s)**: Linux, macOS, Windows
|
||||
|
||||
**Install** via [PyPI](https://pypi.org/) (`java` executable is needed to run):
|
||||
|
||||
```
|
||||
pip install openapi-generator-cli
|
||||
```
|
||||
|
||||
You can also install with [jdk4py](https://github.com/activeviam/jdk4py) instead of java binary. (python>=3.10 is required)
|
||||
|
||||
```
|
||||
pip install openapi-generator-cli[jdk4py]
|
||||
```
|
||||
|
||||
## Docker
|
||||
|
||||
> **Platform(s)**: Linux, macOS, Windows
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.11.0-SNAPSHOT</version>
|
||||
<version>7.12.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.11.0-SNAPSHOT</version>
|
||||
<version>7.12.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# RELEASE_VERSION
|
||||
openApiGeneratorVersion=7.11.0-SNAPSHOT
|
||||
openApiGeneratorVersion=7.12.0-SNAPSHOT
|
||||
# /RELEASE_VERSION
|
||||
|
||||
# BEGIN placeholders
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.11.0-SNAPSHOT</version>
|
||||
<version>7.12.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# RELEASE_VERSION
|
||||
openApiGeneratorVersion=7.10.0-SNAPSHOT
|
||||
openApiGeneratorVersion=7.12.0-SNAPSHOT
|
||||
# /RELEASE_VERSION
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.11.0-SNAPSHOT</version>
|
||||
<version>7.12.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.11.0-SNAPSHOT</version>
|
||||
<version>7.12.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.11.0-SNAPSHOT</version>
|
||||
<version>7.12.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.11.0-SNAPSHOT</version>
|
||||
<version>7.12.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.11.0-SNAPSHOT</version>
|
||||
<version>7.12.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.11.0-SNAPSHOT</version>
|
||||
<version>7.12.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.11.0-SNAPSHOT</version>
|
||||
<version>7.12.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -865,7 +865,7 @@ public class CodeGenMojo extends AbstractMojo {
|
||||
}
|
||||
|
||||
// Apply Parameter Name Mappings
|
||||
if (parameterNameMappings != null && (configOptions == null || !configOptions.containsKey("paramter-name-mappings"))) {
|
||||
if (parameterNameMappings != null && (configOptions == null || !configOptions.containsKey("parameter-name-mappings"))) {
|
||||
applyParameterNameMappingsKvpList(parameterNameMappings, configurator);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.11.0-SNAPSHOT</version>
|
||||
<version>7.12.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.11.0-SNAPSHOT</version>
|
||||
<version>7.12.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -409,9 +409,7 @@ public class CodegenConstants {
|
||||
"If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.";
|
||||
|
||||
public static final String UNSUPPORTED_V310_SPEC_MSG =
|
||||
"Generation using 3.1.0 specs is in development and is not officially supported yet. " +
|
||||
"If you would like to expedite development, please consider working on the open issues in the 3.1.0 project: https://github.com/orgs/OpenAPITools/projects/4/views/1 " +
|
||||
"and reach out to our team on Slack at https://join.slack.com/t/openapi-generator/shared_invite/zt-12jxxd7p2-XUeQM~4pzsU9x~eGLQqX2g";
|
||||
"OpenAPI 3.1 support is still in beta. To report an issue related to 3.1 spec, please kindly open an issue in the Github repo: https://github.com/openAPITools/openapi-generator.";
|
||||
|
||||
public static final String ENUM_UNKNOWN_DEFAULT_CASE = "enumUnknownDefaultCase";
|
||||
public static final String ENUM_UNKNOWN_DEFAULT_CASE_DESC =
|
||||
|
||||
@@ -1083,8 +1083,8 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
||||
sb.append(", items='").append(items).append('\'');
|
||||
sb.append(", additionalProperties='").append(additionalProperties).append('\'');
|
||||
sb.append(", isModel='").append(isModel).append('\'');
|
||||
sb.append(", isNull='").append(isNull);
|
||||
sb.append(", hasValidation='").append(hasValidation);
|
||||
sb.append(", isNull='").append(isNull).append('\'');
|
||||
sb.append(", hasValidation='").append(hasValidation).append('\'');
|
||||
sb.append(", getAdditionalPropertiesIsAnyType=").append(getAdditionalPropertiesIsAnyType());
|
||||
sb.append(", getHasDiscriminatorWithNonEmptyMapping=").append(hasDiscriminatorWithNonEmptyMapping);
|
||||
sb.append(", getIsAnyType=").append(getIsAnyType());
|
||||
|
||||
@@ -297,7 +297,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
// acts strictly upon a spec, potentially modifying it to have consistent behavior across generators.
|
||||
protected boolean strictSpecBehavior = true;
|
||||
// flag to indicate whether enum value prefixes are removed
|
||||
protected boolean removeEnumValuePrefix = true;
|
||||
protected boolean removeEnumValuePrefix = false;
|
||||
|
||||
// Support legacy logic for evaluating discriminators
|
||||
@Setter protected boolean legacyDiscriminatorBehavior = true;
|
||||
@@ -1942,9 +1942,9 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
if (ModelUtils.isMapSchema(schema)) {
|
||||
Schema additionalProperties = ModelUtils.getAdditionalProperties(schema);
|
||||
String inner = getSchemaType(additionalProperties);
|
||||
String mapInstantion = instantiationTypes.get("map");
|
||||
if (mapInstantion != null) {
|
||||
return mapInstantion + "<String, " + inner + ">";
|
||||
String mapInstantiation = instantiationTypes.get("map");
|
||||
if (mapInstantiation != null) {
|
||||
return mapInstantiation + "<String, " + inner + ">";
|
||||
}
|
||||
return inner;
|
||||
} else if (ModelUtils.isArraySchema(schema)) {
|
||||
@@ -2217,7 +2217,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
* @return string presentation of the default value of the property
|
||||
*/
|
||||
public String toDefaultValue(CodegenProperty codegenProperty, Schema schema) {
|
||||
// use toDefaultValue(schema) if generator has not overriden this method
|
||||
// use toDefaultValue(schema) if generator has not overridden this method
|
||||
return toDefaultValue(schema);
|
||||
}
|
||||
|
||||
@@ -3098,6 +3098,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
listOLists.add(m.requiredVars);
|
||||
listOLists.add(m.vars);
|
||||
listOLists.add(m.allVars);
|
||||
listOLists.add(m.readWriteVars);
|
||||
for (List<CodegenProperty> theseVars : listOLists) {
|
||||
for (CodegenProperty requiredVar : theseVars) {
|
||||
if (discPropName.equals(requiredVar.baseName)) {
|
||||
@@ -3131,6 +3132,63 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
return m;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the default value for an enum discriminator property in the provided {@link CodegenModel}.
|
||||
* <p>
|
||||
* If the model's discriminator is defined, this method identifies the discriminator properties among the model's
|
||||
* variables and assigns the default value to reflect the corresponding enum value for the model type.
|
||||
* </p>
|
||||
* <p>
|
||||
* Example: If the discriminator is for type `Animal`, and the model is `Cat`, the default value
|
||||
* will be set to `Animal.Cat` for the properties that have the same name as the discriminator.
|
||||
* </p>
|
||||
*
|
||||
* @param model the {@link CodegenModel} whose discriminator property default value is to be set
|
||||
*/
|
||||
protected static void setEnumDiscriminatorDefaultValue(CodegenModel model) {
|
||||
if (model.discriminator == null) {
|
||||
return;
|
||||
}
|
||||
String discPropName = model.discriminator.getPropertyBaseName();
|
||||
Stream.of(model.requiredVars, model.vars, model.allVars, model.readWriteVars)
|
||||
.flatMap(List::stream)
|
||||
.filter(v -> discPropName.equals(v.baseName))
|
||||
.forEach(v -> v.defaultValue = getEnumValueForProperty(model.schemaName, model.discriminator, v));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the appropriate default value for an enum discriminator property based on the model name.
|
||||
* <p>
|
||||
* If the discriminator has a mapping defined, it attempts to find a mapping for the model name.
|
||||
* Otherwise, it defaults to one of the allowable enum value associated with the property.
|
||||
* If no suitable value is found, the original default value of the property is returned.
|
||||
* </p>
|
||||
*
|
||||
* @param modelName the name of the model to determine the default value for
|
||||
* @param discriminator the {@link CodegenDiscriminator} containing the mapping and enum details
|
||||
* @param var the {@link CodegenProperty} representing the discriminator property
|
||||
* @return the default value for the enum discriminator property, or its original default value if none is found
|
||||
*/
|
||||
protected static String getEnumValueForProperty(
|
||||
String modelName, CodegenDiscriminator discriminator, CodegenProperty var) {
|
||||
if (!discriminator.getIsEnum() && !var.isEnum) {
|
||||
return var.defaultValue;
|
||||
}
|
||||
Map<String, String> mapping = Optional.ofNullable(discriminator.getMapping()).orElseGet(Collections::emptyMap);
|
||||
for (Map.Entry<String, String> e : mapping.entrySet()) {
|
||||
String schemaName = e.getValue().indexOf('/') < 0 ? e.getValue() : ModelUtils.getSimpleRef(e.getValue());
|
||||
if (modelName.equals(schemaName)) {
|
||||
return e.getKey();
|
||||
}
|
||||
}
|
||||
Object values = var.allowableValues.get("values");
|
||||
if (!(values instanceof List<?>)) {
|
||||
return var.defaultValue;
|
||||
}
|
||||
List<?> valueList = (List<?>) values;
|
||||
return valueList.stream().filter(o -> o.equals(modelName)).map(o -> (String) o).findAny().orElse(var.defaultValue);
|
||||
}
|
||||
|
||||
protected void SortModelPropertiesByRequiredFlag(CodegenModel model) {
|
||||
Comparator<CodegenProperty> comparator = new Comparator<CodegenProperty>() {
|
||||
@Override
|
||||
@@ -3149,7 +3207,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
// if we are trying to set additionalProperties on an empty schema stop recursing
|
||||
return;
|
||||
}
|
||||
// Note: This flag is set to true if additioanl properties
|
||||
// Note: This flag is set to true if additional properties
|
||||
// is set (any type, free form object, boolean true, string, etc).
|
||||
// The variable name may be renamed later to avoid confusion.
|
||||
boolean additionalPropertiesIsAnyType = false;
|
||||
@@ -3201,15 +3259,19 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
* @param visitedSchemas A set of visited schema names
|
||||
*/
|
||||
private CodegenProperty discriminatorFound(String composedSchemaName, Schema sc, String discPropName, Set<String> visitedSchemas) {
|
||||
if (visitedSchemas.contains(composedSchemaName)) { // recursive schema definition found
|
||||
Schema refSchema = ModelUtils.getReferencedSchema(openAPI, sc);
|
||||
String schemaName = Optional.ofNullable(composedSchemaName)
|
||||
.or(() -> Optional.ofNullable(refSchema.getName()))
|
||||
.or(() -> Optional.ofNullable(sc.get$ref()).map(ModelUtils::getSimpleRef))
|
||||
.orElseGet(sc::toString);
|
||||
if (visitedSchemas.contains(schemaName)) { // recursive schema definition found
|
||||
return null;
|
||||
} else {
|
||||
visitedSchemas.add(composedSchemaName);
|
||||
visitedSchemas.add(schemaName);
|
||||
}
|
||||
|
||||
Schema refSchema = ModelUtils.getReferencedSchema(openAPI, sc);
|
||||
if (refSchema.getProperties() != null && refSchema.getProperties().get(discPropName) != null) {
|
||||
Schema discSchema = (Schema) refSchema.getProperties().get(discPropName);
|
||||
Schema discSchema = ModelUtils.getReferencedSchema(openAPI, (Schema)refSchema.getProperties().get(discPropName));
|
||||
CodegenProperty cp = new CodegenProperty();
|
||||
if (ModelUtils.isStringSchema(discSchema)) {
|
||||
cp.isString = true;
|
||||
@@ -3218,6 +3280,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
if (refSchema.getRequired() != null && refSchema.getRequired().contains(discPropName)) {
|
||||
cp.setRequired(true);
|
||||
}
|
||||
cp.setIsEnum(discSchema.getEnum() != null && !discSchema.getEnum().isEmpty());
|
||||
return cp;
|
||||
}
|
||||
if (ModelUtils.isComposedSchema(refSchema)) {
|
||||
@@ -3225,7 +3288,8 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
if (composedSchema.getAllOf() != null) {
|
||||
// If our discriminator is in one of the allOf schemas break when we find it
|
||||
for (Object allOf : composedSchema.getAllOf()) {
|
||||
CodegenProperty cp = discriminatorFound(composedSchemaName, (Schema) allOf, discPropName, visitedSchemas);
|
||||
Schema allOfSchema = (Schema) allOf;
|
||||
CodegenProperty cp = discriminatorFound(allOfSchema.getName(), allOfSchema, discPropName, visitedSchemas);
|
||||
if (cp != null) {
|
||||
return cp;
|
||||
}
|
||||
@@ -3235,8 +3299,11 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
// All oneOf definitions must contain the discriminator
|
||||
CodegenProperty cp = new CodegenProperty();
|
||||
for (Object oneOf : composedSchema.getOneOf()) {
|
||||
String modelName = ModelUtils.getSimpleRef(((Schema) oneOf).get$ref());
|
||||
CodegenProperty thisCp = discriminatorFound(composedSchemaName, (Schema) oneOf, discPropName, visitedSchemas);
|
||||
Schema oneOfSchema = (Schema) oneOf;
|
||||
String modelName = ModelUtils.getSimpleRef((oneOfSchema).get$ref());
|
||||
// Must use a copied set as the oneOf schemas can point to the same discriminator.
|
||||
Set<String> visitedSchemasCopy = new TreeSet<>(visitedSchemas);
|
||||
CodegenProperty thisCp = discriminatorFound(oneOfSchema.getName(), oneOfSchema, discPropName, visitedSchemasCopy);
|
||||
if (thisCp == null) {
|
||||
once(LOGGER).warn(
|
||||
"'{}' defines discriminator '{}', but the referenced OneOf schema '{}' is missing {}",
|
||||
@@ -3258,8 +3325,11 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
// All anyOf definitions must contain the discriminator because a min of one must be selected
|
||||
CodegenProperty cp = new CodegenProperty();
|
||||
for (Object anyOf : composedSchema.getAnyOf()) {
|
||||
String modelName = ModelUtils.getSimpleRef(((Schema) anyOf).get$ref());
|
||||
CodegenProperty thisCp = discriminatorFound(composedSchemaName, (Schema) anyOf, discPropName, visitedSchemas);
|
||||
Schema anyOfSchema = (Schema) anyOf;
|
||||
String modelName = ModelUtils.getSimpleRef(anyOfSchema.get$ref());
|
||||
// Must use a copied set as the anyOf schemas can point to the same discriminator.
|
||||
Set<String> visitedSchemasCopy = new TreeSet<>(visitedSchemas);
|
||||
CodegenProperty thisCp = discriminatorFound(anyOfSchema.getName(), anyOfSchema, discPropName, visitedSchemasCopy);
|
||||
if (thisCp == null) {
|
||||
once(LOGGER).warn(
|
||||
"'{}' defines discriminator '{}', but the referenced AnyOf schema '{}' is missing {}",
|
||||
@@ -3542,13 +3612,11 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
discriminator.setPropertyType(propertyType);
|
||||
|
||||
// check to see if the discriminator property is an enum string
|
||||
if (schema.getProperties() != null &&
|
||||
schema.getProperties().get(discriminatorPropertyName) instanceof StringSchema) {
|
||||
StringSchema s = (StringSchema) schema.getProperties().get(discriminatorPropertyName);
|
||||
if (s.getEnum() != null && !s.getEnum().isEmpty()) { // it's an enum string
|
||||
discriminator.setIsEnum(true);
|
||||
}
|
||||
}
|
||||
boolean isEnum = Optional
|
||||
.ofNullable(discriminatorFound(schemaName, schema, discriminatorPropertyName, new TreeSet<>()))
|
||||
.map(CodegenProperty::getIsEnum)
|
||||
.orElse(false);
|
||||
discriminator.setIsEnum(isEnum);
|
||||
|
||||
discriminator.setMapping(sourceDiscriminator.getMapping());
|
||||
List<MappedModel> uniqueDescendants = new ArrayList<>();
|
||||
@@ -3875,29 +3943,8 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
|
||||
Schema original = null;
|
||||
// process the dereference schema if it's a ref to allOf with a single item
|
||||
// and certain field(s) (e.g. description, readyOnly, etc) is set
|
||||
if (p.get$ref() != null) {
|
||||
Schema derefSchema = ModelUtils.getReferencedSchema(openAPI, p);
|
||||
if (ModelUtils.isAllOfWithSingleItem(derefSchema) && (
|
||||
derefSchema.getReadOnly() != null ||
|
||||
derefSchema.getWriteOnly() != null ||
|
||||
derefSchema.getDeprecated() != null ||
|
||||
derefSchema.getDescription() != null ||
|
||||
derefSchema.getMaxLength() != null ||
|
||||
derefSchema.getMinLength() != null ||
|
||||
derefSchema.getMinimum() != null ||
|
||||
derefSchema.getMaximum() != null ||
|
||||
derefSchema.getMaximum() != null ||
|
||||
derefSchema.getMinItems() != null ||
|
||||
derefSchema.getTitle() != null
|
||||
)) {
|
||||
p = ModelUtils.getReferencedSchema(openAPI, p);
|
||||
}
|
||||
}
|
||||
|
||||
// check if it's allOf (only 1 sub schema) with or without default/nullable/etc set in the top level
|
||||
if (ModelUtils.isAllOfWithSingleItem(p)) {
|
||||
if (ModelUtils.isAllOf(p) && p.getAllOf().size() == 1) {
|
||||
if (p.getAllOf().get(0) instanceof Schema) {
|
||||
original = p;
|
||||
p = (Schema) p.getAllOf().get(0);
|
||||
@@ -3989,7 +4036,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
property._enum = new ArrayList<>();
|
||||
for (Object i : _enum) {
|
||||
// raw null values in enums are unions for nullable
|
||||
// atttributes, not actual enum values, so we remove them here
|
||||
// attributes, not actual enum values, so we remove them here
|
||||
if (i == null) {
|
||||
property.isNullable = true;
|
||||
continue;
|
||||
@@ -4001,7 +4048,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
|
||||
Map<String, Object> allowableValues = new HashMap<>();
|
||||
allowableValues.put("values", _enum);
|
||||
if (allowableValues.size() > 0) {
|
||||
if (!allowableValues.isEmpty()) {
|
||||
property.allowableValues = allowableValues;
|
||||
}
|
||||
}
|
||||
@@ -6524,6 +6571,9 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
// input.name => input_name
|
||||
modifiable = this.sanitizeValue(modifiable, "\\.", "_", exceptions);
|
||||
|
||||
// input:name => input_name
|
||||
modifiable = this.sanitizeValue(modifiable, ":", "_", exceptions);
|
||||
|
||||
// input-name => input_name
|
||||
modifiable = this.sanitizeValue(modifiable, "-", "_", exceptions);
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public enum GeneratorLanguage {
|
||||
JAVASCRIPT("Javascript"), GRAPH_QL("GraphQL"), GROOVY("Groovy"),
|
||||
HASKELL("Haskell"), HTTP("Jetbrains HTTP Client (HTTP/REST)"), TYPESCRIPT("Typescript"), K_SIX("k6"), KOTLIN("Kotlin"),
|
||||
KTORM("Ktorm"), LUA("Lua"), MYSQL("Mysql"), NIM("Nim"),
|
||||
OBJECTIVE_C("Objective-C"), OCAML("OCaml"), PERL("Perl"), PHP("PHP"),
|
||||
OBJECTIVE_C("Objective-C"), OCAML("OCaml"), PERL("Perl"), PHP("PHP"), POSTGRESQL("Postgresql"),
|
||||
POWERSHELL("PowerShell"), PROTOBUF("Protocol Buffers (Protobuf)"), PYTHON("Python"),
|
||||
R("R"), RUBY("Ruby"), RUST("Rust"), SCALA("Scala"), SWIFT("Swift"),
|
||||
WSDL("Web Services Description Language (WSDL)"), JULIA("Julia"), XOJO("Xojo");
|
||||
|
||||
@@ -207,7 +207,7 @@ public class InlineModelResolver {
|
||||
|
||||
/**
|
||||
* Return false if model can be represented by primitives e.g. string, object
|
||||
* without properties, array or map of other model (model contanier), etc.
|
||||
* without properties, array or map of other model (model container), etc.
|
||||
* <p>
|
||||
* Return true if a model should be generated e.g. object with properties,
|
||||
* enum, oneOf, allOf, anyOf, etc.
|
||||
@@ -220,7 +220,7 @@ public class InlineModelResolver {
|
||||
|
||||
/**
|
||||
* Return false if model can be represented by primitives e.g. string, object
|
||||
* without properties, array or map of other model (model contanier), etc.
|
||||
* without properties, array or map of other model (model container), etc.
|
||||
* <p>
|
||||
* Return true if a model should be generated e.g. object with properties,
|
||||
* enum, oneOf, allOf, anyOf, etc.
|
||||
@@ -629,7 +629,7 @@ public class InlineModelResolver {
|
||||
* breed:
|
||||
* type: string
|
||||
*
|
||||
* @param key a unique name ofr the composed schema.
|
||||
* @param key a unique name for the composed schema.
|
||||
* @param children the list of nested schemas within a composed schema (allOf, anyOf, oneOf).
|
||||
* @param skipAllOfInlineSchemas true if allOf inline schemas need to be skipped.
|
||||
*/
|
||||
@@ -1043,7 +1043,7 @@ public class InlineModelResolver {
|
||||
* Add the schemas to the components
|
||||
*
|
||||
* @param name name of the inline schema
|
||||
* @param schema inilne schema
|
||||
* @param schema inline schema
|
||||
* @return the actual model name (based on inlineSchemaNameMapping if provided)
|
||||
*/
|
||||
private String addSchemas(String name, Schema schema) {
|
||||
|
||||
@@ -836,7 +836,7 @@ public class OpenAPINormalizer {
|
||||
}
|
||||
|
||||
// ===================== a list of rules =====================
|
||||
// all rules (fuctions) start with the word "process"
|
||||
// all rules (functions ) start with the word "process"
|
||||
|
||||
/**
|
||||
* Child schemas in `allOf` is considered a parent if it's a `$ref` (instead of inline schema).
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user