forked from loafle/openapi-generator-original
Compare commits
115 Commits
devhl-labs
...
appdescrip
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a6efa58341 | ||
|
|
d45b1c8f37 | ||
|
|
a00549cd65 | ||
|
|
3bd6d67cc0 | ||
|
|
1bb4d42216 | ||
|
|
d7b808e2e9 | ||
|
|
efb7e5624d | ||
|
|
50945d0e17 | ||
|
|
fbe2e0b18f | ||
|
|
4dc8531a67 | ||
|
|
59ba346306 | ||
|
|
7036b99e91 | ||
|
|
dc96d648f7 | ||
|
|
1d67d0632d | ||
|
|
d71df6ab85 | ||
|
|
58aad760f0 | ||
|
|
99b5fe9f9c | ||
|
|
a724c754bc | ||
|
|
cbf52aefe4 | ||
|
|
36911c773e | ||
|
|
c64d569a7d | ||
|
|
406d00fe9b | ||
|
|
d25c5a8b26 | ||
|
|
73bca68fea | ||
|
|
2217a7b0f2 | ||
|
|
6568bc54a5 | ||
|
|
c8e835cac7 | ||
|
|
93f4323364 | ||
|
|
d99affda96 | ||
|
|
514c0d6448 | ||
|
|
807250a430 | ||
|
|
cce4139af6 | ||
|
|
7609273a02 | ||
|
|
dd97def5fa | ||
|
|
213564a5aa | ||
|
|
7b0f963c74 | ||
|
|
c109399f3f | ||
|
|
c7b33c4762 | ||
|
|
1471e7a0d0 | ||
|
|
81f576c9da | ||
|
|
8155d03c38 | ||
|
|
4cde53c3d7 | ||
|
|
24c1968002 | ||
|
|
359ff9e457 | ||
|
|
85c81e84d5 | ||
|
|
86186586c7 | ||
|
|
0b3e6edb98 | ||
|
|
65e74a354d | ||
|
|
b4c315ebce | ||
|
|
03af25ce34 | ||
|
|
ff8fa40808 | ||
|
|
172c4d11b4 | ||
|
|
97c1dc8a1a | ||
|
|
44ae981830 | ||
|
|
a887f6d4bf | ||
|
|
6bcc28d06e | ||
|
|
9351217048 | ||
|
|
2bfc5a3958 | ||
|
|
ef36ea410e | ||
|
|
eb506ee776 | ||
|
|
a651376b18 | ||
|
|
abfeb6e035 | ||
|
|
edd91063b4 | ||
|
|
1a06e3e0fb | ||
|
|
6a2ad134c6 | ||
|
|
d6749f8a0e | ||
|
|
3cb3fc2898 | ||
|
|
a245e86b74 | ||
|
|
b2a7f435c8 | ||
|
|
45a657f59d | ||
|
|
83b45fd1e8 | ||
|
|
b2faf39ac7 | ||
|
|
453facc81c | ||
|
|
2c663561ef | ||
|
|
101b3fcc35 | ||
|
|
79fe176ef2 | ||
|
|
3f143a3b5a | ||
|
|
560089e4c7 | ||
|
|
a91d8e2c57 | ||
|
|
494d74ab82 | ||
|
|
fbc8616a06 | ||
|
|
650e119f22 | ||
|
|
d2c48e2999 | ||
|
|
2168851e8a | ||
|
|
3d2e38e347 | ||
|
|
b11005b00d | ||
|
|
3bb17efa09 | ||
|
|
ac14e66da1 | ||
|
|
1024c7733e | ||
|
|
90301f932d | ||
|
|
6d10e80916 | ||
|
|
f357be480e | ||
|
|
2a39b29684 | ||
|
|
88204b247a | ||
|
|
2934f5ac51 | ||
|
|
2ce71512d0 | ||
|
|
927768757b | ||
|
|
858499ffdd | ||
|
|
4719d9e55f | ||
|
|
2d7f0496ec | ||
|
|
2fac8e34db | ||
|
|
1704ae1194 | ||
|
|
370eca2889 | ||
|
|
d0f8468651 | ||
|
|
6252dac28e | ||
|
|
807aa5d3ae | ||
|
|
f73db59b0e | ||
|
|
34ebc1c644 | ||
|
|
de680de60e | ||
|
|
e78aeb6bc7 | ||
|
|
309918d03e | ||
|
|
6690b9f87d | ||
|
|
ee69a7983a | ||
|
|
204407daf0 | ||
|
|
d1860b95cf |
17
.github/workflows/openapi-generator.yaml
vendored
17
.github/workflows/openapi-generator.yaml
vendored
@@ -140,8 +140,23 @@ jobs:
|
||||
with:
|
||||
name: openapi-generator-cli.jar
|
||||
path: modules/openapi-generator-cli/target
|
||||
- name: Delete samples that are entirely generated
|
||||
run: |
|
||||
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
|
||||
rm -rf samples/client/petstore/csharp/generichost/net8/FormModels
|
||||
rm -rf samples/client/petstore/csharp/generichost/net8/NullReferenceTypes
|
||||
rm -rf samples/client/petstore/csharp/generichost/net8/OneOf
|
||||
rm -rf samples/client/petstore/csharp/generichost/net8/Petstore
|
||||
rm -rf samples/client/petstore/csharp/generichost/net8/SourceGeneration
|
||||
rm -rf samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate
|
||||
rm -rf samples/client/petstore/csharp/generichost/standard2.0/Petstore
|
||||
- name: Generate samples
|
||||
run: bash bin/generate-samples.sh
|
||||
run: |
|
||||
bash bin/generate-samples.sh
|
||||
# when a sample is deleted, you have to generate it twice for all files to get created
|
||||
bash bin/generate-samples.sh
|
||||
- name: Verify git status
|
||||
run: |
|
||||
if [[ "$(git status --porcelain)" != "" ]]; then
|
||||
|
||||
34
.github/workflows/samples-dotnet-standard.yaml
vendored
34
.github/workflows/samples-dotnet-standard.yaml
vendored
@@ -3,22 +3,16 @@ name: Samples C# .Net Standard Client
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
# build C# API client (netstandard)
|
||||
- samples/client/petstore/csharp/OpenAPIClient/**
|
||||
- samples/client/petstore/csharp/*netstandard*/**
|
||||
# build C# API client (netstandard with ConditionalSerialization)
|
||||
- samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/**
|
||||
# build C# API client (netstandard httpclient)
|
||||
- samples/client/petstore/csharp/OpenAPIClient-httpclient/**
|
||||
- samples/client/petstore/csharp/generichost/standard2.0/**
|
||||
- samples/client/petstore/csharp/httpclient/standard2.0/**
|
||||
- samples/client/petstore/csharp/restsharp/standard2.0/**
|
||||
- samples/client/petstore/csharp/unityWebRequest/standard2.0/**
|
||||
pull_request:
|
||||
paths:
|
||||
# build C# API client (netstandard)
|
||||
- samples/client/petstore/csharp/OpenAPIClient/**
|
||||
- samples/client/petstore/csharp/*netstandard*/**
|
||||
# build C# API client (netstandard with ConditionalSerialization)
|
||||
- samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/**
|
||||
# build C# API client (netstandard httpclient)
|
||||
- samples/client/petstore/csharp/OpenAPIClient-httpclient/**
|
||||
- samples/client/petstore/csharp/generichost/standard2.0/**
|
||||
- samples/client/petstore/csharp/httpclient/standard2.0/**
|
||||
- samples/client/petstore/csharp/restsharp/standard2.0/**
|
||||
- samples/client/petstore/csharp/unityWebRequest/standard2.0/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build .Net projects
|
||||
@@ -27,13 +21,11 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
# build C# API client (netstandard)
|
||||
- samples/client/petstore/csharp/OpenAPIClient/
|
||||
- samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/
|
||||
# build C# API client (netstandard with ConditionalSerialization)
|
||||
- samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/
|
||||
# build C# API client (netstandard httpclient)
|
||||
- samples/client/petstore/csharp/OpenAPIClient-httpclient/
|
||||
- samples/client/petstore/csharp/generichost/standard2.0/Petstore/
|
||||
- samples/client/petstore/csharp/httpclient/standard2.0/Petstore/
|
||||
- samples/client/petstore/csharp/restsharp/standard2.0/Petstore/
|
||||
- samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/
|
||||
# - samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-dotnet@v4.0.0
|
||||
|
||||
37
.github/workflows/samples-dotnet.yaml
vendored
37
.github/workflows/samples-dotnet.yaml
vendored
@@ -3,16 +3,16 @@ name: Samples C# .Net 8 Clients
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- samples/client/petstore/csharp/OpenAPIClient-generichost-manual-tests/**
|
||||
- samples/client/petstore/csharp/*net6.0*/**
|
||||
- samples/client/petstore/csharp/*net7.0*/**
|
||||
- samples/client/petstore/csharp/OpenAPIClient-*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/OpenAPIClient-generichost-manual-tests/**
|
||||
- samples/client/petstore/csharp/*net6.0*/**
|
||||
- samples/client/petstore/csharp/*net7.0*/**
|
||||
- samples/client/petstore/csharp/OpenAPIClient-*latest*/**
|
||||
- samples/client/petstore/csharp/generichost/net8/**
|
||||
- samples/client/petstore/csharp/httpclient/net8/**
|
||||
- samples/client/petstore/csharp/restsharp/net8/**
|
||||
- samples/client/petstore/csharp/unityWebRequest/net8/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build .Net projects
|
||||
@@ -21,16 +21,17 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
# clients
|
||||
- samples/client/petstore/csharp/OpenAPIClient-generichost-manual-tests
|
||||
- samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0
|
||||
- samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt
|
||||
- samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration
|
||||
- samples/client/petstore/csharp/OpenAPIClient-generichost-net7.0-useDateTimeForDate
|
||||
- samples/client/petstore/csharp/OpenAPIClient-generichost-netcore-latest-allOf
|
||||
- samples/client/petstore/csharp/OpenAPIClient-generichost-netcore-latest-anyOf
|
||||
- samples/client/petstore/csharp/OpenAPIClient-generichost-netcore-latest-oneOf
|
||||
- samples/client/petstore/csharp/OpenAPIClient-net7.0-useDateTimeForDate
|
||||
- samples/client/petstore/csharp/generichost/net8/AllOf
|
||||
- samples/client/petstore/csharp/generichost/net8/AnyOf
|
||||
- samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare
|
||||
- samples/client/petstore/csharp/generichost/net8/FormModels
|
||||
- samples/client/petstore/csharp/generichost/net8/ManualPetstoreTests
|
||||
- samples/client/petstore/csharp/generichost/net8/ManualSourceGenerationTests
|
||||
- samples/client/petstore/csharp/generichost/net8/NullReferenceTypes
|
||||
- samples/client/petstore/csharp/generichost/net8/OneOf
|
||||
- samples/client/petstore/csharp/generichost/net8/Petstore
|
||||
- samples/client/petstore/csharp/generichost/net8/SourceGeneration
|
||||
- samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-dotnet@v4.0.0
|
||||
|
||||
33
.github/workflows/samples-dotnet6-client.yaml
vendored
33
.github/workflows/samples-dotnet6-client.yaml
vendored
@@ -3,28 +3,10 @@ name: Samples C# .Net 6 Client
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
# build C# API client (httpclient)
|
||||
- samples/client/petstore/csharp/OpenAPIClient-httpclient/**
|
||||
# build C# API client (.net framework 4.7)
|
||||
- samples/client/petstore/csharp/OpenAPIClient-net47/**
|
||||
# build C# API client (.net framework 4.8)
|
||||
- samples/client/petstore/csharp/OpenAPIClient-net48/**
|
||||
# build C# API client (property, parameter name mappings)
|
||||
- samples/client/petstore/csharp/OpenAPIClient-restsharp-name-parameter-mappings/**
|
||||
# build C# API client (multiple frameworks)
|
||||
- samples/client/petstore/csharp/OpenAPIClientCoreAndNet47/**
|
||||
- samples/client/petstore/csharp/restsharp/net6/**
|
||||
pull_request:
|
||||
paths:
|
||||
# build C# API client (httpclient)
|
||||
- samples/client/petstore/csharp/OpenAPIClient-httpclient/**
|
||||
# build C# API client (.net framework 4.7)
|
||||
- samples/client/petstore/csharp/OpenAPIClient-net47/**
|
||||
# build C# API client (.net framework 4.8)
|
||||
- samples/client/petstore/csharp/OpenAPIClient-net48/**
|
||||
# build C# API client (property, parameter name mappings)
|
||||
- samples/client/petstore/csharp/OpenAPIClient-restsharp-name-parameter-mappings/**
|
||||
# build C# API client (multiple frameworks)
|
||||
- samples/client/petstore/csharp/OpenAPIClientCoreAndNet47/**
|
||||
- samples/client/petstore/csharp/restsharp/net6/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build .Net clients
|
||||
@@ -33,16 +15,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
# build C# API client (httpclient)
|
||||
- samples/client/petstore/csharp/OpenAPIClient-httpclient/
|
||||
# build C# API client (.net framework 4.7)
|
||||
- samples/client/petstore/csharp/OpenAPIClient-net47/
|
||||
# build C# API client (.net framework 4.8)
|
||||
- samples/client/petstore/csharp/OpenAPIClient-net48/
|
||||
# build C# API client (property, parameter name mappings)
|
||||
- samples/client/petstore/csharp/OpenAPIClient-restsharp-name-parameter-mappings/
|
||||
# build C# API client (multiple frameworks)
|
||||
- samples/client/petstore/csharp/OpenAPIClientCoreAndNet47/
|
||||
- samples/client/petstore/csharp/restsharp/net6/ParameterMappings/
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-dotnet@v4.0.0
|
||||
|
||||
@@ -13,6 +13,8 @@ on:
|
||||
- samples/client/others/java/okhttp-gson-oneOf/**
|
||||
- samples/client/others/java/resttemplate-useAbstractionForFiles/**
|
||||
- samples/client/others/java/webclient-useAbstractionForFiles/**
|
||||
- samples/client/others/java/jersey2-oneOf-duplicates/**
|
||||
- samples/client/others/java/jersey2-oneOf-Mixed/**
|
||||
pull_request:
|
||||
paths:
|
||||
- 'samples/client/petstore/java/**'
|
||||
@@ -25,6 +27,8 @@ on:
|
||||
- samples/client/others/java/okhttp-gson-oneOf/**
|
||||
- samples/client/others/java/resttemplate-useAbstractionForFiles/**
|
||||
- samples/client/others/java/webclient-useAbstractionForFiles/**
|
||||
- samples/client/others/java/jersey2-oneOf-duplicates/**
|
||||
- samples/client/others/java/jersey2-oneOf-Mixed/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build Java Client JDK11
|
||||
@@ -69,8 +73,11 @@ jobs:
|
||||
- samples/client/petstore/java/resttemplate-swagger2/
|
||||
- samples/openapi3/client/petstore/java/jersey2-java8-swagger2/
|
||||
- samples/client/others/java/okhttp-gson-oneOf/
|
||||
- samples/client/echo_api/java/okhttp-gson-user-defined-templates/
|
||||
- samples/client/others/java/resttemplate-useAbstractionForFiles/
|
||||
- samples/client/others/java/webclient-useAbstractionForFiles/
|
||||
- samples/client/others/java/jersey2-oneOf-duplicates/
|
||||
- samples/client/others/java/jersey2-oneOf-Mixed/
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-java@v4
|
||||
|
||||
2
.github/workflows/samples-julia.yaml
vendored
2
.github/workflows/samples-julia.yaml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: julia-actions/setup-julia@v1
|
||||
- uses: julia-actions/setup-julia@v2
|
||||
with:
|
||||
version: 1.8
|
||||
arch: x64
|
||||
|
||||
3
.github/workflows/samples-php8.yaml
vendored
3
.github/workflows/samples-php8.yaml
vendored
@@ -4,9 +4,11 @@ on:
|
||||
push:
|
||||
paths:
|
||||
- samples/server/petstore/php-symfony/SymfonyBundle-php/**
|
||||
- samples/server/petstore/php-flight/**
|
||||
pull_request:
|
||||
paths:
|
||||
- samples/server/petstore/php-symfony/SymfonyBundle-php/**
|
||||
- samples/server/petstore/php-flight/**
|
||||
jobs:
|
||||
build:
|
||||
name: Build PHP projects
|
||||
@@ -17,6 +19,7 @@ jobs:
|
||||
sample:
|
||||
# servers
|
||||
- samples/server/petstore/php-symfony/SymfonyBundle-php/
|
||||
- samples/server/petstore/php-flight/
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup PHP with tools
|
||||
|
||||
1
.github/workflows/samples-scala.yaml
vendored
1
.github/workflows/samples-scala.yaml
vendored
@@ -32,6 +32,7 @@ jobs:
|
||||
- samples/server/petstore/scalatra
|
||||
- samples/server/petstore/scala-finch # cannot be tested with jdk11
|
||||
- samples/server/petstore/scala-http4s-server
|
||||
- samples/server/petstore/scala-cask
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-java@v4
|
||||
|
||||
1
.github/workflows/samples-spring.yaml
vendored
1
.github/workflows/samples-spring.yaml
vendored
@@ -34,6 +34,7 @@ jobs:
|
||||
- samples/openapi3/client/petstore/spring-cloud-async
|
||||
- samples/openapi3/client/petstore/spring-cloud-spring-pageable
|
||||
- samples/client/petstore/spring-cloud-tags
|
||||
- samples/client/petstore/spring-cloud-auth
|
||||
- samples/client/petstore/spring-cloud-deprecated
|
||||
# servers
|
||||
- samples/server/petstore/springboot
|
||||
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -85,6 +85,11 @@ samples/client/petstore/cpp-restsdk/CMakeCache.txt
|
||||
samples/client/petstore/cpp-restsdk/CMakeFiles/
|
||||
samples/client/petstore/cpp-restsdk/Makefile
|
||||
samples/client/petstore/cpp-restsdk/cmake_install.cmake
|
||||
samples/client/petstore/cpp-restsdk/client/CMakeFiles
|
||||
samples/client/petstore/cpp-restsdk/client/Makefile
|
||||
samples/client/petstore/cpp-restsdk/client/cmake_install.cmake
|
||||
samples/client/petstore/cpp-restsdk/client/CppRestPetstoreClientConfig.cmake
|
||||
samples/client/petstore/cpp-restsdk/client/CMakeCache.txt
|
||||
|
||||
#Java/Android
|
||||
**/.gradle
|
||||
|
||||
@@ -13,7 +13,7 @@ if [ "$NODE_INDEX" = "1" ]; then
|
||||
echo "Running node $NODE_INDEX ..."
|
||||
java -version
|
||||
|
||||
sudo apt-get -y install cpanminus libmagic-dev
|
||||
sudo apt-get -y install cpanminus
|
||||
|
||||
(cd samples/client/petstore/perl && /bin/bash ./test.bash)
|
||||
(cd samples/client/petstore/ruby && mvn integration-test)
|
||||
@@ -112,5 +112,3 @@ else
|
||||
(cd samples/client/petstore/java/apache-httpclient && mvn integration-test)
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ Please file the pull request against the correct branch, e.g. `master` for non-b
|
||||
|
||||
All the code generators can be found in [modules/openapi-generator/src/main/java/org/openapitools/codegen/languages](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages)
|
||||
|
||||
If you want to add a new generator, follow the [new-generator](https://openapi-generator.tech/docs/new-generator) guide.
|
||||
If you want to add a new generator, follow the [new-generator](https://openapi-generator.tech/docs/new-generator) guide.
|
||||
|
||||
### Templates
|
||||
|
||||
@@ -84,6 +84,26 @@ For [Vendor Extensions](https://github.com/OAI/OpenAPI-Specification/blob/master
|
||||
- For language-specified vendor extension, put it in the form of `x-{lang}-{extension-name}`. e.g. `x-objc-operation-id`, `x-java-feign-retry-limit`
|
||||
- For a list of existing vendor extensions in use, please refer to https://github.com/openapitools/openapi-generator/wiki/Vendor-Extensions. If you've added new vendor extensions as part of your PR, please update the wiki page.
|
||||
|
||||
### Building
|
||||
|
||||
The `openapi-generator-cli` can be built using the following command. This will generate the `openapi-generator-cli.jar` in the `modules/openapi-generator-cli/target` directory without running the tests and generating the Javadocs.
|
||||
|
||||
```shell
|
||||
./mvnw clean install -DskipTests -Dmaven.javadoc.skip=true
|
||||
```
|
||||
|
||||
Or on Windows:
|
||||
|
||||
```shell
|
||||
mvnw.cmd clean install -DskipTests -Dmaven.javadoc.skip=true
|
||||
```
|
||||
|
||||
The binary can run via `java -jar`. For example:
|
||||
|
||||
```shell
|
||||
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help
|
||||
```
|
||||
|
||||
### Testing
|
||||
|
||||
To add test cases (optional) covering the change in the code generator, please refer to [modules/openapi-generator/src/test/java/org/openapitools/codegen](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/test/java/org/openapitools/codegen)
|
||||
@@ -112,5 +132,5 @@ See [OpenAPI Tools wiki](https://github.com/OpenAPITools/openapi-generator/wiki/
|
||||
- File a PR with meaningful title, description and commit messages
|
||||
- Make sure the option "Allow edits from maintainers" in the PR is selected so that the maintainers can update your PRs with minor fixes, if needed.
|
||||
- Recommended git settings
|
||||
- `git config core.autocrlf input` to tell Git convert CRLF to LF on commit but not the other way around
|
||||
- `git config core.autocrlf input` to tell Git convert CRLF to LF on commit but not the other way around
|
||||
- To close an issue (e.g. issue 1542) automatically after a PR is merged, use keywords "fix", "close", "resolve" in the PR description, e.g. `fix #1542`. (Ref: [closing issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
|
||||
|
||||
21
README.md
21
README.md
@@ -15,7 +15,7 @@
|
||||
|
||||
<div align="center">
|
||||
|
||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.5.0`):
|
||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.6.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)
|
||||
@@ -61,13 +61,14 @@ If you find OpenAPI Generator useful for work, please consider asking your compa
|
||||
[<img src="https://openapi-generator.tech/img/companies/bumpsh.png" width="128" height="128">](https://bump.sh/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||
[<img src="https://openapi-generator.tech/img/companies/bileto.png" width="128" height="128">](https://www.bileto.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||
[<img src="https://openapi-generator.tech/img/companies/bairesdev.png" width="128" height="128">](https://www.bairesdev.com/sponsoring-open-source-projects/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||
[<img src="https://openapi-generator.tech/img/companies/dmtech.jpeg" width="128" height="128">](https://www.dm-jobs.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||
[<img src="https://openapi-generator.tech/img/companies/dmtech.jpeg" width="128" height="128">](https://www.dmtech.de/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||
[<img src="https://openapi-generator.tech/img/companies/adyen.png" width="128" height="128">](https://adyen.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||
[<img src="https://openapi-generator.tech/img/companies/fornex.png" width="128" height="128">](https://fornex.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||
[<img src="https://openapi-generator.tech/img/companies/alloyautomation.png" width="128" height="128">](https://runalloy.com/signup?utm_source=github&utm_medium=referral&utm_campaign=1524_openapigenerator)
|
||||
[<img src="https://openapi-generator.tech/img/companies/ssstwitter.png" width="128" height="128">](https://ssstwitter.com/?utm_source=github&utm_medium=referral&utm_campaign=sponsor)
|
||||
[<img src="https://openapi-generator.tech/img/companies/svix.png" width="128" height="128">](https://www.svix.com/?utm_source=openapi-generator&utm_medium=sponsorship&utm_campaign=oss-sponsorship)
|
||||
[<img src="https://openapi-generator.tech/img/companies/litslink.png" width="128" height="128">](https://litslink.com/services/artificial-intelligence?utm_source=openapi-generator&utm_medium=sponsorship&utm_campaign=oss-sponsorship)
|
||||
[<img src="https://openapi-generator.tech/img/companies/designli.jpg" width="128" height="128">](https://designli.co?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
|
||||
@@ -84,7 +85,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, 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 - 17.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** (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/), Scalatra) |
|
||||
| **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/) |
|
||||
| **Others** | **GraphQL**, **JMeter**, **Ktorm**, **MySQL Schema**, **Postman Collection**, **Protocol Buffer**, **WSDL** |
|
||||
@@ -125,8 +126,8 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
|
||||
|
||||
| OpenAPI Generator Version | Release Date | Notes |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- |
|
||||
| 7.5.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.5.0-SNAPSHOT/) | 12.04.2024 | Minor release with breaking changes (with fallback) |
|
||||
| [7.4.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.4.0) (latest stable release) | 11.03.2024 | Minor release with breaking changes (with fallback) |
|
||||
| 7.6.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.6.0-SNAPSHOT/) | 17.54.2024 | Minor release with breaking changes (with fallback) |
|
||||
| [7.5.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.5.0) (latest stable release) | 17.04.2024 | Minor release with breaking changes (with fallback) |
|
||||
| [6.6.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v6.6.0) | 11.05.2023 | Minor release with breaking changes (with fallback) |
|
||||
| [5.4.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.4.0) | 31.01.2022 | Minor release with breaking changes (with fallback) |
|
||||
| [4.3.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.3.1) | 06.05.2020 | Patch release (enhancements, bug fixes, etc) |
|
||||
@@ -189,16 +190,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.4.0/openapi-generator-cli-7.4.0.jar`
|
||||
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.5.0/openapi-generator-cli-7.5.0.jar`
|
||||
|
||||
For **Mac/Linux** users:
|
||||
```sh
|
||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.4.0/openapi-generator-cli-7.4.0.jar -O openapi-generator-cli.jar
|
||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.5.0/openapi-generator-cli-7.5.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.4.0/openapi-generator-cli-7.4.0.jar
|
||||
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.5.0/openapi-generator-cli-7.5.0.jar
|
||||
```
|
||||
|
||||
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
|
||||
@@ -704,6 +705,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
||||
- [REST United](https://restunited.com)
|
||||
- [Robocorp](https://www.robocorp.com)
|
||||
- [Robotinfra](https://www.robotinfra.com)
|
||||
- [SearchApi](https://www.searchapi.io/)
|
||||
- [SmartHR](https://smarthr.co.jp/)
|
||||
- [Sony Interactive Entertainment](https://www.sie.com/en/index.html)
|
||||
- [Splitit](https://www.splitit.com/)
|
||||
@@ -930,6 +932,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
||||
- 2023-12-10 - [UnityでOpenAPI Generatorを使う](https://www.youtube.com/watch?v=CbNwKVV5LRM) by [Soup Tori](https://www.youtube.com/@souptori8417)
|
||||
- 2024-03-04 - [Generating TypeScript Types with OpenAPI for REST API Consumption](https://www.pullrequest.com/blog/generating-typescript-types-with-openapi-for-rest-api-consumption/) by [PullRequest](https://www.pullrequest.com/)
|
||||
- 2024-03-07 - [Fully typed Web Apps with OpenAPI (Part 1)](https://medium.com/@gfox1984/fully-typed-web-apps-with-openapi-part-1-595d55766670) by [Guillaume Renard](https://medium.com/@gfox1984)
|
||||
- 2024-03-08 - [Laravel OpenAPIによる "辛くない" スキーマ駆動開発](https://fortee.jp/phperkaigi-2024/proposal/9e2e6c38-d078-4efa-99b4-83ebf9033b34) by [KentarouTakeda](https://twitter.com/KentarouTakeda)
|
||||
|
||||
## [6 - About Us](#table-of-contents)
|
||||
|
||||
@@ -1089,6 +1092,7 @@ Here is a list of template creators:
|
||||
* Kotlin (Vertx): @Wooyme
|
||||
* Kotlin (JAX-RS): @anttileppa
|
||||
* NodeJS Express: @YishTish
|
||||
* PHP Flight: @daniel-sc
|
||||
* PHP Laravel: @renepardon
|
||||
* PHP Lumen: @abcsun
|
||||
* PHP Mezzio (with Path Handler): @Articus
|
||||
@@ -1101,6 +1105,7 @@ Here is a list of template creators:
|
||||
* Ruby on Rails 5: @zlx
|
||||
* Rust (rust-server): @metaswitch
|
||||
* Scala Akka: @Bouillie
|
||||
* Scala Cask: @aaronp
|
||||
* Scala Finch: @jimschubert [:heart:](https://www.patreon.com/jimschubert)
|
||||
* Scala Lagom: @gmkumar2005
|
||||
* Scala Play: @adigerber
|
||||
|
||||
41
appveyor.yml
41
appveyor.yml
@@ -43,23 +43,30 @@ build_script:
|
||||
#- dotnet build samples\client\petstore\csharp\OpenAPIClient-ConditionalSerialization\Org.OpenAPITools.sln
|
||||
|
||||
test_script:
|
||||
# test c# API client (multiple frameworks)
|
||||
- dotnet test samples\client\petstore\csharp\OpenAPIClientCoreAndNet47\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
# test c# API client (httpclient)
|
||||
- dotnet test samples\client\petstore\csharp\OpenAPIClient-httpclient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
# test c# API client (generichost)
|
||||
- dotnet test samples\client\petstore\csharp\OpenAPIClient-generichost-netstandard2.0\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
# test c# API client (netcore)
|
||||
- dotnet test samples\client\petstore\csharp\OpenAPIClientCore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
#- dotnet test samples\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
# test C# API client (.net framework 4.7)
|
||||
- dotnet test samples\client\petstore\csharp\OpenAPIClient-net47\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
# test C# API client (.net framework 4.8)
|
||||
- dotnet test samples\client\petstore\csharp\OpenAPIClient-net48\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
# test C# API client (.net 5.0)
|
||||
- dotnet test samples\client\petstore\csharp\OpenAPIClient-net5.0\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
# test C# API Client using conditional-serialization
|
||||
- dotnet test samples\client\petstore\csharp\OpenAPIClient-ConditionalSerialization\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net8\AllOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net8\AnyOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net8\AnyOfNoCompare\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net8\FormModels\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net8\ManualSourceGenerationTests\ManualTests.Latest.UseSourceGeneration\ManualTests.Latest.UseSourceGeneration.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net8\ManualPetstoreTests\OpenAPIClient-generichost-manual-tests\OpenAPIClient-generichost-manual-tests.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net8\NullReferenceTypes\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net8\OneOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net8\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net8\SourceGeneration\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\net8\UseDateTimeForDate\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\generichost\standard2.0\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
|
||||
- dotnet test samples\client\petstore\csharp\httpclient\standard2.0\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\net4.7\MultipleFrameworks\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\net4.7\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\net4.8\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\net6\ParameterMappings\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\net7\EnumMappings\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\net7\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\net7\UseDateTimeForDate\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\standard2.0\ConditionalSerialization\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp\restsharp\standard2.0\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
|
||||
### TODO: Execute all generators via powershell or other
|
||||
# generate all petstore clients
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/OpenAPIClient-generichost-netcore-latest-allOf
|
||||
outputDir: samples/client/petstore/csharp/generichost/net8/AllOf
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/allOf.yaml
|
||||
library: generichost
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
@@ -10,3 +10,4 @@ additionalProperties:
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
nullableReferenceTypes: true
|
||||
equatable: true
|
||||
targetFramework: net8.0
|
||||
@@ -1,6 +1,6 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/OpenAPIClient-generichost-netcore-latest-anyOf
|
||||
outputDir: samples/client/petstore/csharp/generichost/net8/AnyOf
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/anyOf.yaml
|
||||
library: generichost
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
@@ -10,3 +10,4 @@ additionalProperties:
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
nullableReferenceTypes: true
|
||||
equatable: true
|
||||
targetFramework: net8.0
|
||||
13
bin/configs/csharp-generichost-net8-anyOfNoCompare.yaml
Normal file
13
bin/configs/csharp-generichost-net8-anyOfNoCompare.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/anyOf.yaml
|
||||
library: generichost
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
useCompareNetObjects: false
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
nullableReferenceTypes: true
|
||||
equatable: true
|
||||
targetFramework: net8.0
|
||||
16
bin/configs/csharp-generichost-net8-formModels.yaml
Normal file
16
bin/configs/csharp-generichost-net8-formModels.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/generichost/net8/FormModels
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
|
||||
library: generichost
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||
useCompareNetObjects: true
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
nullableReferenceTypes: false
|
||||
equatable: true
|
||||
targetFramework: net8.0
|
||||
skipFormModel: false
|
||||
inlineSchemaOptions:
|
||||
RESOLVE_INLINE_ENUMS: true
|
||||
@@ -1,6 +1,6 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration
|
||||
outputDir: samples/client/petstore/csharp/generichost/net8/SourceGeneration
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
|
||||
library: generichost
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
@@ -9,5 +9,5 @@ additionalProperties:
|
||||
useCompareNetObjects: true
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
useSourceGeneration: true
|
||||
packageName: UseSourceGeneration
|
||||
equatable: true
|
||||
targetFramework: net8.0
|
||||
@@ -1,6 +1,6 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt
|
||||
outputDir: samples/client/petstore/csharp/generichost/net8/NullReferenceTypes
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
|
||||
library: generichost
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
@@ -10,3 +10,4 @@ additionalProperties:
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
nullableReferenceTypes: true
|
||||
equatable: true
|
||||
targetFramework: net8.0
|
||||
@@ -1,6 +1,6 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/OpenAPIClient-generichost-netcore-latest-oneOf
|
||||
outputDir: samples/client/petstore/csharp/generichost/net8/OneOf
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOf.yaml
|
||||
library: generichost
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
@@ -10,3 +10,4 @@ additionalProperties:
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
nullableReferenceTypes: true
|
||||
equatable: true
|
||||
targetFramework: net8.0
|
||||
@@ -1,9 +1,10 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/OpenAPIClient-generichost-net7.0-useDateTimeForDate
|
||||
outputDir: samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/dates-api.yaml
|
||||
library: generichost
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
packageGuid: '{2E60EF87-DB0B-4D01-A36E-F5E90F7EC757}'
|
||||
useDateTimeForDate: true
|
||||
targetFramework: net8.0
|
||||
@@ -1,6 +1,6 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0
|
||||
outputDir: samples/client/petstore/csharp/generichost/net8/Petstore
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
|
||||
library: generichost
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
@@ -10,3 +10,4 @@ additionalProperties:
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
nullableReferenceTypes: false
|
||||
equatable: true
|
||||
targetFramework: net8.0
|
||||
@@ -1,6 +1,6 @@
|
||||
# for csharp generichost
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0
|
||||
outputDir: samples/client/petstore/csharp/generichost/standard2.0/Petstore
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
|
||||
library: generichost
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# for .net standard httpclient
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/OpenAPIClient-httpclient
|
||||
outputDir: samples/client/petstore/csharp/httpclient/standard2.0/Petstore
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
library: httpclient
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/OpenAPIClientCoreAndNet47
|
||||
outputDir: samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# for .net standard
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/OpenAPIClient-net47
|
||||
outputDir: samples/client/petstore/csharp/restsharp/net4.7/Petstore
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature-oneof-primitive-types.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# for .net standard
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/OpenAPIClient-net48
|
||||
outputDir: samples/client/petstore/csharp/restsharp/net4.8/Petstore
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature-oneof-primitive-types.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/OpenAPIClient-restsharp-name-parameter-mappings
|
||||
outputDir: samples/client/petstore/csharp/restsharp/net6/ParameterMappings
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/name-parameter-mappings.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
nameMappings:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/OpenAPIClientCore
|
||||
outputDir: samples/client/petstore/csharp/restsharp/net7/Petstore
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# for .net standard
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/OpenAPIClient-net7.0-useDateTimeForDate
|
||||
outputDir: samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/dates-api.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# for .net standard
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/OpenAPIClient-net5.0
|
||||
outputDir: samples/client/petstore/csharp/restsharp/net7/EnumMappings
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature-oneof-primitive-types.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# for .net standard
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization
|
||||
outputDir: samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# for .net standard
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/OpenAPIClient
|
||||
outputDir: samples/client/petstore/csharp/restsharp/standard2.0/Petstore
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature-oneof-primitive-types.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
additionalProperties:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# for .net Unity
|
||||
generatorName: csharp
|
||||
outputDir: samples/client/petstore/csharp/OpenAPIClient-unityWebRequest
|
||||
outputDir: samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/csharp
|
||||
library: unityWebRequest
|
||||
|
||||
7
bin/configs/java-jersey2-8-oneOfDuplicateList.yaml
Normal file
7
bin/configs/java-jersey2-8-oneOfDuplicateList.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
generatorName: java
|
||||
outputDir: samples/client/others/java/jersey2-oneOf-duplicates
|
||||
library: jersey2
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOf_duplicateArray.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/Java
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
7
bin/configs/java-jersey2-8-oneOfMixed.yaml
Normal file
7
bin/configs/java-jersey2-8-oneOfMixed.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
generatorName: java
|
||||
outputDir: samples/client/others/java/jersey2-oneOf-Mixed
|
||||
library: jersey2
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOf_primitiveAndArray.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/Java
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
@@ -8,4 +8,5 @@ additionalProperties:
|
||||
serializationLibrary: jackson
|
||||
artifactId: microprofile-rest-client-3-jackson-with-xml
|
||||
configKey: petstore
|
||||
microprofileRestClientVersion: "3.0"
|
||||
microprofileRestClientVersion: "3.0"
|
||||
hideGenerationTimestamp: true
|
||||
|
||||
@@ -7,4 +7,5 @@ additionalProperties:
|
||||
serializationLibrary: jackson
|
||||
artifactId: microprofile-rest-client-3-jackson
|
||||
configKey: petstore
|
||||
microprofileRestClientVersion: "3.0"
|
||||
microprofileRestClientVersion: "3.0"
|
||||
hideGenerationTimestamp: true
|
||||
|
||||
@@ -9,4 +9,5 @@ additionalProperties:
|
||||
useOneOfDiscriminatorLookup: "true"
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
annotationLibrary: "swagger1"
|
||||
|
||||
openapiNormalizer:
|
||||
SET_TAGS_FOR_ALL_OPERATIONS: common
|
||||
|
||||
17
bin/configs/java-okhttp-user-defined-templates.yaml
Normal file
17
bin/configs/java-okhttp-user-defined-templates.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
generatorName: java
|
||||
outputDir: samples/client/echo_api/java/okhttp-gson-user-defined-templates
|
||||
library: okhttp-gson
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/Java
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
files:
|
||||
README.md:
|
||||
destinationFilename: info.md
|
||||
api_doc.mustache:
|
||||
templateType: APIDocs
|
||||
destinationFilename: Documentation.md
|
||||
pojo.mustache:
|
||||
templateType: Model
|
||||
folder: modelCopy
|
||||
destinationFilename: .java
|
||||
15
bin/configs/jaxrs-spec-quarkus-mutiny.yaml
Normal file
15
bin/configs/jaxrs-spec-quarkus-mutiny.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
generatorName: jaxrs-spec
|
||||
outputDir: samples/server/petstore/jaxrs-spec-quarkus-mutiny
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/spec
|
||||
additionalProperties:
|
||||
artifactId: jaxrs-spec-petstore-server
|
||||
serializableModel: "true"
|
||||
hideGenerationTimestamp: "true"
|
||||
implicitHeadersRegex: (api_key|enum_header_string)
|
||||
generateBuilders: "true"
|
||||
useMicroProfileOpenAPIAnnotations: "true"
|
||||
useAsync: "true"
|
||||
useMutiny: "true"
|
||||
library: "quarkus"
|
||||
dateLibrary: "java8-localdatetime"
|
||||
@@ -12,4 +12,4 @@ additionalProperties:
|
||||
enumPropertyNaming: UPPERCASE
|
||||
serializationLibrary: gson
|
||||
openapiNormalizer:
|
||||
SIMPLIFY_ONEOF_ANYOF=false
|
||||
SIMPLIFY_ONEOF_ANYOF: false
|
||||
|
||||
@@ -12,4 +12,4 @@ additionalProperties:
|
||||
enumPropertyNaming: UPPERCASE
|
||||
serializationLibrary: gson
|
||||
openapiNormalizer:
|
||||
SIMPLIFY_ONEOF_ANYOF=false
|
||||
SIMPLIFY_ONEOF_ANYOF: false
|
||||
|
||||
@@ -7,4 +7,6 @@ additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
packageName: petstore-with-fake-endpoints-models-for-testing
|
||||
publishRustRegistry: crates-io
|
||||
enablePostProcessFile: true
|
||||
globalProperties:
|
||||
skipFormModel: false
|
||||
enablePostProcessFile: true
|
||||
|
||||
@@ -6,4 +6,6 @@ generateAliasAsModel: true
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
packageName: petstore
|
||||
globalProperties:
|
||||
skipFormModel: false
|
||||
enablePostProcessFile: true
|
||||
|
||||
6
bin/configs/php-flight.yaml
Normal file
6
bin/configs/php-flight.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
generatorName: php-flight
|
||||
outputDir: samples/server/petstore/php-flight
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/php-flight
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
13
bin/configs/scala-cask-petstore-new.yaml
Normal file
13
bin/configs/scala-cask-petstore-new.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
generatorName: scala-cask
|
||||
outputDir: samples/server/petstore/scala-cask
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/scala-cask
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
artifactId: scala-cask-petstore
|
||||
groupId: "cask.groupId"
|
||||
package: "sample.cask"
|
||||
modelPackage: "sample.cask.model"
|
||||
apiPackage: "sample.cask.api"
|
||||
gitRepoId: "sample-cask-repo"
|
||||
gitUserId: "sample-cask-user"
|
||||
9
bin/configs/spring-cloud-auth.yaml
Normal file
9
bin/configs/spring-cloud-auth.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
generatorName: spring
|
||||
outputDir: samples/client/petstore/spring-cloud-auth
|
||||
library: spring-cloud
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-auth.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
|
||||
additionalProperties:
|
||||
documentationProvider: none
|
||||
artifactId: petstore-spring-cloud-auth
|
||||
hideGenerationTimestamp: "true"
|
||||
@@ -1,16 +1,16 @@
|
||||
---
|
||||
# csharp test files and image for upload
|
||||
- filename: "samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/JSONComposedSchemaTests.cs"
|
||||
- filename: "samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools.Test/JSONComposedSchemaTests.cs"
|
||||
sha256: e323c7e646a0ceb6d1d8f34f287175ac666fdbbe057791b45d138de3d9582666
|
||||
- filename: "samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Api/PetApiTests.cs"
|
||||
- filename: "samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools.Test/Api/PetApiTests.cs"
|
||||
sha256: 7dad88554fe630d25c787cae05305d302d5e34ca810aee4fa23f20055f9188e1
|
||||
- filename: "samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/linux-logo.png"
|
||||
- filename: "samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools.Test/linux-logo.png"
|
||||
sha256: 0a67c32728197e942b13bdda064b73793f12f5c795f1e5cf35a3adf69c973230
|
||||
# java okhttp gson test files
|
||||
- filename: "samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ClientTest.java"
|
||||
sha256: db505f7801fef62c13a08a8e9ca1fc4c5c947ab46b46f12943139d353feacf17
|
||||
- filename: "samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java"
|
||||
sha256: c479b587cf0d51fa550eb81d33b277081807b87dc28649027d1164224c25ad0a
|
||||
sha256: 8210bdaf06aae8dc46521515a8a0ef10e48c980fadd3efd95313e6c806f409c2
|
||||
- filename: "samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/PetApiTest.java"
|
||||
sha256: 0d64cdc11809a7b5b952ccdad2bd91bd0045b3894d6fabf3e368fa0be12b8217
|
||||
- filename: "samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/PetTest.java"
|
||||
|
||||
@@ -35,7 +35,7 @@ Please file the pull request against the correct branch, e.g. `master` for non-b
|
||||
|
||||
All the code generators can be found in [modules/openapi-generator/src/main/java/org/openapitools/codegen/languages](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages)
|
||||
|
||||
If you want to add a new generator, follow the [new-generator](https://openapi-generator.tech/docs/new-generator) guide.
|
||||
If you want to add a new generator, follow the [new-generator](https://openapi-generator.tech/docs/new-generator) guide.
|
||||
|
||||
### Templates
|
||||
|
||||
@@ -88,6 +88,26 @@ For [Vendor Extensions](https://github.com/OAI/OpenAPI-Specification/blob/master
|
||||
- For language-specified vendor extension, put it in the form of `x-{lang}-{extension-name}`. e.g. `x-objc-operation-id`, `x-java-feign-retry-limit`
|
||||
- For a list of existing vendor extensions in use, please refer to https://github.com/openapitools/openapi-generator/wiki/Vendor-Extensions. If you've added new vendor extensions as part of your PR, please update the wiki page.
|
||||
|
||||
### Building
|
||||
|
||||
The `openapi-generator-cli` can be built using the following command. This will generate the `openapi-generator-cli.jar` in the `modules/openapi-generator-cli/target` directory without running the tests and generating the Javadocs.
|
||||
|
||||
```shell
|
||||
./mvnw clean install -DskipTests -Dmaven.javadoc.skip=true
|
||||
```
|
||||
|
||||
Or on Windows:
|
||||
|
||||
```shell
|
||||
mvnw.cmd clean install -DskipTests -Dmaven.javadoc.skip=true
|
||||
```
|
||||
|
||||
The binary can run via `java -jar`. For example:
|
||||
|
||||
```shell
|
||||
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help
|
||||
```
|
||||
|
||||
### Testing
|
||||
|
||||
To add test cases (optional) covering the change in the code generator, please refer to [modules/openapi-generator/src/test/java/org/openapitools/codegen](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/test/java/org/openapitools/codegen)
|
||||
@@ -116,5 +136,5 @@ See [OpenAPI Tools wiki](https://github.com/OpenAPITools/openapi-generator/wiki/
|
||||
- File a PR with meaningful title, description and commit messages
|
||||
- Make sure the option "Allow edits from maintainers" in the PR is selected so that the maintainers can update your PRs with minor fixes, if needed.
|
||||
- Recommended git settings
|
||||
- `git config core.autocrlf input` to tell Git convert CRLF to LF on commit but not the other way around
|
||||
- `git config core.autocrlf input` to tell Git convert CRLF to LF on commit but not the other way around
|
||||
- To close an issue (e.g. issue 1542) automatically after a PR is merged, use keywords "fix", "close", "resolve" in the PR description, e.g. `fix #1542`. (Ref: [closing issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
|
||||
|
||||
@@ -304,6 +304,8 @@ You can use also `config.yml` with following equivalent example:
|
||||
apiPackage: "petstore"
|
||||
```
|
||||
|
||||
Another example of config file can be found in [modules/openapi-generator/src/test/resources/sampleConfig.json](https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/sampleConfig.json)
|
||||
|
||||
Supported config options can be different per language. Running `config-help -g {lang}` will show available options.
|
||||
**These options are applied via configuration file (e.g. config.json or config.yml) or by passing them with `-p {optionName}={optionValue}`**. (If `-p {optionName}` does not work, please open a [ticket](https://github.com/openapitools/openapi-generator/issues/new) and we'll look into it)
|
||||
|
||||
@@ -605,3 +607,10 @@ Example:
|
||||
```
|
||||
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -o /tmp/java-okhttp/ --openapi-normalizer SET_CONTAINER_TO_NULLABLE="array|map"
|
||||
```
|
||||
|
||||
- `SET_PRIMITIVE_TYPES_TO_NULLABLE`: When set to `string|integer|number|boolean` (or just `string`) for example, it will set the type to `nullable` (nullable: true)
|
||||
|
||||
Example:
|
||||
```
|
||||
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -o /tmp/java-okhttp/ --openapi-normalizer SET_PRIMITIVE_TYPES_TO_NULLABLE="integer|number"
|
||||
```
|
||||
|
||||
@@ -120,6 +120,7 @@ The following generators are available:
|
||||
* [kotlin-spring](generators/kotlin-spring.md)
|
||||
* [kotlin-vertx (beta)](generators/kotlin-vertx.md)
|
||||
* [nodejs-express-server (beta)](generators/nodejs-express-server.md)
|
||||
* [php-flight (experimental)](generators/php-flight.md)
|
||||
* [php-laravel](generators/php-laravel.md)
|
||||
* [php-lumen](generators/php-lumen.md)
|
||||
* [php-mezzio-ph](generators/php-mezzio-ph.md)
|
||||
@@ -134,6 +135,7 @@ The following generators are available:
|
||||
* [rust-axum (beta)](generators/rust-axum.md)
|
||||
* [rust-server](generators/rust-server.md)
|
||||
* [scala-akka-http-server (beta)](generators/scala-akka-http-server.md)
|
||||
* [scala-cask](generators/scala-cask.md)
|
||||
* [scala-finch](generators/scala-finch.md)
|
||||
* [scala-http4s-server](generators/scala-http4s-server.md)
|
||||
* [scala-lagom-server](generators/scala-lagom-server.md)
|
||||
|
||||
@@ -32,6 +32,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|
||||
| Type/Alias | Imports |
|
||||
| ---------- | ------- |
|
||||
|AnyType|#include "AnyType.h"|
|
||||
|HttpContent|#include "HttpContent.h"|
|
||||
|Object|#include "Object.h"|
|
||||
|std::map|#include <map>|
|
||||
@@ -184,7 +185,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|Uuid|✗|
|
||||
|Array|✓|OAS2,OAS3
|
||||
|Null|✗|OAS3
|
||||
|AnyType|✗|OAS2,OAS3
|
||||
|AnyType|✓|OAS2,OAS3
|
||||
|Object|✓|OAS2,OAS3
|
||||
|Maps|✓|ToolingExtension
|
||||
|CollectionFormat|✓|OAS2
|
||||
|
||||
@@ -22,6 +22,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|enumClassPrefix|Prefix enum with class name| |false|
|
||||
|generateInterfaces|Generate interfaces for api classes| |false|
|
||||
|generateMarshalJSON|Generate MarshalJSON method| |true|
|
||||
|generateUnmarshalJSON|Generate UnmarshalJSON method| |true|
|
||||
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|
||||
|isGoSubmodule|whether the generated Go module is a submodule| |false|
|
||||
|packageName|Go package name (convention: lowercase).| |openapi|
|
||||
|
||||
@@ -135,6 +135,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>_</li>
|
||||
<li>abstract</li>
|
||||
<li>apiclient</li>
|
||||
<li>apiexception</li>
|
||||
|
||||
@@ -174,6 +174,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>_</li>
|
||||
<li>abstract</li>
|
||||
<li>apiclient</li>
|
||||
<li>apiexception</li>
|
||||
|
||||
@@ -128,6 +128,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>_</li>
|
||||
<li>abstract</li>
|
||||
<li>apiclient</li>
|
||||
<li>apiexception</li>
|
||||
|
||||
@@ -130,6 +130,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>_</li>
|
||||
<li>abstract</li>
|
||||
<li>apiclient</li>
|
||||
<li>apiexception</li>
|
||||
|
||||
@@ -132,6 +132,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>_</li>
|
||||
<li>abstract</li>
|
||||
<li>apiclient</li>
|
||||
<li>apiexception</li>
|
||||
|
||||
@@ -153,6 +153,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>_</li>
|
||||
<li>abstract</li>
|
||||
<li>apiclient</li>
|
||||
<li>apiexception</li>
|
||||
|
||||
@@ -153,6 +153,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>_</li>
|
||||
<li>abstract</li>
|
||||
<li>apiclient</li>
|
||||
<li>apiexception</li>
|
||||
|
||||
@@ -138,6 +138,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>_</li>
|
||||
<li>abstract</li>
|
||||
<li>apiclient</li>
|
||||
<li>apiexception</li>
|
||||
|
||||
@@ -139,6 +139,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>_</li>
|
||||
<li>abstract</li>
|
||||
<li>apiclient</li>
|
||||
<li>apiexception</li>
|
||||
|
||||
@@ -142,6 +142,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>_</li>
|
||||
<li>abstract</li>
|
||||
<li>apiclient</li>
|
||||
<li>apiexception</li>
|
||||
|
||||
@@ -132,6 +132,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>_</li>
|
||||
<li>abstract</li>
|
||||
<li>apiclient</li>
|
||||
<li>apiexception</li>
|
||||
|
||||
@@ -132,6 +132,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>_</li>
|
||||
<li>abstract</li>
|
||||
<li>apiclient</li>
|
||||
<li>apiexception</li>
|
||||
|
||||
@@ -135,6 +135,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>_</li>
|
||||
<li>abstract</li>
|
||||
<li>apiclient</li>
|
||||
<li>apiexception</li>
|
||||
|
||||
@@ -132,6 +132,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>_</li>
|
||||
<li>abstract</li>
|
||||
<li>apiclient</li>
|
||||
<li>apiexception</li>
|
||||
|
||||
@@ -47,7 +47,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|dynamicOperations|Generate operations dynamically at runtime from an OAS| |false|
|
||||
|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|
|
||||
|errorObjectType|Error Object type. (This option is for okhttp-gson-next-gen only)| |null|
|
||||
|errorObjectType|Error Object type. (This option is for okhttp-gson only)| |null|
|
||||
|generateClientAsBean|For resttemplate, configure whether to create `ApiClient.java` and Apis clients as bean (with `@Component` annotation).| |false|
|
||||
|gradleProperties|Append additional Gradle properties to the gradle.properties file| |null|
|
||||
|groupId|groupId in generated pom.xml| |org.openapitools|
|
||||
@@ -164,6 +164,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>_</li>
|
||||
<li>abstract</li>
|
||||
<li>apiclient</li>
|
||||
<li>apiexception</li>
|
||||
|
||||
@@ -78,6 +78,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|useBeanValidation|Use BeanValidation API annotations| |true|
|
||||
|useJakartaEe|whether to use Jakarta EE namespace instead of javax| |false|
|
||||
|useMicroProfileOpenAPIAnnotations|Whether to generate Microprofile OpenAPI annotations. Only valid when library is set to quarkus.| |false|
|
||||
|useMutiny|Whether to use Smallrye Mutiny instead of CompletionStage for asynchronous computation. Only valid when library is set to quarkus.| |false|
|
||||
|useOneOfInterfaces|whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface| |false|
|
||||
|useSwaggerAnnotations|Whether to generate Swagger annotations.| |true|
|
||||
|useTags|use tags for creating interface and controller classnames| |false|
|
||||
@@ -146,6 +147,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>_</li>
|
||||
<li>abstract</li>
|
||||
<li>apiclient</li>
|
||||
<li>apiexception</li>
|
||||
|
||||
@@ -137,6 +137,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>_</li>
|
||||
<li>abstract</li>
|
||||
<li>apiclient</li>
|
||||
<li>apiexception</li>
|
||||
|
||||
@@ -160,6 +160,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>_</li>
|
||||
<li>abstract</li>
|
||||
<li>apiclient</li>
|
||||
<li>apiexception</li>
|
||||
|
||||
@@ -155,6 +155,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>_</li>
|
||||
<li>abstract</li>
|
||||
<li>apiclient</li>
|
||||
<li>apiexception</li>
|
||||
|
||||
@@ -138,6 +138,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>_</li>
|
||||
<li>abstract</li>
|
||||
<li>apiclient</li>
|
||||
<li>apiexception</li>
|
||||
|
||||
@@ -139,6 +139,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>_</li>
|
||||
<li>abstract</li>
|
||||
<li>apiclient</li>
|
||||
<li>apiexception</li>
|
||||
|
||||
@@ -138,6 +138,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>_</li>
|
||||
<li>abstract</li>
|
||||
<li>apiclient</li>
|
||||
<li>apiexception</li>
|
||||
|
||||
@@ -78,6 +78,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|useBeanValidation|Use BeanValidation API annotations| |true|
|
||||
|useJakartaEe|whether to use Jakarta EE namespace instead of javax| |false|
|
||||
|useMicroProfileOpenAPIAnnotations|Whether to generate Microprofile OpenAPI annotations. Only valid when library is set to quarkus.| |false|
|
||||
|useMutiny|Whether to use Smallrye Mutiny instead of CompletionStage for asynchronous computation. Only valid when library is set to quarkus.| |false|
|
||||
|useOneOfInterfaces|whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface| |false|
|
||||
|useSwaggerAnnotations|Whether to generate Swagger annotations.| |true|
|
||||
|useTags|use tags for creating interface and controller classnames| |false|
|
||||
@@ -146,6 +147,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>_</li>
|
||||
<li>abstract</li>
|
||||
<li>apiclient</li>
|
||||
<li>apiexception</li>
|
||||
|
||||
270
docs/generators/php-flight.md
Normal file
270
docs/generators/php-flight.md
Normal file
@@ -0,0 +1,270 @@
|
||||
---
|
||||
title: Documentation for the php-flight Generator
|
||||
---
|
||||
|
||||
## METADATA
|
||||
|
||||
| Property | Value | Notes |
|
||||
| -------- | ----- | ----- |
|
||||
| generator name | php-flight | pass this to the generate command after -g |
|
||||
| generator stability | EXPERIMENTAL | |
|
||||
| generator type | SERVER | |
|
||||
| generator language | PHP | |
|
||||
| generator default templating engine | mustache | |
|
||||
| helpTxt | Generates a PHP Flight Framework server 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|
|
||||
|apiPackage|package for generated api classes| |null|
|
||||
|artifactUrl|artifact URL in generated pom.xml| |null|
|
||||
|artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null|
|
||||
|composerPackageName|The name to use in the composer package name field. e.g. `vendor/project` (must be lowercase and consist of words separated by `-`, `.` or `_`).| |null|
|
||||
|developerOrganization|developer organization in generated pom.xml| |null|
|
||||
|developerOrganizationUrl|developer organization URL in generated pom.xml| |null|
|
||||
|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|
|
||||
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|
||||
|invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null|
|
||||
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|
||||
|licenseName|The name of the license| |null|
|
||||
|modelPackage|package for generated models| |null|
|
||||
|packageName|The main package name for classes. e.g. GeneratedPetstore| |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|
|
||||
|srcBasePath|The directory to serve as source root.| |null|
|
||||
|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |camelCase|
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
| ---------- | ------- |
|
||||
|
||||
|
||||
## INSTANTIATION TYPES
|
||||
|
||||
| Type/Alias | Instantiated By |
|
||||
| ---------- | --------------- |
|
||||
|array|array|
|
||||
|map|array|
|
||||
|
||||
|
||||
## LANGUAGE PRIMITIVES
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>\DateTime</li>
|
||||
<li>\SplFileObject</li>
|
||||
<li>array</li>
|
||||
<li>bool</li>
|
||||
<li>boolean</li>
|
||||
<li>byte</li>
|
||||
<li>float</li>
|
||||
<li>int</li>
|
||||
<li>integer</li>
|
||||
<li>mixed</li>
|
||||
<li>number</li>
|
||||
<li>object</li>
|
||||
<li>string</li>
|
||||
<li>void</li>
|
||||
</ul>
|
||||
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>__halt_compiler</li>
|
||||
<li>_header_accept</li>
|
||||
<li>_tempbody</li>
|
||||
<li>abstract</li>
|
||||
<li>and</li>
|
||||
<li>array</li>
|
||||
<li>as</li>
|
||||
<li>break</li>
|
||||
<li>callable</li>
|
||||
<li>case</li>
|
||||
<li>catch</li>
|
||||
<li>class</li>
|
||||
<li>clone</li>
|
||||
<li>const</li>
|
||||
<li>continue</li>
|
||||
<li>declare</li>
|
||||
<li>default</li>
|
||||
<li>die</li>
|
||||
<li>do</li>
|
||||
<li>echo</li>
|
||||
<li>else</li>
|
||||
<li>elseif</li>
|
||||
<li>empty</li>
|
||||
<li>enddeclare</li>
|
||||
<li>endfor</li>
|
||||
<li>endforeach</li>
|
||||
<li>endif</li>
|
||||
<li>endswitch</li>
|
||||
<li>endwhile</li>
|
||||
<li>eval</li>
|
||||
<li>exit</li>
|
||||
<li>extends</li>
|
||||
<li>final</li>
|
||||
<li>for</li>
|
||||
<li>foreach</li>
|
||||
<li>formparams</li>
|
||||
<li>function</li>
|
||||
<li>global</li>
|
||||
<li>goto</li>
|
||||
<li>headerparams</li>
|
||||
<li>httpbody</li>
|
||||
<li>if</li>
|
||||
<li>implements</li>
|
||||
<li>include</li>
|
||||
<li>include_once</li>
|
||||
<li>instanceof</li>
|
||||
<li>insteadof</li>
|
||||
<li>interface</li>
|
||||
<li>isset</li>
|
||||
<li>list</li>
|
||||
<li>namespace</li>
|
||||
<li>new</li>
|
||||
<li>or</li>
|
||||
<li>print</li>
|
||||
<li>private</li>
|
||||
<li>protected</li>
|
||||
<li>public</li>
|
||||
<li>queryparams</li>
|
||||
<li>require</li>
|
||||
<li>require_once</li>
|
||||
<li>resourcepath</li>
|
||||
<li>return</li>
|
||||
<li>static</li>
|
||||
<li>switch</li>
|
||||
<li>throw</li>
|
||||
<li>trait</li>
|
||||
<li>try</li>
|
||||
<li>unset</li>
|
||||
<li>use</li>
|
||||
<li>var</li>
|
||||
<li>while</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
|
||||
@@ -91,6 +91,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>except</li>
|
||||
<li>exec</li>
|
||||
<li>false</li>
|
||||
<li>field</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
<li>for</li>
|
||||
|
||||
@@ -91,6 +91,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>except</li>
|
||||
<li>exec</li>
|
||||
<li>false</li>
|
||||
<li>field</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
<li>for</li>
|
||||
|
||||
@@ -91,6 +91,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>except</li>
|
||||
<li>exec</li>
|
||||
<li>false</li>
|
||||
<li>field</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
<li>for</li>
|
||||
|
||||
@@ -88,6 +88,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>except</li>
|
||||
<li>exec</li>
|
||||
<li>false</li>
|
||||
<li>field</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
<li>for</li>
|
||||
|
||||
262
docs/generators/scala-cask.md
Normal file
262
docs/generators/scala-cask.md
Normal file
@@ -0,0 +1,262 @@
|
||||
---
|
||||
title: Documentation for the scala-cask Generator
|
||||
---
|
||||
|
||||
## METADATA
|
||||
|
||||
| Property | Value | Notes |
|
||||
| -------- | ----- | ----- |
|
||||
| generator name | scala-cask | pass this to the generate command after -g |
|
||||
| generator stability | STABLE | |
|
||||
| generator type | SERVER | |
|
||||
| generator language | Scala | |
|
||||
| generator default templating engine | mustache | |
|
||||
| helpTxt | Generates a scala-cask server. | |
|
||||
|
||||
## 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|
|
||||
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |null|
|
||||
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename. If not provided, uses the version from the OpenAPI specification file. If that's also not present, uses the default value of the artifactVersion option.| |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|
|
||||
|gitRepoId|Git repo ID, e.g. openapi-generator.| |null|
|
||||
|gitUserId|Git user ID, e.g. openapitools.| |null|
|
||||
|groupId|groupId in generated pom.xml| |null|
|
||||
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|
||||
|modelPackage|package for generated models| |null|
|
||||
|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
|
||||
|packageName|packageDescription| |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|
|
||||
|sourceFolder|source folder for generated code| |null|
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
||||
| Type/Alias | Imports |
|
||||
| ---------- | ------- |
|
||||
|Array|java.util.List|
|
||||
|ArrayList|java.util.ArrayList|
|
||||
|Date|java.util.Date|
|
||||
|DateTime|org.joda.time.*|
|
||||
|File|java.io.File|
|
||||
|HashMap|java.util.HashMap|
|
||||
|ListBuffer|scala.collection.mutable.ListBuffer|
|
||||
|ListSet|scala.collection.immutable.ListSet|
|
||||
|LocalDate|org.joda.time.*|
|
||||
|LocalDateTime|org.joda.time.*|
|
||||
|LocalTime|org.joda.time.*|
|
||||
|Seq|scala.collection.immutable.Seq|
|
||||
|Set|scala.collection.immutable.Set|
|
||||
|Timestamp|java.sql.Timestamp|
|
||||
|URI|java.net.URI|
|
||||
|UUID|java.util.UUID|
|
||||
|
||||
|
||||
## INSTANTIATION TYPES
|
||||
|
||||
| Type/Alias | Instantiated By |
|
||||
| ---------- | --------------- |
|
||||
|set|Set|
|
||||
|
||||
|
||||
## LANGUAGE PRIMITIVES
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>Any</li>
|
||||
<li>Array</li>
|
||||
<li>Boolean</li>
|
||||
<li>Byte</li>
|
||||
<li>Double</li>
|
||||
<li>Float</li>
|
||||
<li>Int</li>
|
||||
<li>List</li>
|
||||
<li>Long</li>
|
||||
<li>Map</li>
|
||||
<li>Object</li>
|
||||
<li>Seq</li>
|
||||
<li>String</li>
|
||||
<li>boolean</li>
|
||||
</ul>
|
||||
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>abstract</li>
|
||||
<li>assert</li>
|
||||
<li>boolean</li>
|
||||
<li>break</li>
|
||||
<li>byte</li>
|
||||
<li>case</li>
|
||||
<li>catch</li>
|
||||
<li>char</li>
|
||||
<li>class</li>
|
||||
<li>const</li>
|
||||
<li>continue</li>
|
||||
<li>default</li>
|
||||
<li>do</li>
|
||||
<li>double</li>
|
||||
<li>else</li>
|
||||
<li>enum</li>
|
||||
<li>extends</li>
|
||||
<li>final</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
<li>for</li>
|
||||
<li>goto</li>
|
||||
<li>if</li>
|
||||
<li>implements</li>
|
||||
<li>import</li>
|
||||
<li>instanceof</li>
|
||||
<li>int</li>
|
||||
<li>interface</li>
|
||||
<li>long</li>
|
||||
<li>native</li>
|
||||
<li>new</li>
|
||||
<li>package</li>
|
||||
<li>private</li>
|
||||
<li>protected</li>
|
||||
<li>public</li>
|
||||
<li>return</li>
|
||||
<li>short</li>
|
||||
<li>static</li>
|
||||
<li>strictfp</li>
|
||||
<li>super</li>
|
||||
<li>switch</li>
|
||||
<li>synchronized</li>
|
||||
<li>this</li>
|
||||
<li>throw</li>
|
||||
<li>throws</li>
|
||||
<li>transient</li>
|
||||
<li>try</li>
|
||||
<li>type</li>
|
||||
<li>void</li>
|
||||
<li>volatile</li>
|
||||
<li>while</li>
|
||||
</ul>
|
||||
|
||||
## FEATURE SET
|
||||
|
||||
|
||||
### Client Modification Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|BasePath|✗|ToolingExtension
|
||||
|Authorizations|✗|ToolingExtension
|
||||
|UserAgent|✗|ToolingExtension
|
||||
|MockServer|✗|ToolingExtension
|
||||
|
||||
### Data Type Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Custom|✗|OAS2,OAS3
|
||||
|Int32|✓|OAS2,OAS3
|
||||
|Int64|✓|OAS2,OAS3
|
||||
|Float|✓|OAS2,OAS3
|
||||
|Double|✓|OAS2,OAS3
|
||||
|Decimal|✓|ToolingExtension
|
||||
|String|✓|OAS2,OAS3
|
||||
|Byte|✓|OAS2,OAS3
|
||||
|Binary|✓|OAS2,OAS3
|
||||
|Boolean|✓|OAS2,OAS3
|
||||
|Date|✓|OAS2,OAS3
|
||||
|DateTime|✓|OAS2,OAS3
|
||||
|Password|✓|OAS2,OAS3
|
||||
|File|✓|OAS2
|
||||
|Uuid|✗|
|
||||
|Array|✓|OAS2,OAS3
|
||||
|Null|✗|OAS3
|
||||
|AnyType|✗|OAS2,OAS3
|
||||
|Object|✓|OAS2,OAS3
|
||||
|Maps|✓|ToolingExtension
|
||||
|CollectionFormat|✓|OAS2
|
||||
|CollectionFormatMulti|✓|OAS2
|
||||
|Enum|✓|OAS2,OAS3
|
||||
|ArrayOfEnum|✓|ToolingExtension
|
||||
|ArrayOfModel|✓|ToolingExtension
|
||||
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
|
||||
|ArrayOfCollectionOfModel|✓|ToolingExtension
|
||||
|ArrayOfCollectionOfEnum|✓|ToolingExtension
|
||||
|MapOfEnum|✓|ToolingExtension
|
||||
|MapOfModel|✓|ToolingExtension
|
||||
|MapOfCollectionOfPrimitives|✓|ToolingExtension
|
||||
|MapOfCollectionOfModel|✓|ToolingExtension
|
||||
|MapOfCollectionOfEnum|✓|ToolingExtension
|
||||
|
||||
### Documentation Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Readme|✗|ToolingExtension
|
||||
|Model|✓|ToolingExtension
|
||||
|Api|✓|ToolingExtension
|
||||
|
||||
### Global Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Host|✓|OAS2,OAS3
|
||||
|BasePath|✓|OAS2,OAS3
|
||||
|Info|✓|OAS2,OAS3
|
||||
|Schemes|✗|OAS2,OAS3
|
||||
|PartialSchemes|✓|OAS2,OAS3
|
||||
|Consumes|✓|OAS2
|
||||
|Produces|✓|OAS2
|
||||
|ExternalDocumentation|✓|OAS2,OAS3
|
||||
|Examples|✓|OAS2,OAS3
|
||||
|XMLStructureDefinitions|✗|OAS2,OAS3
|
||||
|MultiServer|✗|OAS3
|
||||
|ParameterizedServer|✗|OAS3
|
||||
|ParameterStyling|✗|OAS3
|
||||
|Callbacks|✓|OAS3
|
||||
|LinkObjects|✗|OAS3
|
||||
|
||||
### Parameter Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Path|✓|OAS2,OAS3
|
||||
|Query|✓|OAS2,OAS3
|
||||
|Header|✓|OAS2,OAS3
|
||||
|Body|✓|OAS2
|
||||
|FormUnencoded|✓|OAS2
|
||||
|FormMultipart|✓|OAS2
|
||||
|Cookie|✓|OAS3
|
||||
|
||||
### Schema Support Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|Simple|✓|OAS2,OAS3
|
||||
|Composite|✓|OAS2,OAS3
|
||||
|Polymorphism|✓|OAS2,OAS3
|
||||
|Union|✗|OAS3
|
||||
|allOf|✗|OAS2,OAS3
|
||||
|anyOf|✗|OAS3
|
||||
|oneOf|✗|OAS3
|
||||
|not|✗|OAS3
|
||||
|
||||
### Security Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|BasicAuth|✓|OAS2,OAS3
|
||||
|ApiKey|✓|OAS2,OAS3
|
||||
|OpenIDConnect|✗|OAS3
|
||||
|BearerToken|✓|OAS3
|
||||
|OAuth2_Implicit|✓|OAS2,OAS3
|
||||
|OAuth2_Password|✓|OAS2,OAS3
|
||||
|OAuth2_ClientCredentials|✓|OAS2,OAS3
|
||||
|OAuth2_AuthorizationCode|✓|OAS2,OAS3
|
||||
|SignatureAuth|✗|OAS3
|
||||
|AWSV4Signature|✗|ToolingExtension
|
||||
|
||||
### Wire Format Feature
|
||||
| Name | Supported | Defined By |
|
||||
| ---- | --------- | ---------- |
|
||||
|JSON|✓|OAS2,OAS3
|
||||
|XML|✓|OAS2,OAS3
|
||||
|PROTOBUF|✗|ToolingExtension
|
||||
|Custom|✗|OAS2,OAS3
|
||||
@@ -167,6 +167,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
## RESERVED WORDS
|
||||
|
||||
<ul class="column-ul">
|
||||
<li>_</li>
|
||||
<li>abstract</li>
|
||||
<li>apiclient</li>
|
||||
<li>apiexception</li>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.5.0-SNAPSHOT</version>
|
||||
<version>7.6.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -515,11 +515,11 @@ public class Generate extends OpenApiGeneratorCommand {
|
||||
applyModelNameMappingsKvpList(modelNameMappings, configurator);
|
||||
applyEnumNameMappingsKvpList(enumNameMappings, configurator);
|
||||
applyOperationIdNameMappingsKvpList(operationIdNameMappings, configurator);
|
||||
applyOpenAPINormalizerKvpList(openapiNormalizer, configurator);
|
||||
applyOpenapiNormalizerKvpList(openapiNormalizer, configurator);
|
||||
applyTypeMappingsKvpList(typeMappings, configurator);
|
||||
applyAdditionalPropertiesKvpList(additionalProperties, configurator);
|
||||
applyLanguageSpecificPrimitivesCsvList(languageSpecificPrimitives, configurator);
|
||||
applyOpenAPIGeneratorIgnoreListCsvList(openapiGeneratorIgnoreList, configurator);
|
||||
applyOpenapiGeneratorIgnoreListCsvList(openapiGeneratorIgnoreList, configurator);
|
||||
applyReservedWordsMappingsKvpList(reservedWordsMappings, configurator);
|
||||
applyServerVariablesKvpList(serverVariableOverrides, configurator);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.5.0-SNAPSHOT</version>
|
||||
<version>7.6.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -321,7 +321,7 @@ public final class GeneratorSettings implements Serializable {
|
||||
*
|
||||
* @return a map of rules
|
||||
*/
|
||||
public Map<String, String> getOpenAPINormalizer() {
|
||||
public Map<String, String> getOpenapiNormalizer() {
|
||||
return openapiNormalizer;
|
||||
}
|
||||
|
||||
@@ -346,7 +346,7 @@ public final class GeneratorSettings implements Serializable {
|
||||
*
|
||||
* @return the openapi generator ignore list
|
||||
*/
|
||||
public Set<String> getOpenAPIGeneratorIgnoreList() {
|
||||
public Set<String> getOpenapiGeneratorIgnoreList() {
|
||||
return openapiGeneratorIgnoreList;
|
||||
}
|
||||
|
||||
@@ -614,14 +614,14 @@ public final class GeneratorSettings implements Serializable {
|
||||
if (copy.getOperationIdNameMappings() != null) {
|
||||
builder.operationIdNameMappings.putAll(copy.getOperationIdNameMappings());
|
||||
}
|
||||
if (copy.getOpenAPINormalizer() != null) {
|
||||
builder.openapiNormalizer.putAll(copy.getOpenAPINormalizer());
|
||||
if (copy.getOpenapiNormalizer() != null) {
|
||||
builder.openapiNormalizer.putAll(copy.getOpenapiNormalizer());
|
||||
}
|
||||
if (copy.getLanguageSpecificPrimitives() != null) {
|
||||
builder.languageSpecificPrimitives.addAll(copy.getLanguageSpecificPrimitives());
|
||||
}
|
||||
if (copy.getOpenAPIGeneratorIgnoreList() != null) {
|
||||
builder.openapiGeneratorIgnoreList.addAll(copy.getOpenAPIGeneratorIgnoreList());
|
||||
if (copy.getOpenapiGeneratorIgnoreList() != null) {
|
||||
builder.openapiGeneratorIgnoreList.addAll(copy.getOpenapiGeneratorIgnoreList());
|
||||
}
|
||||
if (copy.getReservedWordsMappings() != null) {
|
||||
builder.reservedWordsMappings.putAll(copy.getReservedWordsMappings());
|
||||
@@ -1152,7 +1152,7 @@ public final class GeneratorSettings implements Serializable {
|
||||
* @param openapiNormalizer the {@code openapiNormalizer} to set
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder withOpenAPINormalizer(Map<String, String> openapiNormalizer) {
|
||||
public Builder withOpenapiNormalizer(Map<String, String> openapiNormalizer) {
|
||||
this.openapiNormalizer = openapiNormalizer;
|
||||
return this;
|
||||
}
|
||||
@@ -1164,7 +1164,7 @@ public final class GeneratorSettings implements Serializable {
|
||||
* @param value The value of the OpenAPI normalizer rule
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder withOpenAPINormalizer(String key, String value) {
|
||||
public Builder withOpenapiNormalizer(String key, String value) {
|
||||
if (this.openapiNormalizer == null) {
|
||||
this.openapiNormalizer = new HashMap<>();
|
||||
}
|
||||
@@ -1203,7 +1203,7 @@ public final class GeneratorSettings implements Serializable {
|
||||
* @param openapiGeneratorIgnoreList the {@code openapiGeneratorIgnoreList} to set
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder withOpenAPIGeneratorIgnoreList(Set<String> openapiGeneratorIgnoreList) {
|
||||
public Builder withOpenapiGeneratorIgnoreList(Set<String> openapiGeneratorIgnoreList) {
|
||||
this.openapiGeneratorIgnoreList = openapiGeneratorIgnoreList;
|
||||
return this;
|
||||
}
|
||||
@@ -1214,7 +1214,7 @@ public final class GeneratorSettings implements Serializable {
|
||||
* @param value The value of entry to set
|
||||
* @return a reference to this Builder
|
||||
*/
|
||||
public Builder withOpenAPIGeneratorIgnoreList(String value) {
|
||||
public Builder withOpenapiGeneratorIgnoreList(String value) {
|
||||
if (this.openapiGeneratorIgnoreList == null) {
|
||||
this.openapiGeneratorIgnoreList = new HashSet<>();
|
||||
}
|
||||
@@ -1390,9 +1390,9 @@ public final class GeneratorSettings implements Serializable {
|
||||
Objects.equals(getModelNameMappings(), that.getModelNameMappings()) &&
|
||||
Objects.equals(getEnumNameMappings(), that.getEnumNameMappings()) &&
|
||||
Objects.equals(getOperationIdNameMappings(), that.getOperationIdNameMappings()) &&
|
||||
Objects.equals(getOpenAPINormalizer(), that.getOpenAPINormalizer()) &&
|
||||
Objects.equals(getOpenapiNormalizer(), that.getOpenapiNormalizer()) &&
|
||||
Objects.equals(getLanguageSpecificPrimitives(), that.getLanguageSpecificPrimitives()) &&
|
||||
Objects.equals(getOpenAPIGeneratorIgnoreList(), that.getOpenAPIGeneratorIgnoreList()) &&
|
||||
Objects.equals(getOpenapiGeneratorIgnoreList(), that.getOpenapiGeneratorIgnoreList()) &&
|
||||
Objects.equals(getReservedWordsMappings(), that.getReservedWordsMappings()) &&
|
||||
Objects.equals(getGitHost(), that.getGitHost()) &&
|
||||
Objects.equals(getGitUserId(), that.getGitUserId()) &&
|
||||
@@ -1428,9 +1428,9 @@ public final class GeneratorSettings implements Serializable {
|
||||
getModelNameMappings(),
|
||||
getEnumNameMappings(),
|
||||
getOperationIdNameMappings(),
|
||||
getOpenAPINormalizer(),
|
||||
getOpenapiNormalizer(),
|
||||
getLanguageSpecificPrimitives(),
|
||||
getOpenAPIGeneratorIgnoreList(),
|
||||
getOpenapiGeneratorIgnoreList(),
|
||||
getReservedWordsMappings(),
|
||||
getGitHost(),
|
||||
getGitUserId(),
|
||||
|
||||
@@ -97,7 +97,7 @@ task validateGoodSpec(type: org.openapitools.generator.gradle.plugin.tasks.Valid
|
||||
[source,group]
|
||||
----
|
||||
plugins {
|
||||
id "org.openapi.generator" version "7.2.0"
|
||||
id "org.openapi.generator" version "7.5.0"
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# RELEASE_VERSION
|
||||
openApiGeneratorVersion=7.5.0-SNAPSHOT
|
||||
openApiGeneratorVersion=7.6.0-SNAPSHOT
|
||||
# /RELEASE_VERSION
|
||||
|
||||
# BEGIN placeholders
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.5.0-SNAPSHOT</version>
|
||||
<version>7.6.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# RELEASE_VERSION
|
||||
openApiGeneratorVersion=7.5.0-SNAPSHOT
|
||||
openApiGeneratorVersion=7.6.0-SNAPSHOT
|
||||
# /RELEASE_VERSION
|
||||
|
||||
@@ -887,7 +887,7 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
|
||||
|
||||
if (openapiNormalizer.isPresent) {
|
||||
openapiNormalizer.get().forEach { entry ->
|
||||
configurator.addOpenAPINormalizer(entry.key, entry.value)
|
||||
configurator.addOpenapiNormalizer(entry.key, entry.value)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -917,7 +917,7 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
|
||||
|
||||
if (openapiGeneratorIgnoreList.isPresent) {
|
||||
openapiGeneratorIgnoreList.get().forEach {
|
||||
configurator.addOpenAPIGeneratorIgnoreList(it)
|
||||
configurator.addOpenapiGeneratorIgnoreList(it)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -401,7 +401,7 @@ class GenerateTaskDslTest : TestBase() {
|
||||
fun `openApiValidate should fail on invalid spec`() {
|
||||
// Arrange
|
||||
val projectFiles = mapOf(
|
||||
"spec.yaml" to javaClass.classLoader.getResourceAsStream("specs/petstore-v3.0-invalid.yaml")
|
||||
"spec.yaml" to javaClass.classLoader.getResourceAsStream("specs/petstore-v3.0-invalid-due-to-missing-info-attribute.yaml")
|
||||
)
|
||||
|
||||
withProject(defaultBuildGradle, projectFiles)
|
||||
@@ -423,7 +423,7 @@ class GenerateTaskDslTest : TestBase() {
|
||||
fun `openApiValidate should ok skip spec validation`() {
|
||||
// Arrange
|
||||
val projectFiles = mapOf(
|
||||
"spec.yaml" to javaClass.classLoader.getResourceAsStream("specs/petstore-v3.0-invalid.yaml")
|
||||
"spec.yaml" to javaClass.classLoader.getResourceAsStream("specs/petstore-v3.0-invalid-due-to-missing-info-attribute.yaml")
|
||||
)
|
||||
|
||||
withProject("""
|
||||
|
||||
@@ -113,7 +113,7 @@ class ValidateTaskDslTest : TestBase() {
|
||||
fun `openApiValidate should fail on invalid spec`(gradleVersion: String?) {
|
||||
// Arrange
|
||||
val projectFiles = mapOf(
|
||||
"spec.yaml" to javaClass.classLoader.getResourceAsStream("specs/petstore-v3.0-invalid.yaml")
|
||||
"spec.yaml" to javaClass.classLoader.getResourceAsStream("specs/petstore-v3.0-invalid-due-to-missing-info-attribute.yaml")
|
||||
)
|
||||
withProject(
|
||||
"""
|
||||
@@ -139,6 +139,50 @@ class ValidateTaskDslTest : TestBase() {
|
||||
result.output.contains("Spec is invalid."),
|
||||
"Unexpected/no message presented to the user for an invalid spec."
|
||||
)
|
||||
assertTrue(
|
||||
result.output.contains("attribute info is missing"),
|
||||
"Spec validation detail"
|
||||
)
|
||||
assertEquals(
|
||||
FAILED, result.task(":openApiValidate")?.outcome,
|
||||
"Expected a failed run, but found ${result.task(":openApiValidate")?.outcome}"
|
||||
)
|
||||
}
|
||||
|
||||
@Test(dataProvider = "gradle_version_provider")
|
||||
fun `openApiValidate should fail on invalid spec with duplicate 200 status code`(gradleVersion: String?) {
|
||||
// Arrange
|
||||
val projectFiles = mapOf(
|
||||
"spec.yaml" to javaClass.classLoader.getResourceAsStream("specs/petstore-v3.0-invalid-due-to-duplicate-200-status-code.yaml")
|
||||
)
|
||||
withProject(
|
||||
"""
|
||||
| plugins {
|
||||
| id 'org.openapi.generator'
|
||||
| }
|
||||
|
|
||||
| openApiValidate {
|
||||
| inputSpec = file('spec.yaml').absolutePath
|
||||
| }
|
||||
""".trimMargin(), projectFiles
|
||||
)
|
||||
|
||||
// Act
|
||||
val result = getGradleRunner(gradleVersion)
|
||||
.withProjectDir(temp)
|
||||
.withArguments("openApiValidate")
|
||||
.withPluginClasspath()
|
||||
.buildAndFail()
|
||||
|
||||
// Assert
|
||||
assertTrue(
|
||||
result.output.contains("Spec is invalid."),
|
||||
"Unexpected/no message presented to the user for an invalid spec."
|
||||
)
|
||||
assertTrue(
|
||||
result.output.contains("Duplicate field 200"),
|
||||
"Spec validation detail"
|
||||
)
|
||||
assertEquals(
|
||||
FAILED, result.task(":openApiValidate")?.outcome,
|
||||
"Expected a failed run, but found ${result.task(":openApiValidate")?.outcome}"
|
||||
@@ -186,7 +230,7 @@ class ValidateTaskDslTest : TestBase() {
|
||||
fun `validateBadSpec as defined task should fail on invalid spec`(gradleVersion: String?) {
|
||||
// Arrange
|
||||
val projectFiles = mapOf(
|
||||
"spec.yaml" to javaClass.classLoader.getResourceAsStream("specs/petstore-v3.0-invalid.yaml")
|
||||
"spec.yaml" to javaClass.classLoader.getResourceAsStream("specs/petstore-v3.0-invalid-due-to-missing-info-attribute.yaml")
|
||||
)
|
||||
withProject(
|
||||
"""
|
||||
@@ -212,6 +256,10 @@ class ValidateTaskDslTest : TestBase() {
|
||||
result.output.contains("Spec is invalid."),
|
||||
"Unexpected/no message presented to the user for an invalid spec."
|
||||
)
|
||||
assertTrue(
|
||||
result.output.contains("attribute info is missing"),
|
||||
"Unexpected/no message presented to the user for an invalid spec."
|
||||
)
|
||||
assertEquals(
|
||||
FAILED, result.task(":validateBadSpec")?.outcome,
|
||||
"Expected a failed run, but found ${result.task(":validateBadSpec")?.outcome}"
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
openapi: "3.0.0"
|
||||
info:
|
||||
version: 1.0.0
|
||||
title: Swagger Petstore
|
||||
license:
|
||||
name: MIT
|
||||
servers:
|
||||
- url: http://petstore.swagger.io/v1
|
||||
paths:
|
||||
/pets:
|
||||
get:
|
||||
summary: List all pets
|
||||
operationId: listPets
|
||||
tags:
|
||||
- pets
|
||||
parameters:
|
||||
- name: limit
|
||||
in: query
|
||||
description: How many items to return at one time (max 100)
|
||||
required: false
|
||||
schema:
|
||||
type: integer
|
||||
format: int32
|
||||
responses:
|
||||
'200':
|
||||
description: A paged array of pets
|
||||
headers:
|
||||
x-next:
|
||||
description: A link to the next page of responses
|
||||
schema:
|
||||
type: string
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Pets"
|
||||
'200':
|
||||
description: duplicate 200
|
||||
default:
|
||||
description: unexpected error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Error"
|
||||
post:
|
||||
summary: Create a pet
|
||||
operationId: createPets
|
||||
tags:
|
||||
- pets
|
||||
responses:
|
||||
'201':
|
||||
description: Null response
|
||||
default:
|
||||
description: unexpected error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Error"
|
||||
/pets/{petId}:
|
||||
get:
|
||||
summary: Info for a specific pet
|
||||
operationId: showPetById
|
||||
tags:
|
||||
- pets
|
||||
parameters:
|
||||
- name: petId
|
||||
in: path
|
||||
required: true
|
||||
description: The id of the pet to retrieve
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: Expected response to a valid request
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Pets"
|
||||
default:
|
||||
description: unexpected error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Error"
|
||||
components:
|
||||
schemas:
|
||||
Pet:
|
||||
required:
|
||||
- id
|
||||
- name
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
name:
|
||||
type: string
|
||||
tag:
|
||||
type: string
|
||||
Pets:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/Pet"
|
||||
Error:
|
||||
required:
|
||||
- code
|
||||
- message
|
||||
properties:
|
||||
code:
|
||||
type: integer
|
||||
format: int32
|
||||
message:
|
||||
type: string
|
||||
@@ -12,7 +12,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase)
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.2.0</version>
|
||||
<version>7.5.0</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user