forked from loafle/openapi-generator-original
Compare commits
181 Commits
devhl-labs
...
update-mus
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
277b43bcea | ||
|
|
38dac13c26 | ||
|
|
0a39a1760e | ||
|
|
ca032113f2 | ||
|
|
65b1859161 | ||
|
|
8f7d9f7467 | ||
|
|
c487a6ea18 | ||
|
|
21a8e4e623 | ||
|
|
b1dd6b262e | ||
|
|
1214ad7492 | ||
|
|
4ddfb6fc41 | ||
|
|
3b3f9a770a | ||
|
|
2354d402a8 | ||
|
|
b5b760a8a2 | ||
|
|
8849156d29 | ||
|
|
2838b9584b | ||
|
|
d1ca82cb8b | ||
|
|
462f450366 | ||
|
|
185c0639c0 | ||
|
|
715f6b634e | ||
|
|
7f899dff97 | ||
|
|
368b9b7e37 | ||
|
|
a84946bdb3 | ||
|
|
d9cdecf3c3 | ||
|
|
b357744048 | ||
|
|
45fa4384e7 | ||
|
|
ea4b17c32f | ||
|
|
b730e36937 | ||
|
|
43fd18935c | ||
|
|
30e6612558 | ||
|
|
d14eab8446 | ||
|
|
627c0f43cd | ||
|
|
31be9b9207 | ||
|
|
d60200de38 | ||
|
|
22b8c47b93 | ||
|
|
ba169342a1 | ||
|
|
b3b3f46ee2 | ||
|
|
25b834131c | ||
|
|
7c84177e65 | ||
|
|
e2c458b9ea | ||
|
|
4145000dfe | ||
|
|
a82475ed4e | ||
|
|
7cf84e2daf | ||
|
|
4ff8c3aaef | ||
|
|
7d1e9997d0 | ||
|
|
9a0fc5900f | ||
|
|
4c81563708 | ||
|
|
5902af4e75 | ||
|
|
39fb51062b | ||
|
|
77e8346fd7 | ||
|
|
9163e00932 | ||
|
|
2f3f25dee2 | ||
|
|
28ae69dafd | ||
|
|
6745340c64 | ||
|
|
c7d9857c8d | ||
|
|
fce8bb9604 | ||
|
|
c8fad42324 | ||
|
|
2f73582d82 | ||
|
|
899ddecdbd | ||
|
|
98468aba5c | ||
|
|
fbebfeb774 | ||
|
|
9791e6f537 | ||
|
|
e5dee54797 | ||
|
|
77eb192414 | ||
|
|
5e7cf1cfdd | ||
|
|
ad6c2dd2b7 | ||
|
|
8e10dd7be7 | ||
|
|
66cde8b5f4 | ||
|
|
cfe6520283 | ||
|
|
817da39124 | ||
|
|
67942aa478 | ||
|
|
06d914dd0f | ||
|
|
5f345c0213 | ||
|
|
c9a9ae0aa8 | ||
|
|
2437d7fa97 | ||
|
|
d521cddc3b | ||
|
|
c48ef148c0 | ||
|
|
74100e44cb | ||
|
|
577483c2e2 | ||
|
|
d193050a35 | ||
|
|
9f2bd313ff | ||
|
|
6686c4d02f | ||
|
|
c84af35e7b | ||
|
|
171b98e06c | ||
|
|
83f6d592a2 | ||
|
|
619e4d9653 | ||
|
|
0371799857 | ||
|
|
2111713117 | ||
|
|
fad33dfebf | ||
|
|
673cd15e72 | ||
|
|
43ce2a8e10 | ||
|
|
168a1d5d1f | ||
|
|
90bc1000bd | ||
|
|
f409bf1440 | ||
|
|
1cdd7b7ff2 | ||
|
|
c5060a2318 | ||
|
|
c6eb9e0e09 | ||
|
|
2544fa2928 | ||
|
|
d7ac1e4337 | ||
|
|
60d0888898 | ||
|
|
2322a99bba | ||
|
|
5f39bd230e | ||
|
|
8ef3118005 | ||
|
|
7e1ebe6404 | ||
|
|
2551689ec6 | ||
|
|
241f51c56b | ||
|
|
849b3e8e17 | ||
|
|
af2ed1c7a6 | ||
|
|
df22ca6dcc | ||
|
|
d68a186c5e | ||
|
|
2d57255817 | ||
|
|
ea6b1c6612 | ||
|
|
9300a68ad7 | ||
|
|
fb5e69f83a | ||
|
|
0b32c5025e | ||
|
|
4223be77f8 | ||
|
|
b01dd41ce3 | ||
|
|
36367e79e7 | ||
|
|
5e2af7203a | ||
|
|
1b247e75a9 | ||
|
|
911455d206 | ||
|
|
76aca6618f | ||
|
|
645626d2f5 | ||
|
|
29c3b020e6 | ||
|
|
a6581e8e4c | ||
|
|
9147e998ff | ||
|
|
7f6b1306ed | ||
|
|
17e0b7ca71 | ||
|
|
e370b8130a | ||
|
|
5732e2758f | ||
|
|
7d8eacc197 | ||
|
|
78f2f7010f | ||
|
|
98783f8161 | ||
|
|
565af33e24 | ||
|
|
b42027da5d | ||
|
|
fb36272358 | ||
|
|
8821cf095e | ||
|
|
e1a1d7ab5a | ||
|
|
b4edca5ad4 | ||
|
|
eebecc8646 | ||
|
|
3240c5baf0 | ||
|
|
410113fd6d | ||
|
|
171804eef7 | ||
|
|
0f561b05cb | ||
|
|
34aeb16c5e | ||
|
|
40967a3d38 | ||
|
|
b3e72feaa9 | ||
|
|
07787973e8 | ||
|
|
d03c90cb97 | ||
|
|
f07f8bc997 | ||
|
|
cf5d17bbfe | ||
|
|
0b084cd75d | ||
|
|
fd85359548 | ||
|
|
30b1a74979 | ||
|
|
ff1fe256d8 | ||
|
|
1b30c1995f | ||
|
|
3832cb4eb7 | ||
|
|
425aa7db44 | ||
|
|
0c5142a6f6 | ||
|
|
a5384d42b4 | ||
|
|
bbafeaed40 | ||
|
|
cf9de0bf94 | ||
|
|
243f501aef | ||
|
|
2f179fe41d | ||
|
|
7dcaececf8 | ||
|
|
abf94168e6 | ||
|
|
740b971074 | ||
|
|
cd349dc5ea | ||
|
|
5c6b8f3b16 | ||
|
|
d02aae7469 | ||
|
|
ca378b424a | ||
|
|
0e763b096e | ||
|
|
1658264261 | ||
|
|
8171648eb4 | ||
|
|
0026e15030 | ||
|
|
8511a533d6 | ||
|
|
596d446f54 | ||
|
|
a98f45b4ac | ||
|
|
14e691b9c9 | ||
|
|
195438d1e7 | ||
|
|
a93a6d5a35 |
1
.ddev/web-build/Dockerfile.maven
Normal file
1
.ddev/web-build/Dockerfile.maven
Normal file
@@ -0,0 +1 @@
|
||||
RUN apt update && apt install -y maven
|
||||
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -17,5 +17,5 @@
|
||||
These must match the expectations made by your contribution.
|
||||
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example `./bin/generate-samples.sh bin/configs/java*`.
|
||||
IMPORTANT: Do **NOT** purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
|
||||
- [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master` (upcoming 7.6.0 minor release - breaking changes with fallbacks), `8.0.x` (breaking changes without fallbacks)
|
||||
- [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master` (upcoming `7.x.0` minor release - breaking changes with fallbacks), `8.0.x` (breaking changes without fallbacks)
|
||||
- [ ] If your PR is targeting a particular programming language, @mention the [technical committee](https://github.com/openapitools/openapi-generator/#62---openapi-generator-technical-committee) members, so they are more likely to review the pull request.
|
||||
|
||||
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.14.0
|
||||
uses: s4u/setup-maven-action@v1.15.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.14.0
|
||||
uses: s4u/setup-maven-action@v1.15.0
|
||||
with:
|
||||
java-version: 11
|
||||
maven-version: 3.8.8
|
||||
|
||||
2
.github/workflows/openapi-generator.yaml
vendored
2
.github/workflows/openapi-generator.yaml
vendored
@@ -142,6 +142,8 @@ jobs:
|
||||
path: modules/openapi-generator-cli/target
|
||||
- name: Delete samples that are entirely generated
|
||||
run: |
|
||||
rm -rf samples/client/petstore/csharp/generichost/latest/Tags
|
||||
|
||||
rm -rf samples/client/petstore/csharp/generichost/net8/AllOf
|
||||
rm -rf samples/client/petstore/csharp/generichost/net8/AnyOf
|
||||
rm -rf samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare
|
||||
|
||||
3
.github/workflows/samples-dotnet.yaml
vendored
3
.github/workflows/samples-dotnet.yaml
vendored
@@ -3,12 +3,14 @@ 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/**
|
||||
@@ -21,6 +23,7 @@ jobs:
|
||||
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
|
||||
|
||||
18
.github/workflows/samples-erlang.yaml
vendored
18
.github/workflows/samples-erlang.yaml
vendored
@@ -3,33 +3,33 @@ name: Samples Erlang
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
# comment out due to errors
|
||||
# ===> Compiling src/openapi_pet_handler.erl failed
|
||||
# src/openapi_pet_handler.erl:278: function is_authorized/2 already defined
|
||||
#- samples/server/petstore/erlang-server/**
|
||||
- samples/server/echo_api/erlang-server/**
|
||||
- samples/server/petstore/erlang-server/**
|
||||
- samples/client/petstore/erlang-client/**
|
||||
- samples/client/petstore/erlang-proper/**
|
||||
pull_request:
|
||||
paths:
|
||||
#- samples/server/petstore/erlang-server/**
|
||||
- samples/server/echo_api/erlang-server/**
|
||||
- samples/server/petstore/erlang-server/**
|
||||
- samples/client/petstore/erlang-client/**
|
||||
- samples/client/petstore/erlang-proper/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build Erlang projects
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
#- samples/server/petstore/erlang-server/
|
||||
- samples/server/echo_api/erlang-server/
|
||||
- samples/server/petstore/erlang-server/
|
||||
- samples/client/petstore/erlang-client/
|
||||
- samples/client/petstore/erlang-proper/
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: erlef/setup-beam@v1
|
||||
with:
|
||||
otp-version: '22.2'
|
||||
rebar3-version: '3.14.3'
|
||||
otp-version: '27'
|
||||
rebar3-version: '3.23.0'
|
||||
- run: rebar3 compile
|
||||
working-directory: ${{ matrix.sample }}
|
||||
|
||||
24
.github/workflows/samples-go.yaml
vendored
24
.github/workflows/samples-go.yaml
vendored
@@ -35,3 +35,27 @@ jobs:
|
||||
- name: Run test
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: go test -mod=mod -v
|
||||
|
||||
verify:
|
||||
name: Verify generated Go files with Go tests
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
- samples/server/petstore/go-api-server/
|
||||
go-version:
|
||||
- "1.18"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
- name: Install Dependencies
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: |
|
||||
go mod tidy
|
||||
- name: Run tests
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: go test ./samples_tests -v
|
||||
@@ -11,6 +11,7 @@ on:
|
||||
- samples/openapi3/client/petstore/java/jersey2-java8-swagger2/**
|
||||
- samples/openapi3/client/petstore/java/native**
|
||||
- samples/client/others/java/okhttp-gson-oneOf/**
|
||||
- samples/client/others/java/okhttp-gson-oneOf-array/**
|
||||
- samples/client/others/java/resttemplate-useAbstractionForFiles/**
|
||||
- samples/client/others/java/webclient-useAbstractionForFiles/**
|
||||
- samples/client/others/java/jersey2-oneOf-duplicates/**
|
||||
@@ -26,6 +27,7 @@ on:
|
||||
- samples/openapi3/client/petstore/java/jersey2-java8-swagger2/**
|
||||
- samples/openapi3/client/petstore/java/native**
|
||||
- samples/client/others/java/okhttp-gson-oneOf/**
|
||||
- samples/client/others/java/okhttp-gson-oneOf-array/**
|
||||
- samples/client/others/java/resttemplate-useAbstractionForFiles/**
|
||||
- samples/client/others/java/webclient-useAbstractionForFiles/**
|
||||
- samples/client/others/java/jersey2-oneOf-duplicates/**
|
||||
@@ -75,6 +77,7 @@ jobs:
|
||||
- samples/client/petstore/java/resttemplate-swagger2/
|
||||
- samples/openapi3/client/petstore/java/jersey2-java8-swagger2/
|
||||
- samples/client/others/java/okhttp-gson-oneOf/
|
||||
- samples/client/others/java/okhttp-gson-oneOf-array/
|
||||
- samples/client/echo_api/java/okhttp-gson-user-defined-templates/
|
||||
- samples/client/others/java/resttemplate-useAbstractionForFiles/
|
||||
- samples/client/others/java/webclient-useAbstractionForFiles/
|
||||
|
||||
2
.github/workflows/samples-kotlin-server.yaml
vendored
2
.github/workflows/samples-kotlin-server.yaml
vendored
@@ -17,7 +17,7 @@ on:
|
||||
# - samples/server/petstore/kotlin-spring-default/**
|
||||
|
||||
env:
|
||||
GRADLE_VERSION: 6.9
|
||||
GRADLE_VERSION: 7.6.4
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
2
.github/workflows/samples-postman.yaml
vendored
2
.github/workflows/samples-postman.yaml
vendored
@@ -17,7 +17,7 @@ jobs:
|
||||
# schema
|
||||
- samples/schema/postman-collection
|
||||
python-version:
|
||||
- "3.11"
|
||||
- "3.12"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
|
||||
@@ -19,6 +19,7 @@ jobs:
|
||||
- "3.9"
|
||||
- "3.10"
|
||||
- "3.11"
|
||||
- "3.12"
|
||||
sample:
|
||||
- samples/openapi3/client/petstore/python-aiohttp
|
||||
- samples/openapi3/client/petstore/python
|
||||
|
||||
@@ -17,11 +17,11 @@ jobs:
|
||||
# clients
|
||||
- samples/client/echo_api/python-pydantic-v1/
|
||||
python-version:
|
||||
- "3.7"
|
||||
- "3.8"
|
||||
- "3.9"
|
||||
- "3.10"
|
||||
- "3.11"
|
||||
- "3.12"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
|
||||
@@ -19,6 +19,7 @@ jobs:
|
||||
- "3.9"
|
||||
- "3.10"
|
||||
- "3.11"
|
||||
- "3.12"
|
||||
sample:
|
||||
- samples/openapi3/client/petstore/python-pydantic-v1-aiohttp
|
||||
- samples/openapi3/client/petstore/python-pydantic-v1
|
||||
|
||||
2
.github/workflows/samples-python-server.yaml
vendored
2
.github/workflows/samples-python-server.yaml
vendored
@@ -21,7 +21,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.7'
|
||||
python-version: '3.9'
|
||||
- name: Test
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: make test-all
|
||||
|
||||
1
.github/workflows/samples-scala.yaml
vendored
1
.github/workflows/samples-scala.yaml
vendored
@@ -23,6 +23,7 @@ jobs:
|
||||
- 'samples/client/petstore/java/okhttp-gson'
|
||||
- samples/client/petstore/scalaz
|
||||
- samples/client/petstore/scala-pekko
|
||||
- samples/client/petstore/scala-http4s
|
||||
#- samples/client/petstore/scala-sttp # won't pass while the same tests in circleci pass
|
||||
# servers
|
||||
- samples/server/petstore/scala-lagom-server
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
name: Samples Swift
|
||||
name: Samples Swift 5
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -16,24 +16,18 @@ jobs:
|
||||
os: [macos-latest]
|
||||
sample:
|
||||
- samples/client/petstore/swift5/alamofireLibrary
|
||||
- samples/client/petstore/swift5/anycodableLibrary
|
||||
- samples/client/petstore/swift5/asyncAwaitLibrary
|
||||
- samples/client/petstore/swift5/combineLibrary
|
||||
- samples/client/petstore/swift5/default
|
||||
- samples/client/petstore/swift5/deprecated
|
||||
- samples/client/petstore/swift5/frozenEnums
|
||||
- samples/client/petstore/swift5/nonPublicApi
|
||||
- samples/client/petstore/swift5/objcCompatible
|
||||
- samples/client/petstore/swift5/oneOf
|
||||
- samples/client/petstore/swift5/promisekitLibrary
|
||||
- samples/client/petstore/swift5/readonlyProperties
|
||||
- samples/client/petstore/swift5/resultLibrary
|
||||
- samples/client/petstore/swift5/rxswiftLibrary
|
||||
- samples/client/petstore/swift5/urlsessionLibrary
|
||||
- samples/client/petstore/swift5/validation
|
||||
# NOTE: disabled as vaporLibrary doesnt build when adding this CI config
|
||||
#- samples/client/petstore/swift5/vaporLibrary
|
||||
- samples/client/petstore/swift5/x-swift-hashable
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
sample: samples/client/petstore/swift5/alamofireLibrary
|
||||
37
.github/workflows/samples-typescript-encode-decode.yaml
vendored
Normal file
37
.github/workflows/samples-typescript-encode-decode.yaml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
name: TypeScript Client (Encoding / Decoding Test)
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- samples/client/others/typescript/encode-decode/**
|
||||
- .github/workflows/samples-typescript-encode-decode.yaml
|
||||
jobs:
|
||||
build:
|
||||
name: Test TypeScript Encoding / Decoding
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
# clients
|
||||
- samples/client/others/typescript/encode-decode/test
|
||||
node-version:
|
||||
- 16
|
||||
- 18
|
||||
- 20
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
- name: Install
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: |
|
||||
npm run preinstall
|
||||
npm i
|
||||
|
||||
- name: Test
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: npm test
|
||||
37
.github/workflows/samples-typescript-node-encode-decode.yaml
vendored
Normal file
37
.github/workflows/samples-typescript-node-encode-decode.yaml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
name: TypeScript Node Client (Encoding / Decoding Test)
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- samples/client/others/typescript-node/encode-decode/**
|
||||
- .github/workflows/samples-typescript-node-encode-decode.yaml
|
||||
jobs:
|
||||
build:
|
||||
name: Test TypeScript Node Encoding / Decoding
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
# clients
|
||||
- samples/client/others/typescript-node/encode-decode/test
|
||||
node-version:
|
||||
- 16
|
||||
- 18
|
||||
- 20
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
- name: Install
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: |
|
||||
npm run preinstall
|
||||
npm i
|
||||
|
||||
- name: Test
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: npm test
|
||||
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.14.0
|
||||
uses: s4u/setup-maven-action@v1.15.0
|
||||
with:
|
||||
java-version: ${{ matrix.java }}
|
||||
maven-version: 3.8.8
|
||||
|
||||
23
.travis.yml
23
.travis.yml
@@ -201,16 +201,19 @@ after_success:
|
||||
echo "Pushed to $DOCKER_CODEGEN_CLI_IMAGE_NAME";
|
||||
fi;
|
||||
fi;
|
||||
# publish latest website, variables below are secure environment variables which are unavailable to PRs from forks.
|
||||
#- if [ "$TRAVIS_BRANCH" = "master" ] && [ -z $TRAVIS_TAG ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
|
||||
# cd website;
|
||||
# git config --global user.name "${GH_NAME}";
|
||||
# git config --global user.email "${GH_EMAIL}";
|
||||
# echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc;
|
||||
# yarn install;
|
||||
# GIT_USER="${GH_NAME}" yarn run publish-gh-pages;
|
||||
# fi;
|
||||
|
||||
## NOTE; we will do the followign manually instead as the page doesn't need to be updated in every single travis build
|
||||
## publish latest website, variables below are secure environment variables which are unavailable to PRs from forks.
|
||||
# - if [ "$TRAVIS_BRANCH" = "master" ] && [ -z $TRAVIS_TAG ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
|
||||
# sed -i "s/Vector{UInt8}/Vector\{UInt8\}/g" docs/generators/julia-client.md;
|
||||
# sed -i "s/Vector{UInt8}/Vector\{UInt8\}/g" docs/generators/julia-server.md;
|
||||
# cd website;
|
||||
# git config --global user.name "${GH_NAME}";
|
||||
# git config --global user.email "${GH_EMAIL}";
|
||||
# echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc;
|
||||
# yarn install;
|
||||
# GIT_USER="${GH_NAME}" yarn run publish-gh-pages;
|
||||
# fi;
|
||||
#
|
||||
env:
|
||||
- DOCKER_GENERATOR_IMAGE_NAME=openapitools/openapi-generator-online DOCKER_CODEGEN_CLI_IMAGE_NAME=openapitools/openapi-generator-cli NODE_ENV=test CC=gcc-5 CXX=g++-5
|
||||
|
||||
|
||||
@@ -91,6 +91,7 @@ elif [ "$NODE_INDEX" = "3" ]; then
|
||||
#(cd samples/openapi3/client/petstore/typescript/tests/deno && mvn integration-test)
|
||||
(cd samples/openapi3/client/petstore/typescript/builds/browser && mvn integration-test)
|
||||
(cd samples/openapi3/client/petstore/typescript/tests/browser && mvn integration-test)
|
||||
(cd samples/openapi3/client/petstore/typescript/builds/nullable-enum && mvn integration-test)
|
||||
(cd samples/client/petstore/typescript-fetch/builds/default && mvn integration-test)
|
||||
(cd samples/client/petstore/typescript-fetch/builds/es6-target && mvn integration-test)
|
||||
(cd samples/client/petstore/typescript-fetch/builds/with-npm-version && mvn integration-test)
|
||||
@@ -114,6 +115,7 @@ else
|
||||
(cd samples/client/petstore/java/jersey2-java8 && mvn integration-test)
|
||||
(cd samples/openapi3/client/petstore/java/jersey2-java8 && mvn integration-test)
|
||||
(cd samples/client/petstore/java/jersey3 && mvn integration-test)
|
||||
(cd samples/client/petstore/java/jersey3-oneOf && mvn integration-test)
|
||||
(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)
|
||||
|
||||
64
README.md
64
README.md
@@ -15,7 +15,7 @@
|
||||
|
||||
<div align="center">
|
||||
|
||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.9.0`):
|
||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.10.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)
|
||||
@@ -72,6 +72,7 @@ If you find OpenAPI Generator useful for work, please consider asking your compa
|
||||
[<img src="https://openapi-generator.tech/img/companies/itm.png" width="128" height="128">](https://opensource.muenchen.de?utm_source=openapi-generator&utm_medium=sponsorship&utm_campaign=oss-sponsorship)
|
||||
[<img src="https://openapi-generator.tech/img/companies/kong.png" width="128" height="128">](https://konghq.com/products/kong-konnect?utm_medium=referral&utm_source=github&utm_campaign=platform&utm_content=openapi-generator)
|
||||
[<img src="https://openapi-generator.tech/img/companies/route4me.png" width="128" height="128">](https://route4me.com/?utm_source=openapi-generator&utm_medium=sponsorship&utm_campaign=oss-sponsorship)
|
||||
[<img src="https://openapi-generator.tech/img/companies/dm.png" width="128" height="128">](https://www.dotcom-monitor.com/sponsoring-open-source-projects/?utm_source=openapi-generator&utm_medium=sponsorship&utm_campaign=oss-sponsorship)
|
||||
|
||||
#### Thank you GoDaddy for sponsoring the domain names, Linode for sponsoring the VPS, Checkly for sponsoring the API monitoring and Gradle for sponsoring Develocity
|
||||
|
||||
@@ -86,7 +87,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se
|
||||
|
||||
| | Languages/Frameworks |
|
||||
| -------------------------------- |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.1, .NET Core 3.1, .NET 5.0. Libraries: RestSharp, GenericHost, HttpClient), **C++** (Arduino, cpp-restsdk, Qt5, Tizen, Unreal Engine 4), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Apache HttpClient 4.x, Apache HttpClient 5.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, Spring 6 RestClient, MicroProfile Rest Client, Helidon), **Jetbrains HTTP Client**, **Julia**, **k6**, **Kotlin**, **Lua**, **N4JS**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types, Apollo GraphQL DataStore), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (hyper, reqwest, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient, pekko), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (9.x - 18.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs), **XoJo**, **Zapier** |
|
||||
| **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.1, .NET Core 3.1, .NET 5.0. Libraries: RestSharp, GenericHost, HttpClient), **C++** (Arduino, cpp-restsdk, Qt5, Tizen, Unreal Engine 4), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Apache HttpClient 4.x, Apache HttpClient 5.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, Spring 6 RestClient, MicroProfile Rest Client, Helidon), **Jetbrains HTTP Client**, **Julia**, **k6**, **Kotlin**, **Lua**, **N4JS**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types, Apollo GraphQL DataStore), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (hyper, reqwest, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient, pekko), **Swift** (2.x, 3.x, 4.x, 5.x, 6.x), **Typescript** (AngularJS, Angular (9.x - 18.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs), **XoJo**, **Zapier** |
|
||||
| **Server stubs** | **Ada**, **C#** (ASP.NET Core, Azure Functions), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin, Echo), **Haskell** (Servant, Yesod), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/), [Apache Camel](https://camel.apache.org/), [Helidon](https://helidon.io/)), **Julia**, **Kotlin** (Spring Boot, [Ktor](https://github.com/ktorio/ktor), [Vert.x](https://vertx.io/)), **PHP** ([Flight](https://docs.flightphp.com/), Laravel, Lumen, [Mezzio (fka Zend Expressive)](https://github.com/mezzio/mezzio), Slim, Silex, [Symfony](https://symfony.com/)), **Python** (FastAPI, Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** ([rust-server](https://openapi-generator.tech/docs/generators/rust-server/)), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), [Cask](https://github.com/com-lihaoyi/cask), Scalatra) |
|
||||
| **API documentation generators** | **HTML**, **Confluence Wiki**, **Asciidoc**, **Markdown**, **PlantUML** |
|
||||
| **Configuration files** | [**Apache2**](https://httpd.apache.org/) |
|
||||
@@ -128,7 +129,8 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
|
||||
|
||||
| OpenAPI Generator Version | Release Date | Notes |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- |
|
||||
| 7.9.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.9.0-SNAPSHOT/) | 23.09.2024 | Minor release with breaking changes (with fallback) |
|
||||
| 7.10.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.10.0-SNAPSHOT/) | 07.11.2024 | Minor release with breaking changes (with fallback) |
|
||||
| [7.9.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.9.0) (latest stable release) | 07.10.2024 | Minor release with breaking changes (with fallback) |
|
||||
| [7.8.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.8.0) (latest stable release) | 19.08.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) |
|
||||
@@ -192,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.8.0/openapi-generator-cli-7.8.0.jar`
|
||||
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.9.0/openapi-generator-cli-7.9.0.jar`
|
||||
|
||||
For **Mac/Linux** users:
|
||||
```sh
|
||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.8.0/openapi-generator-cli-7.8.0.jar -O openapi-generator-cli.jar
|
||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.9.0/openapi-generator-cli-7.9.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.8.0/openapi-generator-cli-7.8.0.jar
|
||||
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.9.0/openapi-generator-cli-7.9.0.jar
|
||||
```
|
||||
|
||||
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
|
||||
@@ -436,7 +438,7 @@ openapi-generator-cli version
|
||||
To use a specific version of "openapi-generator-cli"
|
||||
|
||||
```sh
|
||||
openapi-generator-cli version-manager set 7.8.0
|
||||
openapi-generator-cli version-manager set 7.9.0
|
||||
```
|
||||
|
||||
Or install it as dev-dependency:
|
||||
@@ -446,41 +448,7 @@ npm install @openapitools/openapi-generator-cli -D
|
||||
```
|
||||
<!-- /RELEASE_VERSION -->
|
||||
|
||||
#### Use locally built JAR
|
||||
In order to use a locally built jar of the generator CLI, you can copy the jar from your local build (i.e. if you were to `build` this repository it would be in `~/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar`) into `./node_modules/@openapitools/openapi-generator-cli/versions/` and change the `version` in the `openapitools.json` file to the base name of the jar file.
|
||||
E.g.:
|
||||
```sh
|
||||
cd openapi-generator
|
||||
./mvnw clean package
|
||||
cp ./modules/openapi-generator-cli/target/openapi-generator-cli.jar /your/project/node_modules/@openapitools/openapi-generator-cli/versions/my-local-snapshot.jar
|
||||
```
|
||||
and then:
|
||||
```json
|
||||
{
|
||||
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
|
||||
"spaces": 2,
|
||||
"generator-cli": {
|
||||
"version": "my-local-snapshot",
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Use nightly `SNAPSHOT` build
|
||||
Change your `openapitools.json` to:
|
||||
|
||||
```json
|
||||
{
|
||||
"$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
|
||||
"spaces": 2,
|
||||
"generator-cli": {
|
||||
"version": "7.9.0-20240829.123431-22",
|
||||
"repository": {
|
||||
"downloadUrl": "https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.9.0-SNAPSHOT/openapi-generator-cli-${versionName}.jar"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
(example is with a snapshot of `7.9.0`, please change the `version` and `downloadUrl` accordingly)
|
||||
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.
|
||||
|
||||
## [2 - Getting Started](#table-of-contents)
|
||||
|
||||
@@ -497,7 +465,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.8.0/openapi-generator-cli-7.8.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.9.0/openapi-generator-cli-7.9.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`
|
||||
@@ -1078,10 +1046,12 @@ Here is a list of template creators:
|
||||
* Scala (sttp): @chameleon82
|
||||
* Scala (sttp4): @flsh86
|
||||
* Scala (Pekko): @mickaelmagniez
|
||||
* Scala (http4s): @JennyLeahy
|
||||
* Swift: @tkqubo
|
||||
* Swift 3: @hexelon
|
||||
* Swift 4: @ehyche
|
||||
* Swift 5: @4brunu
|
||||
* Swift 6: @4brunu
|
||||
* Swift Combine: @dydus0x14
|
||||
* TypeScript (Angular1): @mhardorf
|
||||
* TypeScript (Angular2): @roni-frantchi
|
||||
@@ -1107,7 +1077,7 @@ Here is a list of template creators:
|
||||
* C++ (Qt5 QHttpEngine): @etherealjoy
|
||||
* C++ Pistache: @sebymiano
|
||||
* C++ Restbed: @stkrwork
|
||||
* Erlang Server: @galaxie
|
||||
* Erlang Server: @galaxie @nelsonvides
|
||||
* F# (Giraffe) Server: @nmfisher
|
||||
* Go Server: @guohuang
|
||||
* Go Server (refactored in 7.0.0): @lwj5
|
||||
@@ -1218,7 +1188,7 @@ If you want to join the committee, please kindly apply by sending an email to te
|
||||
| Eiffel | @jvelilla (2017/09) |
|
||||
| Elixir | @mrmstn (2018/12) |
|
||||
| Elm | @eriktim (2018/09) |
|
||||
| Erlang | @tsloughter (2017/11) @jfacorro (2018/10) @robertoaloi (2018/10) |
|
||||
| Erlang | @tsloughter (2017/11) @jfacorro (2018/10) @robertoaloi (2018/10) @nelsonvides (2024/09) |
|
||||
| F# | @nmfisher (2019/05) |
|
||||
| Go | @antihax (2017/11) @grokify (2018/07) @kemokemo (2018/09) @jirikuncar (2021/01) @ph4r5h4d (2021/04) @lwj5 (2023/04) |
|
||||
| GraphQL | @renepardon (2018/12) |
|
||||
@@ -1229,7 +1199,7 @@ If you want to join the committee, please kindly apply by sending an email to te
|
||||
| JMeter | @kannkyo (2021/01) |
|
||||
| Jetbrains HTTP Client | @jlengrand (2023/01) |
|
||||
| Julia | @tanmaykm (2023/01) |
|
||||
| Kotlin | @dr4ke616 (2018/08) @karismann (2019/03) @Zomzog (2019/04) @andrewemery (2019/10) @4brunu (2019/11) @yutaka0m (2020/03) @stefankoppier (2022/06) |
|
||||
| Kotlin | @dr4ke616 (2018/08) @karismann (2019/03) @Zomzog (2019/04) @andrewemery (2019/10) @4brunu (2019/11) @yutaka0m (2020/03) @stefankoppier (2022/06) @e5l (2024/10) |
|
||||
| Lua | @daurnimator (2017/08) |
|
||||
| N4JS | @mmews-n4 (2023/03) |
|
||||
| Nim | |
|
||||
@@ -1245,7 +1215,7 @@ If you want to join the committee, please kindly apply by sending an email to te
|
||||
| Rust | @frol (2017/07) @farcaller (2017/08) @richardwhiuk (2019/07) @paladinzh (2020/05) @jacob-pro (2022/10) |
|
||||
| Scala | @clasnake (2017/07), @shijinkui (2018/01), @ramzimaalej (2018/03), @chameleon82 (2020/03), @Bouillie (2020/04) @fish86 (2023/06) |
|
||||
| Swift | @jgavris (2017/07) @ehyche (2017/08) @Edubits (2017/09) @jaz-ah (2017/09) @4brunu (2019/11) @dydus0x14 (2023/06) |
|
||||
| TypeScript | @TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) @macjohnny (2018/01) @topce (2018/10) @akehir (2019/07) @petejohansonxo (2019/11) @amakhrov (2020/02) @davidgamero (2022/03) @mkusaka (2022/04) |
|
||||
| TypeScript | @TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) @macjohnny (2018/01) @topce (2018/10) @akehir (2019/07) @petejohansonxo (2019/11) @amakhrov (2020/02) @davidgamero (2022/03) @mkusaka (2022/04) @joscha (2024/10) |
|
||||
| Xojo | @Topheee (2023/04) |
|
||||
|
||||
|
||||
|
||||
4
bin/configs/avro-schema-enums.yaml
Normal file
4
bin/configs/avro-schema-enums.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
generatorName: avro-schema
|
||||
outputDir: samples/openapi3/schema/valid-enums/avro-schema-enum
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/avro-schema/valid-enums.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/avro-schema
|
||||
@@ -2,3 +2,6 @@ generatorName: avro-schema
|
||||
outputDir: samples/openapi3/schema/petstore/avro-schema
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/avro-schema/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/avro-schema
|
||||
additionalProperties:
|
||||
useLogicalTypes: true
|
||||
logicalTypeTimeQuantifier: nanos
|
||||
|
||||
10
bin/configs/csharp-generichost-tags-latest.yaml
Normal file
10
bin/configs/csharp-generichost-tags-latest.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/generichost/latest/Tags
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/tags.json
|
||||
library: generichost
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
modelPropertySorting: alphabetical
|
||||
operationParameterSorting: alphabetical
|
||||
4
bin/configs/erlang-server-echo.yaml
Normal file
4
bin/configs/erlang-server-echo.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
generatorName: erlang-server
|
||||
outputDir: samples/server/echo_api/erlang-server
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/echo_api.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/erlang-server
|
||||
@@ -2,6 +2,7 @@ generatorName: java-helidon-client
|
||||
library: mp
|
||||
outputDir: samples/client/petstore/java-helidon-client/v3/mp
|
||||
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-helidon/client
|
||||
additionalProperties:
|
||||
helidonVersion: 3.2.7
|
||||
artifactId: petstore-helidon-client-mp
|
||||
|
||||
@@ -2,6 +2,7 @@ generatorName: java-helidon-client
|
||||
library: mp
|
||||
outputDir: samples/client/petstore/java-helidon-client/v4/mp
|
||||
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-helidon/client
|
||||
additionalProperties:
|
||||
helidonVersion: 4.0.11
|
||||
artifactId: petstore-helidon-client-mp
|
||||
|
||||
@@ -2,6 +2,7 @@ generatorName: java-helidon-client
|
||||
library: se
|
||||
outputDir: samples/client/petstore/java-helidon-client/v3/se
|
||||
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-helidon/client
|
||||
additionalProperties:
|
||||
helidonVersion: 3.2.7
|
||||
artifactId: petstore-helidon-client-se
|
||||
|
||||
@@ -2,6 +2,7 @@ generatorName: java-helidon-client
|
||||
library: se
|
||||
outputDir: samples/client/petstore/java-helidon-client/v4/se
|
||||
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-helidon/client
|
||||
additionalProperties:
|
||||
helidonVersion: 4.0.11
|
||||
artifactId: petstore-helidon-client-se
|
||||
|
||||
@@ -10,4 +10,4 @@ additionalProperties:
|
||||
build: "all"
|
||||
test: "spock"
|
||||
useAuth: "false"
|
||||
fullProject: "true"
|
||||
fullProject: "true"
|
||||
|
||||
@@ -7,4 +7,4 @@ additionalProperties:
|
||||
helidonVersion: 3.2.7
|
||||
artifactId: format-helidon-server-mp
|
||||
hideGenerationTimestamp: "true"
|
||||
fullProject: "true"
|
||||
fullProject: "true"
|
||||
|
||||
7
bin/configs/java-jersey3-oneOf.yaml
Normal file
7
bin/configs/java-jersey3-oneOf.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
generatorName: java
|
||||
outputDir: samples/client/petstore/java/jersey3-oneOf
|
||||
library: jersey3
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOf_additionalProperties.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/Java
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: true
|
||||
@@ -1,6 +1,7 @@
|
||||
generatorName: java-micronaut-client
|
||||
outputDir: samples/client/petstore/java-micronaut-client/
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/java-micronaut/
|
||||
additionalProperties:
|
||||
artifactId: petstore-micronaut
|
||||
hideGenerationTimestamp: "true"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
generatorName: java-micronaut-server
|
||||
outputDir: samples/server/petstore/java-micronaut-server/
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/java-micronaut/
|
||||
additionalProperties:
|
||||
artifactId: petstore-micronaut-server
|
||||
hideGenerationTimestamp: "true"
|
||||
|
||||
8
bin/configs/java-okhttp-gson-oneOf-array.yaml
Normal file
8
bin/configs/java-okhttp-gson-oneOf-array.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
generatorName: java
|
||||
outputDir: samples/client/others/java/okhttp-gson-oneOf-array
|
||||
library: okhttp-gson
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOf_array.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/Java
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
useBeanValidation: "true"
|
||||
@@ -5,6 +5,7 @@ templateDir: modules/openapi-generator/src/main/resources/kotlin-client
|
||||
additionalProperties:
|
||||
artifactId: kotlin-petstore-string
|
||||
serializableModel: "true"
|
||||
mapFileBinaryToByteArray: "true"
|
||||
sortModelPropertiesByRequiredFlag: "false"
|
||||
sortParamsByRequiredFlag: "false"
|
||||
dateLibrary: string
|
||||
|
||||
11
bin/configs/rust-reqwest-petstore-async-tokensource.yaml
Normal file
11
bin/configs/rust-reqwest-petstore-async-tokensource.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
generatorName: rust
|
||||
outputDir: samples/client/petstore/rust/reqwest/petstore-async-tokensource
|
||||
library: reqwest
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/rust/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/rust
|
||||
additionalProperties:
|
||||
supportAsync: true
|
||||
supportTokenSource: true
|
||||
supportMultipleResponses: true
|
||||
packageName: petstore-reqwest-async-tokensource
|
||||
useSingleRequestParameter: true
|
||||
6
bin/configs/scala-http4s.yaml
Normal file
6
bin/configs/scala-http4s.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
generatorName: scala-http4s
|
||||
outputDir: samples/client/petstore/scala-http4s
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/scala-http4s/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/scala-http4s
|
||||
additionalProperties:
|
||||
artifactId: scala-http4s-client
|
||||
@@ -1,10 +0,0 @@
|
||||
generatorName: swift5
|
||||
outputDir: samples/client/petstore/swift5/anycodableLibrary
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/any_codable.yaml
|
||||
modelNamePrefix: Prefix
|
||||
modelNameSuffix: Suffix
|
||||
additionalProperties:
|
||||
podAuthors: ""
|
||||
podSummary: PetstoreClient
|
||||
projectName: PetstoreClient
|
||||
podHomepage: https://github.com/openapitools/openapi-generator
|
||||
@@ -1,10 +0,0 @@
|
||||
generatorName: swift5
|
||||
outputDir: samples/client/petstore/swift5/deprecated
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-deprecated-fields.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/swift5
|
||||
generateAliasAsModel: true
|
||||
additionalProperties:
|
||||
podAuthors: ""
|
||||
podSummary: PetstoreClient
|
||||
projectName: PetstoreClient
|
||||
podHomepage: https://github.com/openapitools/openapi-generator
|
||||
@@ -7,5 +7,19 @@ additionalProperties:
|
||||
responseAs: Result
|
||||
podAuthors: ""
|
||||
podSummary: PetstoreClient
|
||||
sortParamsByRequiredFlag: false
|
||||
enumUnknownDefaultCase: true
|
||||
nonPublicApi: true
|
||||
readonlyProperties: true
|
||||
hashableModels: false
|
||||
projectName: PetstoreClient
|
||||
podHomepage: https://github.com/openapitools/openapi-generator
|
||||
nameMappings:
|
||||
_type: underscoreType
|
||||
type_: typeWithUnderscore
|
||||
-type: dashType
|
||||
parameterNameMappings:
|
||||
_type: underscoreType
|
||||
type_: typeWithUnderscore
|
||||
-type: dashType
|
||||
|
||||
|
||||
13
bin/configs/swift6-alamofireLibrary.yaml
Normal file
13
bin/configs/swift6-alamofireLibrary.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
generatorName: swift6
|
||||
outputDir: samples/client/petstore/swift6/alamofireLibrary
|
||||
library: alamofire
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/swift6
|
||||
generateAliasAsModel: true
|
||||
useCustomDateWithoutTime: true
|
||||
additionalProperties:
|
||||
responseAs: ObjcBlock
|
||||
podAuthors: ""
|
||||
podSummary: PetstoreClient
|
||||
projectName: PetstoreClient
|
||||
podHomepage: https://github.com/openapitools/openapi-generator
|
||||
13
bin/configs/swift6-api-non-static-method.yaml
Normal file
13
bin/configs/swift6-api-non-static-method.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
generatorName: swift6
|
||||
outputDir: samples/client/petstore/swift6/apiNonStaticMethod
|
||||
library: alamofire
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/swift6
|
||||
additionalProperties:
|
||||
responseAs: AsyncAwait,Combine,Result,PromiseKit,RxSwift,ObjcBlock
|
||||
apiStaticMethod: false
|
||||
mapFileBinaryToData: true
|
||||
podAuthors: ""
|
||||
podSummary: PetstoreClient
|
||||
projectName: PetstoreClient
|
||||
podHomepage: https://github.com/openapitools/openapi-generator
|
||||
@@ -1,11 +1,11 @@
|
||||
generatorName: swift5
|
||||
outputDir: samples/client/petstore/swift5/x-swift-hashable
|
||||
generatorName: swift6
|
||||
outputDir: samples/client/petstore/swift6/asyncAwaitLibrary
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/swift5
|
||||
templateDir: modules/openapi-generator/src/main/resources/swift6
|
||||
generateAliasAsModel: true
|
||||
additionalProperties:
|
||||
responseAs: AsyncAwait
|
||||
podAuthors: ""
|
||||
podSummary: PetstoreClient
|
||||
projectName: PetstoreClient
|
||||
podHomepage: https://github.com/openapitools/openapi-generator
|
||||
hashableModels: false
|
||||
@@ -1,12 +1,12 @@
|
||||
generatorName: swift5
|
||||
outputDir: samples/client/petstore/swift5/frozenEnums
|
||||
generatorName: swift6
|
||||
outputDir: samples/client/petstore/swift6/combineDeferredLibrary
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/swift5
|
||||
templateDir: modules/openapi-generator/src/main/resources/swift6
|
||||
generateAliasAsModel: true
|
||||
additionalProperties:
|
||||
responseAs: Combine
|
||||
useSPMFileStructure: false
|
||||
podAuthors: ""
|
||||
podSummary: PetstoreClient
|
||||
sortParamsByRequiredFlag: false
|
||||
enumUnknownDefaultCase: true
|
||||
projectName: PetstoreClient
|
||||
podHomepage: https://github.com/openapitools/openapi-generator
|
||||
13
bin/configs/swift6-combineLibrary.yaml
Normal file
13
bin/configs/swift6-combineLibrary.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
generatorName: swift6
|
||||
outputDir: samples/client/petstore/swift6/combineLibrary
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/swift6
|
||||
generateAliasAsModel: true
|
||||
additionalProperties:
|
||||
responseAs: Combine
|
||||
combineDeferred: false
|
||||
swiftPackagePath: "Sources/CombineLibrary"
|
||||
podAuthors: ""
|
||||
podSummary: PetstoreClient
|
||||
projectName: PetstoreClient
|
||||
podHomepage: https://github.com/openapitools/openapi-generator
|
||||
12
bin/configs/swift6-default.yaml
Normal file
12
bin/configs/swift6-default.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
generatorName: swift6
|
||||
outputDir: samples/client/petstore/swift6/default
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/swift6
|
||||
generateAliasAsModel: true
|
||||
additionalProperties:
|
||||
podAuthors: ""
|
||||
podSummary: PetstoreClient
|
||||
projectName: PetstoreClient
|
||||
podHomepage: https://github.com/openapitools/openapi-generator
|
||||
enumNameMappings:
|
||||
delivered: shipped
|
||||
@@ -1,11 +1,12 @@
|
||||
generatorName: swift5
|
||||
outputDir: samples/client/petstore/swift5/readonlyProperties
|
||||
generatorName: swift6
|
||||
outputDir: samples/client/petstore/swift6/objcCompatible
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/swift5
|
||||
templateDir: modules/openapi-generator/src/main/resources/swift6
|
||||
generateAliasAsModel: true
|
||||
additionalProperties:
|
||||
responseAs: ObjcBlock
|
||||
podAuthors: ""
|
||||
podSummary: PetstoreClient
|
||||
readonlyProperties: true
|
||||
objcCompatible: true
|
||||
projectName: PetstoreClient
|
||||
podHomepage: https://github.com/openapitools/openapi-generator
|
||||
12
bin/configs/swift6-oneOf.yaml
Normal file
12
bin/configs/swift6-oneOf.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
generatorName: swift6
|
||||
outputDir: samples/client/petstore/swift6/oneOf
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOf.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/swift6
|
||||
generateAliasAsModel: true
|
||||
additionalProperties:
|
||||
responseAs: ObjcBlock
|
||||
useSPMFileStructure: false
|
||||
podAuthors: ""
|
||||
podSummary: PetstoreClient
|
||||
projectName: PetstoreClient
|
||||
podHomepage: https://github.com/openapitools/openapi-generator
|
||||
12
bin/configs/swift6-promisekitLibrary.yaml
Normal file
12
bin/configs/swift6-promisekitLibrary.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
generatorName: swift6
|
||||
outputDir: samples/client/petstore/swift6/promisekitLibrary
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/swift6
|
||||
generateAliasAsModel: true
|
||||
additionalProperties:
|
||||
useSPMFileStructure: false
|
||||
responseAs: PromiseKit
|
||||
podAuthors: ""
|
||||
podSummary: PetstoreClient
|
||||
projectName: PetstoreClient
|
||||
podHomepage: https://github.com/openapitools/openapi-generator
|
||||
@@ -1,13 +1,18 @@
|
||||
generatorName: swift5
|
||||
outputDir: samples/client/petstore/swift5/nonPublicApi
|
||||
generatorName: swift6
|
||||
outputDir: samples/client/petstore/swift6/resultLibrary
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/swift5
|
||||
templateDir: modules/openapi-generator/src/main/resources/swift6
|
||||
generateAliasAsModel: true
|
||||
additionalProperties:
|
||||
responseAs: Result
|
||||
useSPMFileStructure: false
|
||||
podAuthors: ""
|
||||
podSummary: PetstoreClient
|
||||
sortParamsByRequiredFlag: false
|
||||
enumUnknownDefaultCase: true
|
||||
nonPublicApi: true
|
||||
readonlyProperties: true
|
||||
hashableModels: false
|
||||
projectName: PetstoreClient
|
||||
podHomepage: https://github.com/openapitools/openapi-generator
|
||||
nameMappings:
|
||||
14
bin/configs/swift6-rxswiftLibrary.yaml
Normal file
14
bin/configs/swift6-rxswiftLibrary.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
generatorName: swift6
|
||||
outputDir: samples/client/petstore/swift6/rxswiftLibrary
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/swift6
|
||||
generateAliasAsModel: true
|
||||
additionalProperties:
|
||||
responseAs: RxSwift
|
||||
useSPMFileStructure: false
|
||||
podAuthors: ""
|
||||
podSummary: PetstoreClient
|
||||
projectName: PetstoreClient
|
||||
podHomepage: https://github.com/openapitools/openapi-generator
|
||||
useBacktickEscapes: true
|
||||
generateModelAdditionalProperties: false
|
||||
16
bin/configs/swift6-urlsessionLibrary.yaml
Normal file
16
bin/configs/swift6-urlsessionLibrary.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
generatorName: swift6
|
||||
outputDir: samples/client/petstore/swift6/urlsessionLibrary
|
||||
library: urlsession
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/swift6
|
||||
generateAliasAsModel: true
|
||||
additionalProperties:
|
||||
responseAs: ObjcBlock
|
||||
podAuthors: ""
|
||||
podSummary: PetstoreClient
|
||||
projectName: PetstoreClient
|
||||
podHomepage: https://github.com/openapitools/openapi-generator
|
||||
useSPMFileStructure: true
|
||||
mapFileBinaryToData: true
|
||||
useClasses: true
|
||||
swiftUseApiNamespace: true
|
||||
11
bin/configs/swift6-validation.yaml
Normal file
11
bin/configs/swift6-validation.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
generatorName: swift6
|
||||
outputDir: samples/client/petstore/swift6/validation
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/validation.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/swift6
|
||||
generateAliasAsModel: true
|
||||
additionalProperties:
|
||||
useSPMFileStructure: false
|
||||
podAuthors: ""
|
||||
podSummary: PetstoreClient
|
||||
projectName: PetstoreClient
|
||||
podHomepage: https://github.com/openapitools/openapi-generator
|
||||
12
bin/configs/swift6-vapor.yaml
Normal file
12
bin/configs/swift6-vapor.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
generatorName: swift6
|
||||
outputDir: samples/client/petstore/swift6/vaporLibrary
|
||||
library: vapor
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/swift6
|
||||
generateAliasAsModel: true
|
||||
additionalProperties:
|
||||
projectName: PetstoreClient
|
||||
useSPMFileStructure: true
|
||||
useClasses: true
|
||||
useBacktickEscapes: true
|
||||
mapFileBinaryToData: true
|
||||
4
bin/configs/typescript-consolidated-array-of-lists.yaml
Normal file
4
bin/configs/typescript-consolidated-array-of-lists.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
generatorName: typescript
|
||||
outputDir: samples/client/others/typescript/builds/array-of-lists
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/typescript/array_list.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/typescript
|
||||
4
bin/configs/typescript-consolidated-nullable-enum.yaml
Normal file
4
bin/configs/typescript-consolidated-nullable-enum.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
generatorName: typescript
|
||||
outputDir: samples/openapi3/client/petstore/typescript/builds/nullable-enum
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/typescript/19027-regression.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/typescript
|
||||
4
bin/configs/typescript-consolidated-nullable.yaml
Normal file
4
bin/configs/typescript-consolidated-nullable.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
generatorName: typescript
|
||||
outputDir: samples/client/others/typescript/builds/null-types-simple
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_1/null-types-simple.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/typescript
|
||||
@@ -0,0 +1,4 @@
|
||||
generatorName: typescript
|
||||
outputDir: samples/client/others/typescript/builds/enum-single-value
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_1/enum-single-value.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/typescript
|
||||
11
bin/configs/typescript-encode-decode.yaml
Normal file
11
bin/configs/typescript-encode-decode.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
generatorName: typescript
|
||||
outputDir: samples/client/others/typescript/encode-decode/build
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_1/encode-decode.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/typescript
|
||||
additionalProperties:
|
||||
artifactId: encode-decode-typescript
|
||||
hideGenerationTimestamp: "true"
|
||||
npmVersion: 1.0.0
|
||||
npmName: '@openapitools/typescript-encode-decode'
|
||||
nullSafeAdditionalProps: true
|
||||
platform: node
|
||||
4
bin/configs/typescript-node-3.0.yaml
Normal file
4
bin/configs/typescript-node-3.0.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
generatorName: typescript-node
|
||||
outputDir: samples/client/petstore/typescript-node/3_0
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/typescript-node/SampleProject.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/typescript-node
|
||||
10
bin/configs/typescript-node-encode-decode.yaml
Normal file
10
bin/configs/typescript-node-encode-decode.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
generatorName: typescript-node
|
||||
outputDir: samples/client/others/typescript-node/encode-decode/build
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_1/encode-decode.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/typescript-node
|
||||
additionalProperties:
|
||||
artifactId: encode-decode-typescript-node
|
||||
hideGenerationTimestamp: "true"
|
||||
npmVersion: 1.0.0
|
||||
npmName: '@openapitools/typescript-node-encode-decode'
|
||||
nullSafeAdditionalProps: true
|
||||
11
bitrise.yml
11
bitrise.yml
@@ -18,6 +18,15 @@ workflows:
|
||||
#!/usr/bin/env bash
|
||||
|
||||
sudo gem install cocoapods
|
||||
- script@1.2.0:
|
||||
title: Run Swift6 tests
|
||||
inputs:
|
||||
- content: |
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
./samples/client/petstore/swift6/swift6_test_all.sh
|
||||
- script@1.2.0:
|
||||
title: Run Swift5 tests
|
||||
inputs:
|
||||
@@ -39,4 +48,4 @@ workflows:
|
||||
|
||||
meta:
|
||||
bitrise.io:
|
||||
stack: osx-xcode-14.3.x-ventura
|
||||
stack: osx-xcode-16.0.x
|
||||
|
||||
@@ -201,6 +201,23 @@ The steps are shown here for a specific version of the generator, but apply the
|
||||
```
|
||||
* Set breakpoints in code, and then attach your remote debugger from your IDE (see above). The generator will automatically unblock once the remote debugger is attached. You can now step through the code.
|
||||
|
||||
For VSCode you can use the following launch configuration (`launch.json`):
|
||||
```json
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "java",
|
||||
"name": "Debug (Attach)",
|
||||
"request": "attach",
|
||||
"hostName": "localhost",
|
||||
"port": 5005
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
to attach the the suspended process above.
|
||||
|
||||
## Logs
|
||||
|
||||
You can try to enable debugging log with `-Dlog.level=debug` option to the `JAVA_OPTS` environment variable to see more information:
|
||||
|
||||
@@ -92,16 +92,401 @@ git clone https://github.com/openapitools/openapi-generator.git
|
||||
cd openapi-generator/samples/client/petstore/swift/default/OpenAPIClientTests
|
||||
mvn integration-test
|
||||
```
|
||||
Besides `default` (folder), there's another folder `promisekit` for Swift API client with [PromiseKit support](https://github.com/mxcl/PromiseKit)
|
||||
|
||||
### Which Swift generator is still actively maintained?
|
||||
|
||||
Please use `swift5` generator because Swift 4.x is deprecated.
|
||||
There is a new `swift6` generator, that is currently in beta, try it and give us your feedback.
|
||||
|
||||
### How do I implement bearer token authentication with URLSession on the Swift 5 API client?
|
||||
|
||||
First you subclass RequestBuilderFactory
|
||||
|
||||
```
|
||||
git clone https://github.com/openapitools/openapi-generator.git
|
||||
cd openapi-generator/samples/client/petstore/swift/promisekit/OpenAPIClientTests
|
||||
mvn integration-test
|
||||
class BearerRequestBuilderFactory: RequestBuilderFactory {
|
||||
func getNonDecodableBuilder<T>() -> RequestBuilder<T>.Type {
|
||||
BearerRequestBuilder<T>.self
|
||||
}
|
||||
|
||||
func getBuilder<T: Decodable>() -> RequestBuilder<T>.Type {
|
||||
BearerDecodableRequestBuilder<T>.self
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Is Swift (2.x) generator still actively maintained?
|
||||
Then you subclass URLSessionRequestBuilder and URLSessionDecodableRequestBuilder
|
||||
```
|
||||
class BearerRequestBuilder<T>: URLSessionRequestBuilder<T> {
|
||||
@discardableResult
|
||||
override func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (Result<Response<T>, ErrorResponse>) -> Void) -> RequestTask {
|
||||
|
||||
// Before making the request, we can validate if we have a bearer token to be able to make a request
|
||||
BearerTokenHandler.refreshTokenIfDoesntExist {
|
||||
|
||||
// Here we make the request
|
||||
super.execute(apiResponseQueue) { result in
|
||||
|
||||
switch result {
|
||||
case .success:
|
||||
// If we got a successful response, we send the response to the completion block
|
||||
completion(result)
|
||||
|
||||
case let .failure(error):
|
||||
|
||||
// If we got a failure response, we will analyse the error to see what we should do with it
|
||||
if case let ErrorResponse.error(_, data, response, error) = error {
|
||||
|
||||
// If the error is an ErrorResponse.error() we will analyse it to see if it's a 401, and if it's a 401, we will refresh the token and retry the request
|
||||
BearerTokenHandler.refreshTokenIfUnauthorizedRequestResponse(
|
||||
data: data,
|
||||
response: response,
|
||||
error: error
|
||||
) { wasTokenRefreshed in
|
||||
|
||||
if wasTokenRefreshed {
|
||||
// If the token was refreshed, it's because it was a 401 error, so we refreshed the token, and we are going to retry the request by calling self.execute()
|
||||
self.execute(apiResponseQueue, completion)
|
||||
} else {
|
||||
// If the token was not refreshed, it's because it was not a 401 error, so we send the response to the completion block
|
||||
completion(result)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// If it's an unknown error, we send the response to the completion block
|
||||
completion(result)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return requestTask
|
||||
}
|
||||
}
|
||||
|
||||
class BearerDecodableRequestBuilder<T: Decodable>: URLSessionDecodableRequestBuilder<T> {
|
||||
@discardableResult
|
||||
override func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (Result<Response<T>, ErrorResponse>) -> Void) -> RequestTask {
|
||||
// Before making the request, we can validate if we have a bearer token to be able to make a request
|
||||
BearerTokenHandler.refreshTokenIfDoesntExist {
|
||||
|
||||
// Here we make the request
|
||||
super.execute(apiResponseQueue) { result in
|
||||
|
||||
switch result {
|
||||
case .success:
|
||||
// If we got a successful response, we send the response to the completion block
|
||||
completion(result)
|
||||
|
||||
case let .failure(error):
|
||||
|
||||
// If we got a failure response, we will analyse the error to see what we should do with it
|
||||
if case let ErrorResponse.error(_, data, response, error) = error {
|
||||
|
||||
// If the error is an ErrorResponse.error() we will analyse it to see if it's a 401, and if it's a 401, we will refresh the token and retry the request
|
||||
BearerTokenHandler.refreshTokenIfUnauthorizedRequestResponse(
|
||||
data: data,
|
||||
response: response,
|
||||
error: error
|
||||
) { wasTokenRefreshed in
|
||||
|
||||
if wasTokenRefreshed {
|
||||
// If the token was refreshed, it's because it was a 401 error, so we refreshed the token, and we are going to retry the request by calling self.execute()
|
||||
self.execute(apiResponseQueue, completion)
|
||||
} else {
|
||||
// If the token was not refreshed, it's because it was not a 401 error, so we send the response to the completion block
|
||||
completion(result)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// If it's an unknown error, we send the response to the completion block
|
||||
completion(result)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return requestTask
|
||||
}
|
||||
}
|
||||
|
||||
class BearerTokenHandler {
|
||||
private static var bearerToken: String? = nil
|
||||
|
||||
static func refreshTokenIfDoesntExist(completionHandler: @escaping () -> Void) {
|
||||
if bearerToken != nil {
|
||||
completionHandler()
|
||||
} else {
|
||||
startRefreshingToken {
|
||||
completionHandler()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static func refreshTokenIfUnauthorizedRequestResponse(data: Data?, response: URLResponse?, error: Error?, completionHandler: @escaping (Bool) -> Void) {
|
||||
if let response = response as? HTTPURLResponse, response.statusCode == 401 {
|
||||
startRefreshingToken {
|
||||
completionHandler(true)
|
||||
}
|
||||
} else {
|
||||
completionHandler(false)
|
||||
}
|
||||
}
|
||||
|
||||
private static func startRefreshingToken(completionHandler: @escaping () -> Void) {
|
||||
// Get a bearer token
|
||||
let dummyBearerToken = "..."
|
||||
|
||||
bearerToken = dummyBearerToken
|
||||
PetstoreClientAPI.customHeaders["Authorization"] = "Bearer \(dummyBearerToken)"
|
||||
|
||||
completionHandler()
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
No, please use `swift3` or `swift4` generator instead as we want to focus on Swift 3.x, 4.x.
|
||||
Then you assign the `BearerRequestBuilderFactory` to the property `requestBuilderFactory`.
|
||||
|
||||
`PetstoreClientAPI.requestBuilderFactory = BearerRequestBuilderFactory()`
|
||||
|
||||
The name `PetstoreClientAPI.requestBuilderFactory` will change depending on your project name.
|
||||
|
||||
Here is a working sample that put's together all of this.
|
||||
[AppDelegate.swift](https://github.com/OpenAPITools/openapi-generator/blob/master/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClient/AppDelegate.swift)
|
||||
[BearerDecodableRequestBuilder.swift](https://github.com/OpenAPITools/openapi-generator/blob/master/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClient/BearerDecodableRequestBuilder.swift)
|
||||
|
||||
### How do I implement bearer token authentication with Alamofire on the Swift 5 API client?
|
||||
|
||||
First you subclass RequestBuilderFactory
|
||||
|
||||
```
|
||||
class BearerRequestBuilderFactory: RequestBuilderFactory {
|
||||
func getNonDecodableBuilder<T>() -> RequestBuilder<T>.Type {
|
||||
BearerRequestBuilder<T>.self
|
||||
}
|
||||
|
||||
func getBuilder<T: Decodable>() -> RequestBuilder<T>.Type {
|
||||
BearerDecodableRequestBuilder<T>.self
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Then you subclass AlamofireRequestBuilder and AlamofireDecodableRequestBuilder
|
||||
```
|
||||
class BearerRequestBuilder<T>: AlamofireRequestBuilder<T> {
|
||||
override func createSessionManager() -> SessionManager {
|
||||
let sessionManager = super.createSessionManager()
|
||||
|
||||
let bearerTokenHandler = BearerTokenHandler()
|
||||
sessionManager.adapter = bearerTokenHandler
|
||||
sessionManager.retrier = bearerTokenHandler
|
||||
|
||||
return sessionManager
|
||||
}
|
||||
}
|
||||
|
||||
class BearerDecodableRequestBuilder<T: Decodable>: AlamofireDecodableRequestBuilder<T> {
|
||||
override func createSessionManager() -> SessionManager {
|
||||
let sessionManager = super.createSessionManager()
|
||||
|
||||
let bearerTokenHandler = BearerTokenHandler()
|
||||
sessionManager.adapter = bearerTokenHandler
|
||||
sessionManager.retrier = bearerTokenHandler
|
||||
|
||||
return sessionManager
|
||||
}
|
||||
}
|
||||
|
||||
class BearerTokenHandler: RequestAdapter, RequestRetrier {
|
||||
private static var bearerToken: String? = nil
|
||||
|
||||
func adapt(_ urlRequest: URLRequest) throws -> URLRequest {
|
||||
if let bearerToken = Self.bearerToken {
|
||||
var urlRequest = urlRequest
|
||||
urlRequest.setValue("Bearer \(bearerToken)", forHTTPHeaderField: "Authorization")
|
||||
return urlRequest
|
||||
}
|
||||
|
||||
return urlRequest
|
||||
}
|
||||
|
||||
func should(_: SessionManager, retry request: Request, with _: Error, completion: @escaping RequestRetryCompletion) {
|
||||
if let response = request.task?.response as? HTTPURLResponse, response.statusCode == 401 {
|
||||
Self.startRefreshingToken { isTokenRefreshed in
|
||||
completion(isTokenRefreshed, 0.0)
|
||||
}
|
||||
} else {
|
||||
completion(false, 0.0)
|
||||
}
|
||||
}
|
||||
|
||||
private static func startRefreshingToken(completionHandler: @escaping (Bool) -> Void) {
|
||||
// Get a bearer token
|
||||
let dummyBearerToken = "..."
|
||||
|
||||
bearerToken = dummyBearerToken
|
||||
PetstoreClientAPI.customHeaders["Authorization"] = "Bearer \(dummyBearerToken)"
|
||||
|
||||
completionHandler(true)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Then you assign the `BearerRequestBuilderFactory` to the property `requestBuilderFactory`.
|
||||
|
||||
`PetstoreClientAPI.requestBuilderFactory = BearerRequestBuilderFactory()`
|
||||
|
||||
The name `PetstoreClientAPI.requestBuilderFactory` will change depending on your project name.
|
||||
|
||||
Here is a working sample that put's together all of this.
|
||||
[AppDelegate.swift](https://github.com/OpenAPITools/openapi-generator/blob/master/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/SwaggerClient/AppDelegate.swift)
|
||||
[BearerTokenHandler.swift](https://github.com/OpenAPITools/openapi-generator/blob/master/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/SwaggerClient/BearerDecodableRequestBuilder.swift)
|
||||
|
||||
### How do I implement bearer token authentication with URLSession on the Swift 6 API client?
|
||||
|
||||
First you implement the `OpenAPIInterceptor` protocol.
|
||||
```
|
||||
public class BearerOpenAPIInterceptor: OpenAPIInterceptor {
|
||||
public init() {}
|
||||
|
||||
public func intercept(urlRequest: URLRequest, urlSession: URLSessionProtocol, openAPIClient: OpenAPIClient, completion: @escaping (Result<URLRequest, any Error>) -> Void) {
|
||||
refreshTokenIfDoesntExist { token in
|
||||
|
||||
// Change the current url request
|
||||
var newUrlRequest = urlRequest
|
||||
newUrlRequest.setValue("Bearer \(token)", forHTTPHeaderField: "Authorization")
|
||||
|
||||
// Change the global headers
|
||||
openAPIClient.customHeaders["Authorization"] = "Bearer \(token)"
|
||||
|
||||
completion(.success(newUrlRequest))
|
||||
}
|
||||
}
|
||||
|
||||
public func retry(urlRequest: URLRequest, urlSession: URLSessionProtocol, openAPIClient: OpenAPIClient, data: Data?, response: URLResponse, error: Error, completion: @escaping (OpenAPIInterceptorRetry) -> Void) {
|
||||
// We will analyse the response to see if it's a 401, and if it's a 401, we will refresh the token and retry the request
|
||||
refreshTokenIfUnauthorizedRequestResponse(
|
||||
data: data,
|
||||
response: response,
|
||||
error: error
|
||||
) { (wasTokenRefreshed, newToken) in
|
||||
|
||||
if wasTokenRefreshed, let newToken = newToken {
|
||||
|
||||
// Change the global headers
|
||||
openAPIClient.customHeaders["Authorization"] = "Bearer \(newToken)"
|
||||
|
||||
completion(.retry)
|
||||
} else {
|
||||
// If the token was not refreshed, it's because it was not a 401 error, so we send the response to the completion block
|
||||
completion(.dontRetry)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var bearerToken: String? = nil
|
||||
|
||||
func refreshTokenIfDoesntExist(completionHandler: @escaping (String) -> Void) {
|
||||
if let bearerToken = bearerToken {
|
||||
completionHandler(bearerToken)
|
||||
} else {
|
||||
startRefreshingToken { token in
|
||||
completionHandler(token)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func refreshTokenIfUnauthorizedRequestResponse(data: Data?, response: URLResponse, error: Error, completionHandler: @escaping (Bool, String?) -> Void) {
|
||||
if let response = response as? HTTPURLResponse, response.statusCode == 401 {
|
||||
startRefreshingToken { token in
|
||||
completionHandler(true, token)
|
||||
}
|
||||
} else {
|
||||
completionHandler(false, nil)
|
||||
}
|
||||
}
|
||||
|
||||
private func startRefreshingToken(completionHandler: @escaping (String) -> Void) {
|
||||
// Get a bearer token
|
||||
let dummyBearerToken = "..."
|
||||
|
||||
bearerToken = dummyBearerToken
|
||||
|
||||
completionHandler(dummyBearerToken)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Then you assign the `BearerOpenAPIInterceptor` to the property `OpenAPIClient.shared.interceptor`.
|
||||
|
||||
`OpenAPIClient.shared.interceptor = BearerOpenAPIInterceptor()`
|
||||
|
||||
Here is a working sample that put's together all of this.
|
||||
[AppDelegate.swift](https://github.com/OpenAPITools/openapi-generator/blob/master/samples/client/petstore/swift6/urlsessionLibrary/SwaggerClientTests/SwaggerClient/AppDelegate.swift)
|
||||
[BearerTokenHandler.swift](https://github.com/OpenAPITools/openapi-generator/blob/master/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClient/BearerDecodableRequestBuilder.swift)
|
||||
|
||||
### How do I implement bearer token authentication with Alamofire on the Swift 6 API client?
|
||||
|
||||
First implement the `Alamofire` `RequestInterceptor` protocol.
|
||||
```
|
||||
class BearerTokenHandler: RequestInterceptor, @unchecked Sendable {
|
||||
private var bearerToken: String? = nil
|
||||
|
||||
func adapt(_ urlRequest: URLRequest, for session: Session, completion: @escaping (Result<URLRequest, Error>) -> Void) {
|
||||
if let bearerToken = bearerToken {
|
||||
var urlRequest = urlRequest
|
||||
urlRequest.setValue("Bearer \(bearerToken)", forHTTPHeaderField: "Authorization")
|
||||
|
||||
completion(.success(urlRequest))
|
||||
return
|
||||
}
|
||||
|
||||
completion(.success(urlRequest))
|
||||
}
|
||||
|
||||
func retry(_ request: Request, for session: Session, dueTo error: Error, completion: @escaping (RetryResult) -> Void) {
|
||||
if let response = request.task?.response as? HTTPURLResponse, response.statusCode == 401 {
|
||||
startRefreshingToken { isTokenRefreshed in
|
||||
completion(.retry)
|
||||
}
|
||||
} else {
|
||||
completion(.doNotRetryWithError(error))
|
||||
}
|
||||
}
|
||||
|
||||
private func startRefreshingToken(completionHandler: @escaping (Bool) -> Void) {
|
||||
// Get a bearer token
|
||||
let dummyBearerToken = "..."
|
||||
|
||||
bearerToken = dummyBearerToken
|
||||
OpenAPIClient.shared.customHeaders["Authorization"] = "Bearer \(dummyBearerToken)"
|
||||
|
||||
completionHandler(true)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Then you assign the `BearerTokenHandler` to the property `OpenAPIClient.shared.interceptor`.
|
||||
|
||||
`OpenAPIClient.shared.interceptor = BearerTokenHandler()`
|
||||
|
||||
Here is a working sample that put's together all of this.
|
||||
[AppDelegate.swift](https://github.com/OpenAPITools/openapi-generator/blob/master/samples/client/petstore/swift6/alamofireLibrary/SwaggerClientTests/SwaggerClient/AppDelegate.swift)
|
||||
[BearerTokenHandler.swift](https://github.com/OpenAPITools/openapi-generator/blob/master/samples/client/petstore/swift6/alamofireLibrary/SwaggerClientTests/SwaggerClient/BearerTokenHandler.swift)
|
||||
|
||||
### How do I migrate from the Swift 5 generator to the swift 6 generator?
|
||||
|
||||
- Change the generator to the new `swift6` generator, e.g. `openapi-generator generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g swift6 -o /tmp/test/`
|
||||
- Check the `swift6` [URLSession](https://github.com/OpenAPITools/openapi-generator/tree/master/samples/client/petstore/swift6/urlsessionLibrary) and [Alamofire](https://github.com/OpenAPITools/openapi-generator/tree/master/samples/client/petstore/swift6/alamofireLibrary) samples.
|
||||
- The infrastructure files have been moved to a new directory called `Infrastructure`. Please delete the old ones.
|
||||
- The `AnyCodable` dependency has been removed and replaced with a new enum called `JSONValue`, allowing you to use this generator without external dependencies.
|
||||
- The `Combine` response is now deferred by default, meaning the request will only start when you begin listening to it. To restore the previous behavior, set the `combineDeferred` flag to `false`.
|
||||
- A new configuration, `apiStaticMethod`, allows you to use instance methods instead of class methods for API calls. For more information, check the sample project [apiNonStaticMethod](https://github.com/OpenAPITools/openapi-generator/tree/master/samples/client/petstore/swift6/apiNonStaticMethod).
|
||||
- The new default response is based on async/await. To revert to the previous behavior, set the `responseAs` flag to `ObjcBlock`.
|
||||
- The default project structure now follows the SPM (Swift Package Manager) structure. To revert to the old structure, set the `useSPMFileStructure` flag to `false`.
|
||||
- The former `{{projectName}}API` is now called `OpenAPIClient`.
|
||||
- You can now set a request interceptor and retrier by configuring `OpenAPIClient.shared.interceptor`, making authenticated requests easier to manage.
|
||||
|
||||
## TypeScript
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ Also refer to the relevant documentation for [CLI](./usage.md), [Maven Plugin](h
|
||||
The following environment variables are supported by their respective generators:
|
||||
<!-- query with: grep -Rn '_POST_PROCESS_FILE"' modules | grep -Eo '[^"]+_POST_PROCESS_FILE' | sort -u -->
|
||||
|
||||
* `AVRO_POST_PROCESS_FILE`
|
||||
* `CPP_POST_PROCESS_FILE`
|
||||
* `CSHARP_POST_PROCESS_FILE`
|
||||
* `C_POST_PROCESS_FILE`
|
||||
|
||||
@@ -59,12 +59,14 @@ The following generators are available:
|
||||
* [rust](generators/rust.md)
|
||||
* [scala-akka](generators/scala-akka.md)
|
||||
* [scala-gatling](generators/scala-gatling.md)
|
||||
* [scala-http4s](generators/scala-http4s.md)
|
||||
* [scala-pekko](generators/scala-pekko.md)
|
||||
* [scala-sttp](generators/scala-sttp.md)
|
||||
* [scala-sttp4 (beta)](generators/scala-sttp4.md)
|
||||
* [scalaz](generators/scalaz.md)
|
||||
* [swift-combine](generators/swift-combine.md)
|
||||
* [swift5](generators/swift5.md)
|
||||
* [swift6 (beta)](generators/swift6.md)
|
||||
* [typescript (experimental)](generators/typescript.md)
|
||||
* [typescript-angular](generators/typescript-angular.md)
|
||||
* [typescript-aurelia](generators/typescript-aurelia.md)
|
||||
@@ -89,6 +91,7 @@ The following generators are available:
|
||||
* [cpp-restbed-server-deprecated](generators/cpp-restbed-server-deprecated.md)
|
||||
* [csharp-functions](generators/csharp-functions.md)
|
||||
* [erlang-server](generators/erlang-server.md)
|
||||
* [erlang-server-deprecated (deprecated)](generators/erlang-server-deprecated.md)
|
||||
* [fsharp-functions (beta)](generators/fsharp-functions.md)
|
||||
* [fsharp-giraffe-server (beta)](generators/fsharp-giraffe-server.md)
|
||||
* [go-echo-server (beta)](generators/go-echo-server.md)
|
||||
|
||||
@@ -23,10 +23,12 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
||||
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|
||||
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|
||||
|logicalTypeTimeQuantifier|The quantifier for time-related logical types (`timestamp` and `local-timestamp`).|<dl><dt>**nanos**</dt><dd>nanoseconds</dd><dt>**micros**</dt><dd>microseconds</dd><dt>**millis**</dt><dd>milliseconds</dd></dl>|millis|
|
||||
|packageName|package for generated classes (where supported)| |null|
|
||||
|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|
|
||||
|useLogicalTypes|Use logical types for fields, when matching OpenAPI types. Currently supported: `date-time`, `date`.| |false|
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
|
||||
@@ -120,6 +120,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>if</li>
|
||||
<li>inline</li>
|
||||
<li>int</li>
|
||||
<li>linux</li>
|
||||
<li>long</li>
|
||||
<li>mutable</li>
|
||||
<li>namespace</li>
|
||||
|
||||
@@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
||||
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|
||||
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|
||||
|makeOperationsVirtual|Make all operations methods virtual. This makes it easy to mock the generated API class for testing purposes.| |true|
|
||||
|modelNamePrefix|Prefix that will be prepended to all model names.| |OAI|
|
||||
|optionalProjectFile|Generate client.pri.| |true|
|
||||
|packageName|C++ package (library) name.| |QtOpenAPIClient|
|
||||
|
||||
190
docs/generators/erlang-server-deprecated.md
Normal file
190
docs/generators/erlang-server-deprecated.md
Normal file
@@ -0,0 +1,190 @@
|
||||
---
|
||||
title: Documentation for the erlang-server-deprecated Generator
|
||||
---
|
||||
|
||||
## METADATA
|
||||
|
||||
| Property | Value | Notes |
|
||||
| -------- | ----- | ----- |
|
||||
| generator name | erlang-server-deprecated | pass this to the generate command after -g |
|
||||
| generator stability | DEPRECATED | |
|
||||
| generator type | SERVER | |
|
||||
| generator language | Erlang | |
|
||||
| generator default templating engine | mustache | |
|
||||
| helpTxt | Generates an Erlang server library (deprecated) using OpenAPI Generator (https://openapi-generator.tech). By default, it will also generate service classes, which can be disabled with the `-Dnoservice` environment variable. | |
|
||||
|
||||
## CONFIG OPTIONS
|
||||
These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.
|
||||
|
||||
| Option | Description | Values | Default |
|
||||
| ------ | ----------- | ------ | ------- |
|
||||
|openAPISpecName|Openapi Spec Name.| |openapi|
|
||||
|packageName|Erlang package name (convention: lowercase).| |openapi|
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
| ---------- | ------- |
|
||||
|
||||
|
||||
## INSTANTIATION TYPES
|
||||
|
||||
| Type/Alias | Instantiated By |
|
||||
| ---------- | --------------- |
|
||||
|
||||
|
||||
## LANGUAGE PRIMITIVES
|
||||
|
||||
<ul class="column-ul">
|
||||
</ul>
|
||||
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>after</li>
|
||||
<li>and</li>
|
||||
<li>andalso</li>
|
||||
<li>band</li>
|
||||
<li>begin</li>
|
||||
<li>bnot</li>
|
||||
<li>bor</li>
|
||||
<li>bsl</li>
|
||||
<li>bsr</li>
|
||||
<li>bxor</li>
|
||||
<li>case</li>
|
||||
<li>catch</li>
|
||||
<li>cond</li>
|
||||
<li>div</li>
|
||||
<li>end</li>
|
||||
<li>fun</li>
|
||||
<li>if</li>
|
||||
<li>let</li>
|
||||
<li>not</li>
|
||||
<li>of</li>
|
||||
<li>or</li>
|
||||
<li>orelse</li>
|
||||
<li>receive</li>
|
||||
<li>rem</li>
|
||||
<li>try</li>
|
||||
<li>when</li>
|
||||
<li>xor</li>
|
||||
</ul>
|
||||
|
||||
## FEATURE SET
|
||||
|
||||
|
||||
### Client Modification Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|BasePath|✗|ToolingExtension
|
||||
|Authorizations|✗|ToolingExtension
|
||||
|UserAgent|✗|ToolingExtension
|
||||
|MockServer|✗|ToolingExtension
|
||||
|
||||
### Data Type Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Custom|✗|OAS2,OAS3
|
||||
|Int32|✓|OAS2,OAS3
|
||||
|Int64|✓|OAS2,OAS3
|
||||
|Float|✓|OAS2,OAS3
|
||||
|Double|✓|OAS2,OAS3
|
||||
|Decimal|✓|ToolingExtension
|
||||
|String|✓|OAS2,OAS3
|
||||
|Byte|✓|OAS2,OAS3
|
||||
|Binary|✓|OAS2,OAS3
|
||||
|Boolean|✓|OAS2,OAS3
|
||||
|Date|✓|OAS2,OAS3
|
||||
|DateTime|✓|OAS2,OAS3
|
||||
|Password|✓|OAS2,OAS3
|
||||
|File|✓|OAS2
|
||||
|Uuid|✗|
|
||||
|Array|✓|OAS2,OAS3
|
||||
|Null|✗|OAS3
|
||||
|AnyType|✗|OAS2,OAS3
|
||||
|Object|✓|OAS2,OAS3
|
||||
|Maps|✓|ToolingExtension
|
||||
|CollectionFormat|✓|OAS2
|
||||
|CollectionFormatMulti|✓|OAS2
|
||||
|Enum|✓|OAS2,OAS3
|
||||
|ArrayOfEnum|✓|ToolingExtension
|
||||
|ArrayOfModel|✓|ToolingExtension
|
||||
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
|
||||
|ArrayOfCollectionOfModel|✓|ToolingExtension
|
||||
|ArrayOfCollectionOfEnum|✓|ToolingExtension
|
||||
|MapOfEnum|✓|ToolingExtension
|
||||
|MapOfModel|✓|ToolingExtension
|
||||
|MapOfCollectionOfPrimitives|✓|ToolingExtension
|
||||
|MapOfCollectionOfModel|✓|ToolingExtension
|
||||
|MapOfCollectionOfEnum|✓|ToolingExtension
|
||||
|
||||
### Documentation Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Readme|✓|ToolingExtension
|
||||
|Model|✓|ToolingExtension
|
||||
|Api|✓|ToolingExtension
|
||||
|
||||
### Global Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Host|✓|OAS2,OAS3
|
||||
|BasePath|✓|OAS2,OAS3
|
||||
|Info|✓|OAS2,OAS3
|
||||
|Schemes|✗|OAS2,OAS3
|
||||
|PartialSchemes|✓|OAS2,OAS3
|
||||
|Consumes|✓|OAS2
|
||||
|Produces|✓|OAS2
|
||||
|ExternalDocumentation|✓|OAS2,OAS3
|
||||
|Examples|✓|OAS2,OAS3
|
||||
|XMLStructureDefinitions|✗|OAS2,OAS3
|
||||
|MultiServer|✗|OAS3
|
||||
|ParameterizedServer|✗|OAS3
|
||||
|ParameterStyling|✗|OAS3
|
||||
|Callbacks|✗|OAS3
|
||||
|LinkObjects|✗|OAS3
|
||||
|
||||
### Parameter Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Path|✓|OAS2,OAS3
|
||||
|Query|✓|OAS2,OAS3
|
||||
|Header|✓|OAS2,OAS3
|
||||
|Body|✓|OAS2
|
||||
|FormUnencoded|✓|OAS2
|
||||
|FormMultipart|✓|OAS2
|
||||
|Cookie|✗|OAS3
|
||||
|
||||
### Schema Support Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Simple|✓|OAS2,OAS3
|
||||
|Composite|✓|OAS2,OAS3
|
||||
|Polymorphism|✗|OAS2,OAS3
|
||||
|Union|✗|OAS3
|
||||
|allOf|✗|OAS2,OAS3
|
||||
|anyOf|✗|OAS3
|
||||
|oneOf|✗|OAS3
|
||||
|not|✗|OAS3
|
||||
|
||||
### Security Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|BasicAuth|✗|OAS2,OAS3
|
||||
|ApiKey|✓|OAS2,OAS3
|
||||
|OpenIDConnect|✗|OAS3
|
||||
|BearerToken|✗|OAS3
|
||||
|OAuth2_Implicit|✓|OAS2,OAS3
|
||||
|OAuth2_Password|✗|OAS2,OAS3
|
||||
|OAuth2_ClientCredentials|✗|OAS2,OAS3
|
||||
|OAuth2_AuthorizationCode|✗|OAS2,OAS3
|
||||
|SignatureAuth|✗|OAS3
|
||||
|AWSV4Signature|✗|ToolingExtension
|
||||
|
||||
### Wire Format Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|JSON|✓|OAS2,OAS3
|
||||
|XML|✗|OAS2,OAS3
|
||||
|PROTOBUF|✗|ToolingExtension
|
||||
|Custom|✗|OAS2,OAS3
|
||||
@@ -59,6 +59,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>fun</li>
|
||||
<li>if</li>
|
||||
<li>let</li>
|
||||
<li>maybe</li>
|
||||
<li>not</li>
|
||||
<li>of</li>
|
||||
<li>or</li>
|
||||
|
||||
@@ -25,11 +25,13 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|collectionType|Option. Collection type to use|<dl><dt>**array**</dt><dd>kotlin.Array</dd><dt>**list**</dt><dd>kotlin.collections.List</dd></dl>|list|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**threetenbp-localdatetime**</dt><dd>Threetenbp - Backport of JSR310 (jvm only, for legacy app only)</dd><dt>**kotlinx-datetime**</dt><dd>kotlinx-datetime (preferred for multiplatform)</dd><dt>**string**</dt><dd>String</dd><dt>**java8-localdatetime**</dt><dd>Java 8 native JSR310 (jvm only, for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (jvm only, preferred for jdk 1.8+)</dd><dt>**threetenbp**</dt><dd>Threetenbp - Backport of JSR310 (jvm only, preferred for jdk < 1.8)</dd></dl>|java8|
|
||||
|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |original|
|
||||
|failOnUnknownProperties|Fail Jackson de-serialization on unknown properties| |false|
|
||||
|generateOneOfAnyOfWrappers|Generate oneOf, anyOf schemas as wrappers.| |false|
|
||||
|generateRoomModels|Generate Android Room database models in addition to API models (JVM Volley library only)| |false|
|
||||
|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools|
|
||||
|idea|Add IntellJ Idea plugin and mark Kotlin main and test folders as source folders.| |false|
|
||||
|library|Library template (sub-template) to use|<dl><dt>**jvm-ktor**</dt><dd>Platform: Java Virtual Machine. HTTP client: Ktor 1.6.7. JSON processing: Gson, Jackson (default).</dd><dt>**jvm-okhttp4**</dt><dd>[DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.</dd><dt>**jvm-spring-webclient**</dt><dd>Platform: Java Virtual Machine. HTTP: Spring 5 (or 6 with useSpringBoot3 enabled) WebClient. JSON processing: Jackson.</dd><dt>**jvm-spring-restclient**</dt><dd>Platform: Java Virtual Machine. HTTP: Spring 6 RestClient. JSON processing: Jackson.</dd><dt>**jvm-retrofit2**</dt><dd>Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.</dd><dt>**multiplatform**</dt><dd>Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.7. JSON processing: Kotlinx Serialization: 1.2.1.</dd><dt>**jvm-volley**</dt><dd>Platform: JVM for Android. HTTP client: Volley 1.2.1. JSON processing: gson 2.8.9</dd><dt>**jvm-vertx**</dt><dd>Platform: Java Virtual Machine. HTTP client: Vert.x Web Client. JSON processing: Moshi, Gson or Jackson.</dd></dl>|jvm-okhttp4|
|
||||
|mapFileBinaryToByteArray|Map File and Binary to ByteArray (default: false)| |false|
|
||||
|modelMutable|Create mutable models| |false|
|
||||
|moshiCodeGen|Whether to enable codegen with the Moshi library. Refer to the [official Moshi doc](https://github.com/square/moshi#codegen) for more info.| |false|
|
||||
|nullableReturnType|Nullable return type| |false|
|
||||
|
||||
@@ -29,6 +29,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|supportAsync|If set, generate async function call instead. This option is for 'reqwest' library only| |true|
|
||||
|supportMiddleware|If set, add support for reqwest-middleware. This option is for 'reqwest' library only| |false|
|
||||
|supportMultipleResponses|If set, return type wraps an enum of all possible 2xx schemas. This option is for 'reqwest' library only| |false|
|
||||
|supportTokenSource|If set, add support for google-cloud-token. This option is for 'reqwest' library only and requires the 'supportAsync' 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.| |false|
|
||||
|withAWSV4Signature|whether to include AWS v4 signature support| |false|
|
||||
|
||||
|
||||
273
docs/generators/scala-http4s.md
Normal file
273
docs/generators/scala-http4s.md
Normal file
@@ -0,0 +1,273 @@
|
||||
---
|
||||
title: Documentation for the scala-http4s Generator
|
||||
---
|
||||
|
||||
## METADATA
|
||||
|
||||
| Property | Value | Notes |
|
||||
| -------- | ----- | ----- |
|
||||
| generator name | scala-http4s | pass this to the generate command after -g |
|
||||
| generator stability | STABLE | |
|
||||
| generator type | CLIENT | |
|
||||
| generator language | Scala | |
|
||||
| generator default templating engine | mustache | |
|
||||
| helpTxt | Generates a scala-http4s client. | |
|
||||
|
||||
## CONFIG OPTIONS
|
||||
These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.
|
||||
|
||||
| Option | Description | Values | Default |
|
||||
| ------ | ----------- | ------ | ------- |
|
||||
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
||||
|apiPackage|package for generated api classes| |null|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for JDK 1.8+)</dd></dl>|java8|
|
||||
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|
||||
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
||||
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|
||||
|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|
|
||||
|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|
|
||||
|sourceFolder|source folder for generated code| |null|
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
| ---------- | ------- |
|
||||
|ArrayBuffer|scala.collection.mutable.ArrayBuffer|
|
||||
|Date|java.util.Date|
|
||||
|File|java.io.File|
|
||||
|HashMap|scala.collection.immutable.HashMap|
|
||||
|Instant|java.time.Instant|
|
||||
|Json|io.circe.Json|
|
||||
|LocalDate|java.time.LocalDate|
|
||||
|LocalDateTime|java.time.LocalDateTime|
|
||||
|LocalTime|java.time.LocalTime|
|
||||
|Map|scala.collection.immutable.Map|
|
||||
|OffsetDateTime|java.time.OffsetDateTime|
|
||||
|Seq|scala.collection.immutable.Seq|
|
||||
|Timestamp|java.sql.Timestamp|
|
||||
|URI|java.net.URI|
|
||||
|UUID|java.util.UUID|
|
||||
|ZonedDateTime|java.time.ZonedDateTime|
|
||||
|
||||
|
||||
## INSTANTIATION TYPES
|
||||
|
||||
| Type/Alias | Instantiated By |
|
||||
| ---------- | --------------- |
|
||||
|array|Seq|
|
||||
|list|List|
|
||||
|map|Map|
|
||||
|seq|Seq|
|
||||
|set|Set|
|
||||
|
||||
|
||||
## LANGUAGE PRIMITIVES
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>Any</li>
|
||||
<li>AnyRef</li>
|
||||
<li>AnyVal</li>
|
||||
<li>BigDecimal</li>
|
||||
<li>Boolean</li>
|
||||
<li>Double</li>
|
||||
<li>Float</li>
|
||||
<li>Int</li>
|
||||
<li>Integer</li>
|
||||
<li>Long</li>
|
||||
<li>Object</li>
|
||||
<li>String</li>
|
||||
</ul>
|
||||
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>abstract</li>
|
||||
<li>assert</li>
|
||||
<li>break</li>
|
||||
<li>byte</li>
|
||||
<li>case</li>
|
||||
<li>catch</li>
|
||||
<li>char</li>
|
||||
<li>class</li>
|
||||
<li>const</li>
|
||||
<li>continue</li>
|
||||
<li>def</li>
|
||||
<li>default</li>
|
||||
<li>do</li>
|
||||
<li>double</li>
|
||||
<li>else</li>
|
||||
<li>enum</li>
|
||||
<li>extends</li>
|
||||
<li>false</li>
|
||||
<li>final</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
<li>for</li>
|
||||
<li>forsome</li>
|
||||
<li>goto</li>
|
||||
<li>if</li>
|
||||
<li>implements</li>
|
||||
<li>implicit</li>
|
||||
<li>import</li>
|
||||
<li>instanceof</li>
|
||||
<li>int</li>
|
||||
<li>interface</li>
|
||||
<li>lazy</li>
|
||||
<li>long</li>
|
||||
<li>match</li>
|
||||
<li>native</li>
|
||||
<li>new</li>
|
||||
<li>null</li>
|
||||
<li>object</li>
|
||||
<li>override</li>
|
||||
<li>package</li>
|
||||
<li>private</li>
|
||||
<li>protected</li>
|
||||
<li>public</li>
|
||||
<li>return</li>
|
||||
<li>sealed</li>
|
||||
<li>short</li>
|
||||
<li>static</li>
|
||||
<li>strictfp</li>
|
||||
<li>super</li>
|
||||
<li>switch</li>
|
||||
<li>synchronized</li>
|
||||
<li>this</li>
|
||||
<li>throw</li>
|
||||
<li>throws</li>
|
||||
<li>trait</li>
|
||||
<li>transient</li>
|
||||
<li>true</li>
|
||||
<li>try</li>
|
||||
<li>type</li>
|
||||
<li>val</li>
|
||||
<li>var</li>
|
||||
<li>void</li>
|
||||
<li>volatile</li>
|
||||
<li>while</li>
|
||||
<li>with</li>
|
||||
<li>yield</li>
|
||||
</ul>
|
||||
|
||||
## FEATURE SET
|
||||
|
||||
|
||||
### Client Modification Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|BasePath|✗|ToolingExtension
|
||||
|Authorizations|✗|ToolingExtension
|
||||
|UserAgent|✗|ToolingExtension
|
||||
|MockServer|✗|ToolingExtension
|
||||
|
||||
### Data Type Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Custom|✗|OAS2,OAS3
|
||||
|Int32|✓|OAS2,OAS3
|
||||
|Int64|✓|OAS2,OAS3
|
||||
|Float|✓|OAS2,OAS3
|
||||
|Double|✓|OAS2,OAS3
|
||||
|Decimal|✓|ToolingExtension
|
||||
|String|✓|OAS2,OAS3
|
||||
|Byte|✓|OAS2,OAS3
|
||||
|Binary|✓|OAS2,OAS3
|
||||
|Boolean|✓|OAS2,OAS3
|
||||
|Date|✓|OAS2,OAS3
|
||||
|DateTime|✓|OAS2,OAS3
|
||||
|Password|✓|OAS2,OAS3
|
||||
|File|✓|OAS2
|
||||
|Uuid|✗|
|
||||
|Array|✓|OAS2,OAS3
|
||||
|Null|✗|OAS3
|
||||
|AnyType|✗|OAS2,OAS3
|
||||
|Object|✓|OAS2,OAS3
|
||||
|Maps|✓|ToolingExtension
|
||||
|CollectionFormat|✓|OAS2
|
||||
|CollectionFormatMulti|✓|OAS2
|
||||
|Enum|✓|OAS2,OAS3
|
||||
|ArrayOfEnum|✓|ToolingExtension
|
||||
|ArrayOfModel|✓|ToolingExtension
|
||||
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
|
||||
|ArrayOfCollectionOfModel|✓|ToolingExtension
|
||||
|ArrayOfCollectionOfEnum|✓|ToolingExtension
|
||||
|MapOfEnum|✓|ToolingExtension
|
||||
|MapOfModel|✓|ToolingExtension
|
||||
|MapOfCollectionOfPrimitives|✓|ToolingExtension
|
||||
|MapOfCollectionOfModel|✓|ToolingExtension
|
||||
|MapOfCollectionOfEnum|✓|ToolingExtension
|
||||
|
||||
### Documentation Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Readme|✗|ToolingExtension
|
||||
|Model|✓|ToolingExtension
|
||||
|Api|✓|ToolingExtension
|
||||
|
||||
### Global Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Host|✓|OAS2,OAS3
|
||||
|BasePath|✓|OAS2,OAS3
|
||||
|Info|✓|OAS2,OAS3
|
||||
|Schemes|✗|OAS2,OAS3
|
||||
|PartialSchemes|✓|OAS2,OAS3
|
||||
|Consumes|✓|OAS2
|
||||
|Produces|✓|OAS2
|
||||
|ExternalDocumentation|✓|OAS2,OAS3
|
||||
|Examples|✓|OAS2,OAS3
|
||||
|XMLStructureDefinitions|✗|OAS2,OAS3
|
||||
|MultiServer|✗|OAS3
|
||||
|ParameterizedServer|✗|OAS3
|
||||
|ParameterStyling|✗|OAS3
|
||||
|Callbacks|✗|OAS3
|
||||
|LinkObjects|✗|OAS3
|
||||
|
||||
### Parameter Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Path|✓|OAS2,OAS3
|
||||
|Query|✓|OAS2,OAS3
|
||||
|Header|✓|OAS2,OAS3
|
||||
|Body|✓|OAS2
|
||||
|FormUnencoded|✓|OAS2
|
||||
|FormMultipart|✗|OAS2
|
||||
|Cookie|✗|OAS3
|
||||
|
||||
### Schema Support Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Simple|✓|OAS2,OAS3
|
||||
|Composite|✓|OAS2,OAS3
|
||||
|Polymorphism|✗|OAS2,OAS3
|
||||
|Union|✗|OAS3
|
||||
|allOf|✗|OAS2,OAS3
|
||||
|anyOf|✗|OAS3
|
||||
|oneOf|✗|OAS3
|
||||
|not|✗|OAS3
|
||||
|
||||
### Security Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|BasicAuth|✓|OAS2,OAS3
|
||||
|ApiKey|✓|OAS2,OAS3
|
||||
|OpenIDConnect|✗|OAS3
|
||||
|BearerToken|✓|OAS3
|
||||
|OAuth2_Implicit|✗|OAS2,OAS3
|
||||
|OAuth2_Password|✗|OAS2,OAS3
|
||||
|OAuth2_ClientCredentials|✗|OAS2,OAS3
|
||||
|OAuth2_AuthorizationCode|✗|OAS2,OAS3
|
||||
|SignatureAuth|✗|OAS3
|
||||
|AWSV4Signature|✗|ToolingExtension
|
||||
|
||||
### Wire Format Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|JSON|✓|OAS2,OAS3
|
||||
|XML|✓|OAS2,OAS3
|
||||
|PROTOBUF|✗|ToolingExtension
|
||||
|Custom|✓|OAS2,OAS3
|
||||
@@ -27,11 +27,11 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|hashableModels|Make hashable models (default: true)| |true|
|
||||
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|
||||
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|
||||
|lenientTypeCast|Accept and cast values for simple types (string->bool, string->int, int->string)| |false|
|
||||
|library|Library template (sub-template) to use|<dl><dt>**urlsession**</dt><dd>[DEFAULT] HTTP client: URLSession</dd><dt>**alamofire**</dt><dd>HTTP client: Alamofire</dd><dt>**vapor**</dt><dd>HTTP client: Vapor</dd></dl>|urlsession|
|
||||
|mapFileBinaryToData|[WARNING] This option will be removed and enabled by default in the future once we've enhanced the code to work with `Data` in all the different situations. Map File and Binary to Data (default: false)| |false|
|
||||
|nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.(default: false)| |null|
|
||||
|objcCompatible|Add additional properties and methods for Objective-C compatibility (default: false)| |null|
|
||||
|oneOfUnknownDefaultCase|Add unknownDefault case to oneOf enum (default: false)| |false|
|
||||
|podAuthors|Authors used for Podspec| |null|
|
||||
|podDescription|Description used for Podspec| |null|
|
||||
|podDocumentationURL|Documentation URL used for Podspec| |null|
|
||||
|
||||
358
docs/generators/swift6.md
Normal file
358
docs/generators/swift6.md
Normal file
@@ -0,0 +1,358 @@
|
||||
---
|
||||
title: Documentation for the swift6 Generator
|
||||
---
|
||||
|
||||
## METADATA
|
||||
|
||||
| Property | Value | Notes |
|
||||
| -------- | ----- | ----- |
|
||||
| generator name | swift6 | pass this to the generate command after -g |
|
||||
| generator stability | BETA | |
|
||||
| generator type | CLIENT | |
|
||||
| generator language | Swift | |
|
||||
| generator default templating engine | mustache | |
|
||||
| helpTxt | Generates a Swift 6.x client library. | |
|
||||
|
||||
## CONFIG OPTIONS
|
||||
These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.
|
||||
|
||||
| Option | Description | Values | Default |
|
||||
| ------ | ----------- | ------ | ------- |
|
||||
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
||||
|apiNamePrefix|Prefix that will be appended to all API names ('tags'). Default: empty string. e.g. Pet => Pet.| |null|
|
||||
|apiStaticMethod|Make api calls using a static method (default: true)| |true|
|
||||
|combineDeferred|Make combine usages deferred (default: true)| |true|
|
||||
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|
||||
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
||||
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|
||||
|generateModelAdditionalProperties|Generate model additional properties (default: true)| |true|
|
||||
|hashableModels|Make hashable models (default: true)| |true|
|
||||
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|
||||
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|
||||
|library|Library template (sub-template) to use|<dl><dt>**urlsession**</dt><dd>[DEFAULT] HTTP client: URLSession</dd><dt>**alamofire**</dt><dd>HTTP client: Alamofire</dd><dt>**vapor**</dt><dd>HTTP client: Vapor</dd></dl>|urlsession|
|
||||
|mapFileBinaryToData|Map File and Binary to Data (default: false)| |false|
|
||||
|nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.(default: false)| |null|
|
||||
|objcCompatible|Add additional properties and methods for Objective-C compatibility (default: false)| |null|
|
||||
|oneOfUnknownDefaultCase|Add unknownDefault case to oneOf enum (default: false)| |false|
|
||||
|podAuthors|Authors used for Podspec| |null|
|
||||
|podDescription|Description used for Podspec| |null|
|
||||
|podDocumentationURL|Documentation URL used for Podspec| |null|
|
||||
|podHomepage|Homepage used for Podspec| |null|
|
||||
|podLicense|License used for Podspec| |null|
|
||||
|podScreenshots|Screenshots used for Podspec| |null|
|
||||
|podSocialMediaURL|Social Media URL used for Podspec| |null|
|
||||
|podSource|Source information used for Podspec| |null|
|
||||
|podSummary|Summary used for Podspec| |null|
|
||||
|podVersion|Version used for Podspec| |null|
|
||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||
|projectName|Project name in Xcode| |null|
|
||||
|readonlyProperties|Make properties readonly (default: false)| |null|
|
||||
|responseAs|Optionally use libraries to manage response. Currently AsyncAwait, Combine, Result, RxSwift, ObjcBlock, PromiseKit are available.| |null|
|
||||
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|
||||
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
||||
|swiftPackagePath|Set a custom source path instead of Sources/{{projectName}}.| |null|
|
||||
|swiftUseApiNamespace|Flag to make all the API classes inner-class of {{projectName}}API| |null|
|
||||
|useBacktickEscapes|Escape reserved words using backticks (default: false)| |false|
|
||||
|useClasses|Use final classes for models instead of structs (default: false)| |false|
|
||||
|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|
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
| ---------- | ------- |
|
||||
|
||||
|
||||
## INSTANTIATION TYPES
|
||||
|
||||
| Type/Alias | Instantiated By |
|
||||
| ---------- | --------------- |
|
||||
|
||||
|
||||
## LANGUAGE PRIMITIVES
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>Any</li>
|
||||
<li>AnyObject</li>
|
||||
<li>Bool</li>
|
||||
<li>Character</li>
|
||||
<li>Data</li>
|
||||
<li>Date</li>
|
||||
<li>Decimal</li>
|
||||
<li>Double</li>
|
||||
<li>Float</li>
|
||||
<li>Int</li>
|
||||
<li>Int32</li>
|
||||
<li>Int64</li>
|
||||
<li>JSONValue</li>
|
||||
<li>OpenAPIDateWithoutTime</li>
|
||||
<li>String</li>
|
||||
<li>URL</li>
|
||||
<li>UUID</li>
|
||||
<li>Void</li>
|
||||
</ul>
|
||||
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>#available</li>
|
||||
<li>#colorLiteral</li>
|
||||
<li>#column</li>
|
||||
<li>#else</li>
|
||||
<li>#elseif</li>
|
||||
<li>#endif</li>
|
||||
<li>#file</li>
|
||||
<li>#fileLiteral</li>
|
||||
<li>#function</li>
|
||||
<li>#if</li>
|
||||
<li>#imageLiteral</li>
|
||||
<li>#line</li>
|
||||
<li>#selector</li>
|
||||
<li>#sourceLocation</li>
|
||||
<li>Any</li>
|
||||
<li>AnyObject</li>
|
||||
<li>Array</li>
|
||||
<li>Bool</li>
|
||||
<li>COLUMN</li>
|
||||
<li>Character</li>
|
||||
<li>Class</li>
|
||||
<li>ClosedRange</li>
|
||||
<li>Codable</li>
|
||||
<li>CountableClosedRange</li>
|
||||
<li>CountableRange</li>
|
||||
<li>Data</li>
|
||||
<li>Decodable</li>
|
||||
<li>Dictionary</li>
|
||||
<li>Double</li>
|
||||
<li>Encodable</li>
|
||||
<li>Error</li>
|
||||
<li>ErrorResponse</li>
|
||||
<li>FILE</li>
|
||||
<li>FUNCTION</li>
|
||||
<li>Float</li>
|
||||
<li>Float32</li>
|
||||
<li>Float64</li>
|
||||
<li>Float80</li>
|
||||
<li>Int</li>
|
||||
<li>Int16</li>
|
||||
<li>Int32</li>
|
||||
<li>Int64</li>
|
||||
<li>Int8</li>
|
||||
<li>LINE</li>
|
||||
<li>OptionSet</li>
|
||||
<li>Optional</li>
|
||||
<li>Protocol</li>
|
||||
<li>Range</li>
|
||||
<li>Response</li>
|
||||
<li>Self</li>
|
||||
<li>Set</li>
|
||||
<li>StaticString</li>
|
||||
<li>String</li>
|
||||
<li>Type</li>
|
||||
<li>UInt</li>
|
||||
<li>UInt16</li>
|
||||
<li>UInt32</li>
|
||||
<li>UInt64</li>
|
||||
<li>UInt8</li>
|
||||
<li>URL</li>
|
||||
<li>Unicode</li>
|
||||
<li>Void</li>
|
||||
<li>_</li>
|
||||
<li>as</li>
|
||||
<li>associatedtype</li>
|
||||
<li>associativity</li>
|
||||
<li>break</li>
|
||||
<li>case</li>
|
||||
<li>catch</li>
|
||||
<li>class</li>
|
||||
<li>continue</li>
|
||||
<li>convenience</li>
|
||||
<li>default</li>
|
||||
<li>defer</li>
|
||||
<li>deinit</li>
|
||||
<li>didSet</li>
|
||||
<li>do</li>
|
||||
<li>dynamic</li>
|
||||
<li>dynamicType</li>
|
||||
<li>else</li>
|
||||
<li>enum</li>
|
||||
<li>extension</li>
|
||||
<li>fallthrough</li>
|
||||
<li>false</li>
|
||||
<li>fileprivate</li>
|
||||
<li>final</li>
|
||||
<li>for</li>
|
||||
<li>func</li>
|
||||
<li>get</li>
|
||||
<li>guard</li>
|
||||
<li>if</li>
|
||||
<li>import</li>
|
||||
<li>in</li>
|
||||
<li>indirect</li>
|
||||
<li>infix</li>
|
||||
<li>init</li>
|
||||
<li>inout</li>
|
||||
<li>internal</li>
|
||||
<li>is</li>
|
||||
<li>lazy</li>
|
||||
<li>left</li>
|
||||
<li>let</li>
|
||||
<li>mutating</li>
|
||||
<li>nil</li>
|
||||
<li>none</li>
|
||||
<li>nonmutating</li>
|
||||
<li>open</li>
|
||||
<li>operator</li>
|
||||
<li>optional</li>
|
||||
<li>override</li>
|
||||
<li>postfix</li>
|
||||
<li>precedence</li>
|
||||
<li>prefix</li>
|
||||
<li>private</li>
|
||||
<li>protocol</li>
|
||||
<li>public</li>
|
||||
<li>repeat</li>
|
||||
<li>required</li>
|
||||
<li>rethrows</li>
|
||||
<li>return</li>
|
||||
<li>right</li>
|
||||
<li>self</li>
|
||||
<li>set</li>
|
||||
<li>static</li>
|
||||
<li>struct</li>
|
||||
<li>subscript</li>
|
||||
<li>super</li>
|
||||
<li>switch</li>
|
||||
<li>throw</li>
|
||||
<li>throws</li>
|
||||
<li>true</li>
|
||||
<li>try</li>
|
||||
<li>typealias</li>
|
||||
<li>unowned</li>
|
||||
<li>var</li>
|
||||
<li>weak</li>
|
||||
<li>where</li>
|
||||
<li>while</li>
|
||||
<li>willSet</li>
|
||||
</ul>
|
||||
|
||||
## FEATURE SET
|
||||
|
||||
|
||||
### Client Modification Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|BasePath|✗|ToolingExtension
|
||||
|Authorizations|✗|ToolingExtension
|
||||
|UserAgent|✗|ToolingExtension
|
||||
|MockServer|✗|ToolingExtension
|
||||
|
||||
### Data Type Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Custom|✗|OAS2,OAS3
|
||||
|Int32|✓|OAS2,OAS3
|
||||
|Int64|✓|OAS2,OAS3
|
||||
|Float|✓|OAS2,OAS3
|
||||
|Double|✓|OAS2,OAS3
|
||||
|Decimal|✓|ToolingExtension
|
||||
|String|✓|OAS2,OAS3
|
||||
|Byte|✓|OAS2,OAS3
|
||||
|Binary|✓|OAS2,OAS3
|
||||
|Boolean|✓|OAS2,OAS3
|
||||
|Date|✓|OAS2,OAS3
|
||||
|DateTime|✓|OAS2,OAS3
|
||||
|Password|✓|OAS2,OAS3
|
||||
|File|✓|OAS2
|
||||
|Uuid|✗|
|
||||
|Array|✓|OAS2,OAS3
|
||||
|Null|✗|OAS3
|
||||
|AnyType|✗|OAS2,OAS3
|
||||
|Object|✓|OAS2,OAS3
|
||||
|Maps|✓|ToolingExtension
|
||||
|CollectionFormat|✓|OAS2
|
||||
|CollectionFormatMulti|✓|OAS2
|
||||
|Enum|✓|OAS2,OAS3
|
||||
|ArrayOfEnum|✓|ToolingExtension
|
||||
|ArrayOfModel|✓|ToolingExtension
|
||||
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
|
||||
|ArrayOfCollectionOfModel|✓|ToolingExtension
|
||||
|ArrayOfCollectionOfEnum|✓|ToolingExtension
|
||||
|MapOfEnum|✓|ToolingExtension
|
||||
|MapOfModel|✓|ToolingExtension
|
||||
|MapOfCollectionOfPrimitives|✓|ToolingExtension
|
||||
|MapOfCollectionOfModel|✓|ToolingExtension
|
||||
|MapOfCollectionOfEnum|✓|ToolingExtension
|
||||
|
||||
### Documentation Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Readme|✗|ToolingExtension
|
||||
|Model|✓|ToolingExtension
|
||||
|Api|✓|ToolingExtension
|
||||
|
||||
### Global Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Host|✓|OAS2,OAS3
|
||||
|BasePath|✓|OAS2,OAS3
|
||||
|Info|✓|OAS2,OAS3
|
||||
|Schemes|✗|OAS2,OAS3
|
||||
|PartialSchemes|✓|OAS2,OAS3
|
||||
|Consumes|✓|OAS2
|
||||
|Produces|✓|OAS2
|
||||
|ExternalDocumentation|✓|OAS2,OAS3
|
||||
|Examples|✓|OAS2,OAS3
|
||||
|XMLStructureDefinitions|✗|OAS2,OAS3
|
||||
|MultiServer|✗|OAS3
|
||||
|ParameterizedServer|✗|OAS3
|
||||
|ParameterStyling|✗|OAS3
|
||||
|Callbacks|✓|OAS3
|
||||
|LinkObjects|✗|OAS3
|
||||
|
||||
### Parameter Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Path|✓|OAS2,OAS3
|
||||
|Query|✓|OAS2,OAS3
|
||||
|Header|✓|OAS2,OAS3
|
||||
|Body|✓|OAS2
|
||||
|FormUnencoded|✓|OAS2
|
||||
|FormMultipart|✓|OAS2
|
||||
|Cookie|✓|OAS3
|
||||
|
||||
### Schema Support Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Simple|✓|OAS2,OAS3
|
||||
|Composite|✓|OAS2,OAS3
|
||||
|Polymorphism|✓|OAS2,OAS3
|
||||
|Union|✗|OAS3
|
||||
|allOf|✗|OAS2,OAS3
|
||||
|anyOf|✗|OAS3
|
||||
|oneOf|✗|OAS3
|
||||
|not|✗|OAS3
|
||||
|
||||
### Security Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|BasicAuth|✓|OAS2,OAS3
|
||||
|ApiKey|✓|OAS2,OAS3
|
||||
|OpenIDConnect|✗|OAS3
|
||||
|BearerToken|✓|OAS3
|
||||
|OAuth2_Implicit|✓|OAS2,OAS3
|
||||
|OAuth2_Password|✓|OAS2,OAS3
|
||||
|OAuth2_ClientCredentials|✓|OAS2,OAS3
|
||||
|OAuth2_AuthorizationCode|✓|OAS2,OAS3
|
||||
|SignatureAuth|✗|OAS3
|
||||
|AWSV4Signature|✗|ToolingExtension
|
||||
|
||||
### Wire Format Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|JSON|✓|OAS2,OAS3
|
||||
|XML|✓|OAS2,OAS3
|
||||
|PROTOBUF|✗|ToolingExtension
|
||||
|Custom|✗|OAS2,OAS3
|
||||
@@ -22,7 +22,7 @@ npm install @openapitools/openapi-generator-cli -g
|
||||
To install a specific version of the tool, pass the version during installation:
|
||||
<!-- RELEASE_VERSION -->
|
||||
```bash
|
||||
openapi-generator-cli version-manager set 7.8.0
|
||||
openapi-generator-cli version-manager set 7.9.0
|
||||
```
|
||||
<!-- /RELEASE_VERSION -->
|
||||
To install the tool as a dev dependency in your current project:
|
||||
@@ -103,18 +103,18 @@ docker run --rm \
|
||||
<!-- RELEASE_VERSION -->
|
||||
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 11 runtime at a minimum):
|
||||
|
||||
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.8.0/openapi-generator-cli-7.8.0.jar`
|
||||
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.9.0/openapi-generator-cli-7.9.0.jar`
|
||||
|
||||
For **Mac/Linux** users:
|
||||
|
||||
```bash
|
||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.8.0/openapi-generator-cli-7.8.0.jar -O openapi-generator-cli.jar
|
||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.9.0/openapi-generator-cli-7.9.0.jar -O openapi-generator-cli.jar
|
||||
```
|
||||
|
||||
For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.
|
||||
|
||||
```powershell
|
||||
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.8.0/openapi-generator-cli-7.8.0.jar
|
||||
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.9.0/openapi-generator-cli-7.9.0.jar
|
||||
```
|
||||
<!-- /RELEASE_VERSION -->
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase)
|
||||
<plugin>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<version>7.8.0</version>
|
||||
<version>7.9.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.9.0-SNAPSHOT</version>
|
||||
<version>7.10.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.9.0-SNAPSHOT</version>
|
||||
<version>7.10.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# RELEASE_VERSION
|
||||
openApiGeneratorVersion=7.9.0-SNAPSHOT
|
||||
openApiGeneratorVersion=7.10.0-SNAPSHOT
|
||||
# /RELEASE_VERSION
|
||||
|
||||
# BEGIN placeholders
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.9.0-SNAPSHOT</version>
|
||||
<version>7.10.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# RELEASE_VERSION
|
||||
openApiGeneratorVersion=7.9.0-SNAPSHOT
|
||||
openApiGeneratorVersion=7.10.0-SNAPSHOT
|
||||
# /RELEASE_VERSION
|
||||
|
||||
@@ -80,6 +80,15 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
|
||||
@Input
|
||||
val generatorName = project.objects.property<String>()
|
||||
|
||||
/**
|
||||
* This is the configuration for reference paths where schemas for openapi generation are stored
|
||||
* The directory which contains the additional schema files
|
||||
*/
|
||||
@Optional
|
||||
@InputDirectory
|
||||
@PathSensitive(PathSensitivity.ABSOLUTE)
|
||||
val schemaLocation = project.objects.property<String>()
|
||||
|
||||
/**
|
||||
* The output target directory into which code will be generated.
|
||||
*/
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.9.0-SNAPSHOT</version>
|
||||
<version>7.10.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.9.0-SNAPSHOT</version>
|
||||
<version>7.10.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.9.0-SNAPSHOT</version>
|
||||
<version>7.10.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.9.0-SNAPSHOT</version>
|
||||
<version>7.10.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.9.0-SNAPSHOT</version>
|
||||
<version>7.10.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.9.0-SNAPSHOT</version>
|
||||
<version>7.10.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.9.0-SNAPSHOT</version>
|
||||
<version>7.10.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.9.0-SNAPSHOT</version>
|
||||
<version>7.10.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.9.0-SNAPSHOT</version>
|
||||
<version>7.10.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -256,6 +256,10 @@ public interface CodegenConfig {
|
||||
|
||||
void setSkipOperationExample(boolean skipOperationExample);
|
||||
|
||||
boolean isSkipSortingOperations();
|
||||
|
||||
void setSkipSortingOperations(boolean skipSortingOperations);
|
||||
|
||||
public boolean isHideGenerationTimestamp();
|
||||
|
||||
public void setHideGenerationTimestamp(boolean hideGenerationTimestamp);
|
||||
|
||||
@@ -30,7 +30,7 @@ public class CodegenOperation {
|
||||
hasVersionHeaders = false, hasVersionQueryParams = false,
|
||||
isResponseBinary = false, isResponseFile = false, isResponseOptional = false, hasReference = false, defaultReturnType = false,
|
||||
isRestfulIndex, isRestfulShow, isRestfulCreate, isRestfulUpdate, isRestfulDestroy,
|
||||
isRestful, isDeprecated, isCallbackRequest, uniqueItems, hasDefaultResponse = false, hasConstantParams = false,
|
||||
isRestful, isDeprecated, isCallbackRequest, uniqueItems, hasDefaultResponse = false, hasOnlyDefaultResponse = false, hasConstantParams = false,
|
||||
hasErrorResponseObject, // if 4xx, 5xx responses have at least one error object defined
|
||||
hasSingleParam = false; // if the operation has only one parameter;
|
||||
public CodegenProperty returnProperty;
|
||||
@@ -215,6 +215,13 @@ public class CodegenOperation {
|
||||
return responses.stream().anyMatch(response -> response.isDefault);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the responses contain only 1 entry and it's default
|
||||
*
|
||||
* @return true if responses contain only 1 entry and it's a default response, false otherwise
|
||||
*/
|
||||
public boolean getHasOnlyDefaultResponse() { return responses.size() == 1 && getHasDefaultResponse(); }
|
||||
|
||||
public boolean getAllResponsesAreErrors() {
|
||||
return responses.stream().allMatch(response -> response.is4xx || response.is5xx);
|
||||
}
|
||||
@@ -351,6 +358,7 @@ public class CodegenOperation {
|
||||
sb.append(", isResponseOptional=").append(isResponseOptional);
|
||||
sb.append(", hasReference=").append(hasReference);
|
||||
sb.append(", hasDefaultResponse=").append(hasDefaultResponse);
|
||||
sb.append(", hasOnlyDefaultResponse=").append(hasOnlyDefaultResponse);
|
||||
sb.append(", hasErrorResponseObject=").append(hasErrorResponseObject);
|
||||
sb.append(", hasSingleParam=").append(hasSingleParam);
|
||||
sb.append(", isRestfulIndex=").append(isRestfulIndex);
|
||||
@@ -432,6 +440,7 @@ public class CodegenOperation {
|
||||
isResponseOptional == that.isResponseOptional &&
|
||||
hasReference == that.hasReference &&
|
||||
hasDefaultResponse == that.hasDefaultResponse &&
|
||||
hasOnlyDefaultResponse == that.hasOnlyDefaultResponse &&
|
||||
hasErrorResponseObject == that.hasErrorResponseObject &&
|
||||
hasSingleParam == that.hasSingleParam &&
|
||||
isRestfulIndex == that.isRestfulIndex &&
|
||||
@@ -496,7 +505,7 @@ public class CodegenOperation {
|
||||
return Objects.hash(responseHeaders, hasAuthMethods, hasConsumes, hasProduces, hasParams, hasOptionalParams,
|
||||
hasRequiredParams, returnTypeIsPrimitive, returnSimpleType, subresourceOperation, isMap,
|
||||
isArray, isMultipart, isVoid, isResponseBinary, isResponseFile, isResponseOptional, hasReference,
|
||||
hasDefaultResponse, isRestfulIndex, isRestfulShow, isRestfulCreate, isRestfulUpdate, isRestfulDestroy,
|
||||
hasDefaultResponse, hasOnlyDefaultResponse, isRestfulIndex, isRestfulShow, isRestfulCreate, isRestfulUpdate, isRestfulDestroy,
|
||||
isRestful, isDeprecated, isCallbackRequest, uniqueItems, path, operationId, returnType, httpMethod,
|
||||
returnBaseType, returnContainer, summary, unescapedNotes, notes, baseName, defaultResponse,
|
||||
discriminator, consumes, produces, prioritizedContentTypes, servers, bodyParam, allParams, bodyParams,
|
||||
|
||||
@@ -71,6 +71,10 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.ConcurrentSkipListSet;
|
||||
@@ -224,6 +228,8 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
@Getter @Setter
|
||||
protected int removeOperationIdPrefixCount = 1;
|
||||
protected boolean skipOperationExample;
|
||||
// sort operations by default
|
||||
protected boolean skipSortingOperations = false;
|
||||
|
||||
protected final static Pattern XML_MIME_PATTERN = Pattern.compile("(?i)application\\/(.*)[+]?xml(;.*)?");
|
||||
protected final static Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)application\\/json(;.*)?");
|
||||
@@ -1450,7 +1456,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the file name of the Api Test
|
||||
* Return the file name of the Api
|
||||
*
|
||||
* @param name the file name of the Api
|
||||
* @return the file name of the Api
|
||||
@@ -2422,7 +2428,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
return schema.getFormat();
|
||||
}
|
||||
return "string";
|
||||
} else if (ModelUtils.isFreeFormObject(schema)) {
|
||||
} else if (ModelUtils.isFreeFormObject(schema, openAPI)) {
|
||||
// Note: the value of a free-form object cannot be an arbitrary type. Per OAS specification,
|
||||
// it must be a map of string to values.
|
||||
return "object";
|
||||
@@ -2647,11 +2653,11 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
m.xmlName = ((Schema) innerSchema).getXml().getName();
|
||||
}
|
||||
if (modelDiscriminators > 1) {
|
||||
LOGGER.error("Allof composed schema is inheriting >1 discriminator. Only use one discriminator: {}", composed);
|
||||
LOGGER.debug("Allof composed schema is inheriting >1 discriminator. Only use one discriminator: {}", composed);
|
||||
}
|
||||
|
||||
if (modelImplCnt++ > 1) {
|
||||
LOGGER.warn("More than one inline schema specified in allOf:. Only the first one is recognized. All others are ignored.");
|
||||
LOGGER.debug("More than one inline schema specified in allOf:. Only the first one is recognized. All others are ignored.");
|
||||
break; // only one schema with discriminator allowed in allOf
|
||||
}
|
||||
}
|
||||
@@ -2831,7 +2837,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
if (ModelUtils.isMapSchema(schema)) {
|
||||
// an object or anyType composed schema that has additionalProperties set
|
||||
addAdditionPropertiesToCodeGenModel(m, schema);
|
||||
} else if (ModelUtils.isFreeFormObject(schema)) {
|
||||
} else if (ModelUtils.isFreeFormObject(schema, openAPI)) {
|
||||
// non-composed object type with no properties + additionalProperties
|
||||
// additionalProperties must be null, ObjectSchema, or empty Schema
|
||||
addAdditionPropertiesToCodeGenModel(m, schema);
|
||||
@@ -3037,7 +3043,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
m.isNullable = Boolean.TRUE;
|
||||
}
|
||||
|
||||
m.setTypeProperties(schema);
|
||||
m.setTypeProperties(schema, openAPI);
|
||||
m.setFormat(schema.getFormat());
|
||||
m.setComposedSchemas(getComposedSchemas(schema));
|
||||
if (ModelUtils.isArraySchema(schema)) {
|
||||
@@ -3152,7 +3158,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
additionalPropertiesIsAnyType = true;
|
||||
}
|
||||
} else {
|
||||
// if additioanl properties is set (e.g. free form object, any type, string, etc)
|
||||
// if additional properties is set (e.g. free form object, any type, string, etc)
|
||||
addPropProp = fromProperty(getAdditionalPropertiesName(), (Schema) schema.getAdditionalProperties(), false);
|
||||
additionalPropertiesIsAnyType = true;
|
||||
}
|
||||
@@ -3696,7 +3702,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
|
||||
protected void updatePropertyForObject(CodegenProperty property, Schema p) {
|
||||
if (ModelUtils.isFreeFormObject(p)) {
|
||||
if (ModelUtils.isFreeFormObject(p, openAPI)) {
|
||||
// non-composed object type with no properties + additionalProperties
|
||||
// additionalProperties must be null, ObjectSchema, or empty Schema
|
||||
property.isFreeFormObject = true;
|
||||
@@ -3947,6 +3953,12 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
List<Object> _enum = p.getEnum();
|
||||
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
|
||||
if (i == null) {
|
||||
property.isNullable = true;
|
||||
continue;
|
||||
}
|
||||
property._enum.add(String.valueOf(i));
|
||||
}
|
||||
property.isEnum = true;
|
||||
@@ -4020,7 +4032,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
property.datatypeWithEnum = property.dataType;
|
||||
}
|
||||
|
||||
property.setTypeProperties(p);
|
||||
property.setTypeProperties(p, openAPI);
|
||||
property.setComposedSchemas(getComposedSchemas(p));
|
||||
if (ModelUtils.isIntegerSchema(p)) { // integer type
|
||||
updatePropertyForInteger(property, p);
|
||||
@@ -4066,7 +4078,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
!ModelUtils.isComposedSchema(p) &&
|
||||
p.getAdditionalProperties() == null && p.getNot() == null && p.getEnum() == null);
|
||||
|
||||
if (!ModelUtils.isArraySchema(p) && !ModelUtils.isMapSchema(p) && !ModelUtils.isFreeFormObject(p) && !isAnyTypeWithNothingElseSet) {
|
||||
if (!ModelUtils.isArraySchema(p) && !ModelUtils.isMapSchema(p) && !ModelUtils.isFreeFormObject(p, openAPI) && !isAnyTypeWithNothingElseSet) {
|
||||
/* schemas that are not Array, not ModelUtils.isMapSchema, not isFreeFormObject, not AnyType with nothing else set
|
||||
* so primitive schemas int, str, number, referenced schemas, AnyType schemas with properties, enums, or composition
|
||||
*/
|
||||
@@ -4863,7 +4875,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
}
|
||||
|
||||
r.setTypeProperties(responseSchema);
|
||||
r.setTypeProperties(responseSchema, openAPI);
|
||||
r.setComposedSchemas(getComposedSchemas(responseSchema));
|
||||
if (ModelUtils.isArraySchema(responseSchema)) {
|
||||
r.simpleType = false;
|
||||
@@ -4923,7 +4935,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
r.isDouble = Boolean.TRUE;
|
||||
}
|
||||
} else if (ModelUtils.isTypeObjectSchema(responseSchema)) {
|
||||
if (ModelUtils.isFreeFormObject(responseSchema)) {
|
||||
if (ModelUtils.isFreeFormObject(responseSchema, openAPI)) {
|
||||
r.isFreeFormObject = true;
|
||||
} else {
|
||||
r.isModel = true;
|
||||
@@ -5187,7 +5199,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
|
||||
ModelUtils.syncValidationProperties(parameterSchema, codegenParameter);
|
||||
codegenParameter.setTypeProperties(parameterSchema);
|
||||
codegenParameter.setTypeProperties(parameterSchema, openAPI);
|
||||
codegenParameter.setComposedSchemas(getComposedSchemas(parameterSchema));
|
||||
|
||||
if (Boolean.TRUE.equals(parameterSchema.getNullable())) { // use nullable defined in the spec
|
||||
@@ -5237,7 +5249,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
if (ModelUtils.isMapSchema(parameterSchema)) { // for map parameter
|
||||
updateParameterForMap(codegenParameter, parameterSchema, imports);
|
||||
}
|
||||
if (ModelUtils.isFreeFormObject(parameterSchema)) {
|
||||
if (ModelUtils.isFreeFormObject(parameterSchema, openAPI)) {
|
||||
codegenParameter.isFreeFormObject = true;
|
||||
}
|
||||
addVarsRequiredVarsAdditionalProps(parameterSchema, codegenParameter);
|
||||
@@ -5666,6 +5678,8 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
}
|
||||
|
||||
private final Map<String, Integer> seenOperationIds = new HashMap<String, Integer>();
|
||||
|
||||
/**
|
||||
* Add operation to group
|
||||
*
|
||||
@@ -5686,13 +5700,18 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
// check for operationId uniqueness
|
||||
String uniqueName = co.operationId;
|
||||
int counter = 0;
|
||||
int counter = seenOperationIds.getOrDefault(uniqueName, 0);
|
||||
while(seenOperationIds.containsKey(uniqueName)) {
|
||||
uniqueName = co.operationId + "_" + counter;
|
||||
counter++;
|
||||
}
|
||||
for (CodegenOperation op : opList) {
|
||||
if (uniqueName.equals(op.operationId)) {
|
||||
uniqueName = co.operationId + "_" + counter;
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
seenOperationIds.put(co.operationId, counter);
|
||||
if (!co.operationId.equals(uniqueName)) {
|
||||
LOGGER.warn("generated unique operationId `{}`", uniqueName);
|
||||
}
|
||||
@@ -6068,30 +6087,68 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a value that is unique, suffixed with _index to make it unique
|
||||
* Ensures generated files are unique when compared case-insensitive
|
||||
* Not all operating systems support case-sensitive paths
|
||||
*/
|
||||
private String uniqueCaseInsensitiveString(String value, Map<String, String> seenValues) {
|
||||
if (seenValues.keySet().contains(value)) {
|
||||
return seenValues.get(value);
|
||||
}
|
||||
|
||||
Optional<Entry<String,String>> foundEntry = seenValues.entrySet().stream().filter(v -> v.getValue().toLowerCase(Locale.ROOT).equals(value.toLowerCase(Locale.ROOT))).findAny();
|
||||
if (foundEntry.isPresent()) {
|
||||
int counter = 0;
|
||||
String uniqueValue = value + "_" + counter;
|
||||
|
||||
while (seenValues.values().stream().map(v -> v.toLowerCase(Locale.ROOT)).collect(Collectors.toList()).contains(uniqueValue.toLowerCase(Locale.ROOT))) {
|
||||
counter++;
|
||||
uniqueValue = value + "_" + counter;
|
||||
}
|
||||
|
||||
seenValues.put(value, uniqueValue);
|
||||
return uniqueValue;
|
||||
}
|
||||
|
||||
seenValues.put(value, value);
|
||||
return value;
|
||||
}
|
||||
|
||||
private final Map<String, String> seenApiFilenames = new HashMap<String, String>();
|
||||
|
||||
@Override
|
||||
public String apiFilename(String templateName, String tag) {
|
||||
String uniqueTag = uniqueCaseInsensitiveString(tag, seenApiFilenames);
|
||||
String suffix = apiTemplateFiles().get(templateName);
|
||||
return apiFileFolder() + File.separator + toApiFilename(tag) + suffix;
|
||||
return apiFileFolder() + File.separator + toApiFilename(uniqueTag) + suffix;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String apiFilename(String templateName, String tag, String outputDir) {
|
||||
String uniqueTag = uniqueCaseInsensitiveString(tag, seenApiFilenames);
|
||||
String suffix = apiTemplateFiles().get(templateName);
|
||||
return outputDir + File.separator + toApiFilename(tag) + suffix;
|
||||
return outputDir + File.separator + toApiFilename(uniqueTag) + suffix;
|
||||
}
|
||||
|
||||
private final Map<String, String> seenModelFilenames = new HashMap<String, String>();
|
||||
|
||||
@Override
|
||||
public String modelFilename(String templateName, String modelName) {
|
||||
String uniqueModelName = uniqueCaseInsensitiveString(modelName, seenModelFilenames);
|
||||
String suffix = modelTemplateFiles().get(templateName);
|
||||
return modelFileFolder() + File.separator + toModelFilename(modelName) + suffix;
|
||||
return modelFileFolder() + File.separator + toModelFilename(uniqueModelName) + suffix;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String modelFilename(String templateName, String modelName, String outputDir) {
|
||||
String uniqueModelName = uniqueCaseInsensitiveString(modelName, seenModelFilenames);
|
||||
String suffix = modelTemplateFiles().get(templateName);
|
||||
return outputDir + File.separator + toModelFilename(modelName) + suffix;
|
||||
return outputDir + File.separator + toModelFilename(uniqueModelName) + suffix;
|
||||
}
|
||||
|
||||
private final Map<String, String> seenApiDocFilenames = new HashMap<String, String>();
|
||||
|
||||
/**
|
||||
* Return the full path and API documentation file
|
||||
*
|
||||
@@ -6101,11 +6158,14 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
*/
|
||||
@Override
|
||||
public String apiDocFilename(String templateName, String tag) {
|
||||
String uniqueTag = uniqueCaseInsensitiveString(tag, seenApiDocFilenames);
|
||||
String docExtension = getDocExtension();
|
||||
String suffix = docExtension != null ? docExtension : apiDocTemplateFiles().get(templateName);
|
||||
return apiDocFileFolder() + File.separator + toApiDocFilename(tag) + suffix;
|
||||
return apiDocFileFolder() + File.separator + toApiDocFilename(uniqueTag) + suffix;
|
||||
}
|
||||
|
||||
private final Map<String, String> seenApiTestFilenames = new HashMap<String, String>();
|
||||
|
||||
/**
|
||||
* Return the full path and API test file
|
||||
*
|
||||
@@ -6115,8 +6175,9 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
*/
|
||||
@Override
|
||||
public String apiTestFilename(String templateName, String tag) {
|
||||
String uniqueTag = uniqueCaseInsensitiveString(tag, seenApiTestFilenames);
|
||||
String suffix = apiTestTemplateFiles().get(templateName);
|
||||
return apiTestFileFolder() + File.separator + toApiTestFilename(tag) + suffix;
|
||||
return apiTestFileFolder() + File.separator + toApiTestFilename(uniqueTag) + suffix;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -6154,6 +6215,16 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
this.skipOperationExample = skipOperationExample;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSkipSortingOperations() {
|
||||
return this.skipSortingOperations;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSkipSortingOperations(boolean skipSortingOperations) {
|
||||
this.skipSortingOperations = skipSortingOperations;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHideGenerationTimestamp() {
|
||||
return hideGenerationTimestamp;
|
||||
@@ -6628,6 +6699,11 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
: 0;
|
||||
|
||||
for (Object value : values) {
|
||||
if (value == null) {
|
||||
// raw null values in enums are unions for nullable
|
||||
// attributes, not actual enum values, so we remove them here
|
||||
continue;
|
||||
}
|
||||
Map<String, Object> enumVar = new HashMap<>();
|
||||
String enumName = truncateIdx == 0
|
||||
? String.valueOf(value)
|
||||
@@ -7103,7 +7179,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
|
||||
Schema ps = unaliasSchema(propertySchema);
|
||||
ModelUtils.syncValidationProperties(ps, codegenParameter);
|
||||
codegenParameter.setTypeProperties(ps);
|
||||
codegenParameter.setTypeProperties(ps, openAPI);
|
||||
codegenParameter.setComposedSchemas(getComposedSchemas(ps));
|
||||
if (ps.getPattern() != null) {
|
||||
codegenParameter.pattern = toRegularExpression(ps.getPattern());
|
||||
@@ -7194,7 +7270,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
codegenParameter.isPrimitiveType = false;
|
||||
codegenParameter.items = codegenProperty.items;
|
||||
codegenParameter.mostInnerItems = codegenProperty.mostInnerItems;
|
||||
} else if (ModelUtils.isFreeFormObject(ps)) {
|
||||
} else if (ModelUtils.isFreeFormObject(ps, openAPI)) {
|
||||
codegenParameter.isFreeFormObject = true;
|
||||
}
|
||||
} else if (ModelUtils.isNullType(ps)) {
|
||||
@@ -7370,7 +7446,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
if (StringUtils.isBlank(name)) {
|
||||
useModel = false;
|
||||
} else {
|
||||
if (ModelUtils.isFreeFormObject(schema)) {
|
||||
if (ModelUtils.isFreeFormObject(schema, openAPI)) {
|
||||
useModel = ModelUtils.shouldGenerateFreeFormObjectModel(name, this);
|
||||
} else if (ModelUtils.isMapSchema(schema)) {
|
||||
useModel = ModelUtils.shouldGenerateMapModel(schema);
|
||||
@@ -7449,7 +7525,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
if (ModelUtils.isMapSchema(schema)) {
|
||||
// Schema with additionalproperties: true (including composed schemas with additionalproperties: true)
|
||||
updateRequestBodyForMap(codegenParameter, schema, name, imports, bodyParameterName);
|
||||
} else if (ModelUtils.isFreeFormObject(schema)) {
|
||||
} else if (ModelUtils.isFreeFormObject(schema, openAPI)) {
|
||||
// non-composed object type with no properties + additionalProperties
|
||||
// additionalProperties must be null, ObjectSchema, or empty Schema
|
||||
codegenParameter.isFreeFormObject = true;
|
||||
@@ -7712,7 +7788,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
schema = ModelUtils.getReferencedSchema(this.openAPI, schema);
|
||||
|
||||
ModelUtils.syncValidationProperties(unaliasedSchema, codegenParameter);
|
||||
codegenParameter.setTypeProperties(unaliasedSchema);
|
||||
codegenParameter.setTypeProperties(unaliasedSchema, openAPI);
|
||||
codegenParameter.setComposedSchemas(getComposedSchemas(unaliasedSchema));
|
||||
// TODO in the future switch al the below schema usages to unaliasedSchema
|
||||
// because it keeps models as refs and will not get their referenced schemas
|
||||
@@ -8065,6 +8141,43 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
LOGGER.debug("Post processing file {} ({})", file, fileType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes an external command for file post processing.
|
||||
*
|
||||
* @param commandArr an array of commands and arguments. They will be concatenated with space and tokenized again.
|
||||
* @return Whether the execution passed (true) or failed (false)
|
||||
*/
|
||||
protected boolean executePostProcessor(String[] commandArr) {
|
||||
final String command = String.join(" ", commandArr);
|
||||
try {
|
||||
// we don't use the array variant here, because the command passed in by the user is often not only a single binary
|
||||
// but a combination of binary + parameters, e.g. `/etc/bin prettier -w`, which would then not be found, as the
|
||||
// first array item would be expected to be the binary only. The exec method is tokenizing the command for us.
|
||||
Process p = Runtime.getRuntime().exec(command);
|
||||
p.waitFor();
|
||||
int exitValue = p.exitValue();
|
||||
if (exitValue != 0) {
|
||||
try (InputStreamReader inputStreamReader = new InputStreamReader(p.getErrorStream(), StandardCharsets.UTF_8);
|
||||
BufferedReader br = new BufferedReader(inputStreamReader)) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
sb.append(line);
|
||||
}
|
||||
LOGGER.error("Error running the command ({}). Exit value: {}, Error output: {}", command, exitValue, sb);
|
||||
}
|
||||
} else {
|
||||
LOGGER.info("Successfully executed: {}", command);
|
||||
return true;
|
||||
}
|
||||
} catch (InterruptedException | IOException e) {
|
||||
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
|
||||
// Restore interrupted state
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Boolean value indicating the state of the option for post-processing file using environment variables.
|
||||
*
|
||||
@@ -8331,6 +8444,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
List<CodegenProperty> xOf = new ArrayList<>();
|
||||
Set<String> dataTypeSet = new HashSet<>(); // to keep track of dataType
|
||||
Set<String> dataTypeSetIgnoringErasure = new HashSet<>();
|
||||
int i = 0;
|
||||
for (Schema xOfSchema : xOfCollection) {
|
||||
CodegenProperty cp = fromProperty(collectionName + "_" + i, xOfSchema, false);
|
||||
@@ -8339,7 +8453,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
|
||||
if (dataTypeSet.contains(cp.dataType)
|
||||
|| (isTypeErasedGenerics() && dataTypeSet.contains(cp.baseType))) {
|
||||
// add "x-duplicated-data-type" to indicate if the dataType already occurs before
|
||||
// add "x-duplicated-data-type" to indicate if the (base) dataType already occurs before
|
||||
// in other sub-schemas of allOf/anyOf/oneOf
|
||||
cp.vendorExtensions.putIfAbsent("x-duplicated-data-type", true);
|
||||
} else {
|
||||
@@ -8349,6 +8463,13 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
dataTypeSet.add(cp.dataType);
|
||||
}
|
||||
}
|
||||
if (dataTypeSetIgnoringErasure.contains(cp.dataType)) {
|
||||
// add "x-duplicated-data-type-ignoring-erasure" to indicate if the dataType already occurs before
|
||||
// in other sub-schemas of allOf/anyOf/oneOf
|
||||
cp.vendorExtensions.putIfAbsent("x-duplicated-data-type-ignoring-erasure", true);
|
||||
} else {
|
||||
dataTypeSetIgnoringErasure.add(cp.dataType);
|
||||
}
|
||||
}
|
||||
return xOf;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import io.swagger.v3.oas.models.OpenAPI;
|
||||
import io.swagger.v3.oas.models.Operation;
|
||||
import io.swagger.v3.oas.models.PathItem;
|
||||
import io.swagger.v3.oas.models.Paths;
|
||||
import io.swagger.v3.oas.models.SpecVersion;
|
||||
import io.swagger.v3.oas.models.info.Contact;
|
||||
import io.swagger.v3.oas.models.info.Info;
|
||||
import io.swagger.v3.oas.models.info.License;
|
||||
@@ -31,7 +32,7 @@ import io.swagger.v3.oas.models.security.*;
|
||||
import io.swagger.v3.oas.models.tags.Tag;
|
||||
import lombok.Getter;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.io.comparator.PathFileComparator;
|
||||
import org.apache.commons.io.IOCase;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.api.TemplateDefinition;
|
||||
@@ -121,6 +122,7 @@ public class DefaultGenerator implements Generator {
|
||||
this.opts = opts;
|
||||
this.openAPI = opts.getOpenAPI();
|
||||
this.config = opts.getConfig();
|
||||
|
||||
List<TemplateDefinition> userFiles = opts.getUserDefinedTemplates();
|
||||
if (userFiles != null) {
|
||||
this.userDefinedTemplates = Collections.unmodifiableList(userFiles);
|
||||
@@ -342,6 +344,12 @@ public class DefaultGenerator implements Generator {
|
||||
config.additionalProperties().put("unescapedAppDescription", info.getDescription());
|
||||
}
|
||||
|
||||
if (this.openAPI.getSpecVersion().equals(SpecVersion.V31) && !StringUtils.isEmpty(info.getSummary())) {
|
||||
config.additionalProperties().put("appSummary", config.escapeText(info.getSummary()));
|
||||
config.additionalProperties().put("appSummaryWithNewLines", config.escapeTextWhileAllowingNewLines(info.getSummary()));
|
||||
config.additionalProperties().put("unescapedAppSummary", info.getSummary());
|
||||
}
|
||||
|
||||
if (info.getContact() != null) {
|
||||
Contact contact = info.getContact();
|
||||
if (contact.getEmail() != null) {
|
||||
@@ -491,7 +499,7 @@ public class DefaultGenerator implements Generator {
|
||||
if (schema.getExtensions() != null && Boolean.TRUE.equals(schema.getExtensions().get("x-internal"))) {
|
||||
LOGGER.info("Model {} not generated since x-internal is set to true", name);
|
||||
continue;
|
||||
} else if (ModelUtils.isFreeFormObject(schema)) { // check to see if it's a free-form object
|
||||
} else if (ModelUtils.isFreeFormObject(schema, openAPI)) { // check to see if it's a free-form object
|
||||
if (!ModelUtils.shouldGenerateFreeFormObjectModel(name, config)) {
|
||||
LOGGER.info("Model {} not generated since it's a free-form object", name);
|
||||
continue;
|
||||
@@ -680,7 +688,10 @@ public class DefaultGenerator implements Generator {
|
||||
for (String tag : paths.keySet()) {
|
||||
try {
|
||||
List<CodegenOperation> ops = paths.get(tag);
|
||||
ops.sort((one, another) -> ObjectUtils.compare(one.operationId, another.operationId));
|
||||
if(!this.config.isSkipSortingOperations()) {
|
||||
// sort operations by operationId
|
||||
ops.sort((one, another) -> ObjectUtils.compare(one.operationId, another.operationId));
|
||||
}
|
||||
OperationsMap operation = processOperations(config, tag, ops, allModels);
|
||||
URL url = URLPathUtils.getServerURL(openAPI, config.serverVariableOverrides());
|
||||
operation.put("basePath", basePath);
|
||||
@@ -1430,6 +1441,8 @@ public class DefaultGenerator implements Generator {
|
||||
return processTemplateToFile(templateData, templateName, outputFilename, shouldGenerate, skippedByOption, this.config.getOutputDir());
|
||||
}
|
||||
|
||||
private final Set<String> seenFiles = new HashSet<>();
|
||||
|
||||
private File processTemplateToFile(Map<String, Object> templateData, String templateName, String outputFilename, boolean shouldGenerate, String skippedByOption, String intendedOutputDir) throws IOException {
|
||||
String adjustedOutputFilename = outputFilename.replaceAll("//", "/").replace('/', File.separatorChar);
|
||||
File target = new File(adjustedOutputFilename);
|
||||
@@ -1440,6 +1453,11 @@ public class DefaultGenerator implements Generator {
|
||||
if (!absoluteTarget.startsWith(outDir)) {
|
||||
throw new RuntimeException(String.format(Locale.ROOT, "Target files must be generated within the output directory; absoluteTarget=%s outDir=%s", absoluteTarget, outDir));
|
||||
}
|
||||
|
||||
if (seenFiles.stream().filter(f -> f.toLowerCase(Locale.ROOT).equals(absoluteTarget.toString().toLowerCase(Locale.ROOT))).findAny().isPresent()) {
|
||||
LOGGER.warn("Duplicate file path detected. Not all operating systems can handle case sensitive file paths. path={}", absoluteTarget.toString());
|
||||
}
|
||||
seenFiles.add(absoluteTarget.toString());
|
||||
return this.templateProcessor.write(templateData, templateName, target);
|
||||
} else {
|
||||
this.templateProcessor.skip(target.toPath(), String.format(Locale.ROOT, "Skipped by %s options supplied by user.", skippedByOption));
|
||||
@@ -1977,7 +1995,8 @@ public class DefaultGenerator implements Generator {
|
||||
// NOTE: Don't use File.separator here as we write linux-style paths to FILES, and File.separator will
|
||||
// result in incorrect match on Windows machines.
|
||||
String relativeMeta = METADATA_DIR + "/VERSION";
|
||||
filesToSort.sort(PathFileComparator.PATH_COMPARATOR);
|
||||
|
||||
final List<String> relativePaths = new ArrayList<>(filesToSort.size());
|
||||
filesToSort.forEach(f -> {
|
||||
// some Java implementations don't honor .relativize documentation fully.
|
||||
// When outDir is /a/b and the input is /a/b/c/d, the result should be c/d.
|
||||
@@ -1990,10 +2009,15 @@ public class DefaultGenerator implements Generator {
|
||||
relativePath = relativePath.replace(File.separator, "/");
|
||||
}
|
||||
if (!relativePath.equals(relativeMeta)) {
|
||||
sb.append(relativePath).append(System.lineSeparator());
|
||||
relativePaths.add(relativePath);
|
||||
}
|
||||
});
|
||||
|
||||
Collections.sort(relativePaths, (a, b) -> IOCase.SENSITIVE.checkCompareTo(a,b));
|
||||
relativePaths.forEach(relativePath -> {
|
||||
sb.append(relativePath).append(System.lineSeparator());
|
||||
});
|
||||
|
||||
String targetFile = config.outputFolder() + File.separator + METADATA_DIR + File.separator + config.getFilesMetadataFilename();
|
||||
|
||||
File filesFile = this.templateProcessor.writeToFile(targetFile, sb.toString().getBytes(StandardCharsets.UTF_8));
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user