mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2026-02-13 06:30:54 +00:00
Compare commits
101 Commits
v7.19.0
...
wing328-pa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a3fb9aeef8 | ||
|
|
7c5f7cf4e5 | ||
|
|
2ab70fa46b | ||
|
|
95911180f6 | ||
|
|
1cafc1673a | ||
|
|
268213004e | ||
|
|
ad2044c581 | ||
|
|
f3a21a8bba | ||
|
|
811529cb66 | ||
|
|
883bd56ea9 | ||
|
|
897590ae6a | ||
|
|
3c052d8b64 | ||
|
|
34dc09b676 | ||
|
|
f8e1fadf4e | ||
|
|
41a8573437 | ||
|
|
fd17603109 | ||
|
|
7506b6ca02 | ||
|
|
3df34f6aab | ||
|
|
95e8360c19 | ||
|
|
ba8327386c | ||
|
|
8b6df51cdf | ||
|
|
66a211ec56 | ||
|
|
4da2d8095d | ||
|
|
d26f67c576 | ||
|
|
63151d3a68 | ||
|
|
6f211a20e8 | ||
|
|
82ad061fe9 | ||
|
|
063a780c7a | ||
|
|
b4430804c1 | ||
|
|
c56ea5557a | ||
|
|
a625300e3f | ||
|
|
8b563222bd | ||
|
|
572b315f8b | ||
|
|
c5993af2ea | ||
|
|
f7ac63a188 | ||
|
|
c0d555ba4a | ||
|
|
683b024154 | ||
|
|
3db927e060 | ||
|
|
9fa18d0c81 | ||
|
|
6022e4ec7d | ||
|
|
11e06d1e77 | ||
|
|
3ed013966b | ||
|
|
73a486a726 | ||
|
|
ad948aa093 | ||
|
|
047ea41087 | ||
|
|
39a3bfa181 | ||
|
|
8cd3ea2457 | ||
|
|
a4985cad28 | ||
|
|
422e30a3d9 | ||
|
|
67cbfb3cad | ||
|
|
0d10a5b8ff | ||
|
|
43b15fbc25 | ||
|
|
695f7076bf | ||
|
|
51d5310dae | ||
|
|
2d81b01737 | ||
|
|
a0dc0e2eb8 | ||
|
|
d19f0cd348 | ||
|
|
17b77909d9 | ||
|
|
852a6075b2 | ||
|
|
1f4017a33f | ||
|
|
2d53488404 | ||
|
|
5926c3175e | ||
|
|
761cb777f6 | ||
|
|
e868637587 | ||
|
|
ea6f4c8780 | ||
|
|
ab42a1bef2 | ||
|
|
943b80bbb4 | ||
|
|
6ad16aaf7b | ||
|
|
db7d39f622 | ||
|
|
acb80bac95 | ||
|
|
b15636e3e9 | ||
|
|
8a3507cfa7 | ||
|
|
2707e5101c | ||
|
|
cc045ab53c | ||
|
|
29befb95d2 | ||
|
|
3f9465edcb | ||
|
|
2c463d9167 | ||
|
|
5cffc45428 | ||
|
|
6fc64e2115 | ||
|
|
a1c948df9f | ||
|
|
bf5ced7354 | ||
|
|
a045531ca7 | ||
|
|
b66c93a864 | ||
|
|
ea0504b17e | ||
|
|
f2a49b1c27 | ||
|
|
c189e5c263 | ||
|
|
0f23c4ff17 | ||
|
|
342febde58 | ||
|
|
4034201640 | ||
|
|
4a61a4ca74 | ||
|
|
b862290aec | ||
|
|
52d910be41 | ||
|
|
3a670a697a | ||
|
|
0f136af41d | ||
|
|
32d4085105 | ||
|
|
3be911d0e6 | ||
|
|
c34d593d8f | ||
|
|
9a0d711cf6 | ||
|
|
9adfe986a3 | ||
|
|
084a0a46b4 | ||
|
|
a62ed1dd2a |
2
.github/workflows/mill-plugin-tests.yaml
vendored
2
.github/workflows/mill-plugin-tests.yaml
vendored
@@ -21,7 +21,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
- name: Restore cache (read-only)
|
||||
# only use restore keys, no save key because we need to clear the cache before running the examples
|
||||
uses: actions/cache/restore@v4
|
||||
uses: actions/cache/restore@v5
|
||||
with:
|
||||
path: |
|
||||
~/.m2/repository
|
||||
|
||||
@@ -21,7 +21,7 @@ jobs:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: '3.9'
|
||||
python-version: '3.10'
|
||||
- name: Install dependencies
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: |
|
||||
|
||||
9
.github/workflows/samples-rust-server.yaml
vendored
9
.github/workflows/samples-rust-server.yaml
vendored
@@ -64,6 +64,15 @@ jobs:
|
||||
if cargo read-manifest | grep -q '"validate"'; then
|
||||
cargo build --features validate --all-targets
|
||||
fi
|
||||
# Test TLS features if they exist
|
||||
if cargo read-manifest | grep -q '"client-tls"'; then
|
||||
# Client without TLS (HTTP-only)
|
||||
cargo build --no-default-features --features=client --lib
|
||||
# Client with TLS (using native-tls)
|
||||
cargo build --no-default-features --features=client,client-tls --lib
|
||||
# Server without TLS
|
||||
cargo build --no-default-features --features=server --lib
|
||||
fi
|
||||
cargo fmt
|
||||
cargo test
|
||||
cargo clippy
|
||||
|
||||
18
README.md
18
README.md
@@ -15,7 +15,7 @@
|
||||
|
||||
<div align="center">
|
||||
|
||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.19.0`):
|
||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.20.0`):
|
||||
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
|
||||
[](https://app.bitrise.io/app/4a2b10a819d12b67)
|
||||
|
||||
@@ -148,8 +148,8 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
|
||||
|
||||
| OpenAPI Generator Version | Release Date | Notes |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- |
|
||||
| 7.19.0 (upcoming minor release) [SNAPSHOT](https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-to-test-with-the-latest-master-of-openapi-generator) | 22.01.2026 | Minor release with breaking changes (with fallback) |
|
||||
| [7.18.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.18.0) (latest stable release) | 22.12.2025 | Minor release with breaking changes (with fallback) |
|
||||
| 7.20.0 (upcoming minor release) [SNAPSHOT](https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-to-test-with-the-latest-master-of-openapi-generator) | 20.02.2026 | Minor release with breaking changes (with fallback) |
|
||||
| [7.19.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.19.0) (latest stable release) | 20.01.2026 | 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) |
|
||||
@@ -212,16 +212,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.18.0/openapi-generator-cli-7.18.0.jar`
|
||||
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.19.0/openapi-generator-cli-7.19.0.jar`
|
||||
|
||||
For **Mac/Linux** users:
|
||||
```sh
|
||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.18.0/openapi-generator-cli-7.18.0.jar -O openapi-generator-cli.jar
|
||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.19.0/openapi-generator-cli-7.19.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.18.0/openapi-generator-cli-7.18.0.jar
|
||||
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.19.0/openapi-generator-cli-7.19.0.jar
|
||||
```
|
||||
|
||||
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
|
||||
@@ -456,7 +456,7 @@ openapi-generator-cli version
|
||||
To use a specific version of "openapi-generator-cli"
|
||||
|
||||
```sh
|
||||
openapi-generator-cli version-manager set 7.18.0
|
||||
openapi-generator-cli version-manager set 7.19.0
|
||||
```
|
||||
|
||||
Or install it as dev-dependency:
|
||||
@@ -480,7 +480,7 @@ pip install openapi-generator-cli
|
||||
|
||||
To install a specific version
|
||||
```
|
||||
pip install openapi-generator-cli==7.18.0
|
||||
pip install openapi-generator-cli==7.19.0
|
||||
```
|
||||
|
||||
You can also install with [jdk4py](https://github.com/activeviam/jdk4py) instead of java binary. (python>=3.10 is required)
|
||||
@@ -506,7 +506,7 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat
|
||||
(if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php -o c:\temp\php_api_client`)
|
||||
|
||||
<!-- RELEASE_VERSION -->
|
||||
You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.18.0/openapi-generator-cli-7.18.0.jar)
|
||||
You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.19.0/openapi-generator-cli-7.19.0.jar)
|
||||
<!-- /RELEASE_VERSION -->
|
||||
|
||||
To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate`
|
||||
|
||||
6
bin/configs/html.yaml
Normal file
6
bin/configs/html.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
generatorName: html
|
||||
outputDir: samples/documentation/html
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/htmlDocs
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
@@ -7,6 +7,6 @@ generateAliasAsModel: true
|
||||
additionalProperties:
|
||||
projectName: PetstoreClient
|
||||
useSPMFileStructure: true
|
||||
useClasses: true
|
||||
useClasses: false
|
||||
useBacktickEscapes: true
|
||||
mapFileBinaryToData: true
|
||||
|
||||
@@ -47,26 +47,26 @@ For example:
|
||||
|
||||
echo "$header"
|
||||
|
||||
if [[ ${#files[@]} -eq 1 && "${files[0]}" != *'*'* ]]; then
|
||||
# shellcheck disable=SC2086
|
||||
# shellcheck disable=SC2068
|
||||
java ${JAVA_OPTS} -jar "$executable" generate -c ${files[0]} ${args[@]}
|
||||
else
|
||||
echo "Please press CTRL+C to stop or the script will continue in 5 seconds."
|
||||
#sleep 5
|
||||
if [ ${#files[@]} -eq 0 ]; then
|
||||
files=("${root}"/bin/configs/*.yaml)
|
||||
fi
|
||||
tmpfile=$(mktemp)
|
||||
trap "rm -f $tmpfile" EXIT
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
# shellcheck disable=SC2068
|
||||
if java ${JAVA_OPTS} -jar "$executable" batch ${BATCH_OPTS} --includes-base-dir "${root}" --fail-fast -- ${files[@]} 2>&1 | tee /dev/pts/0 | grep -q -i "exception"; then
|
||||
echo "Found exception(s) when running the generator(s) to update the samples."
|
||||
export GENERATE_ERROR=1
|
||||
fi
|
||||
if [[ ${#files[@]} -eq 1 && "${files[0]}" != *'*'* ]]; then
|
||||
# shellcheck disable=SC2086
|
||||
# shellcheck disable=SC2068
|
||||
java ${JAVA_OPTS} -jar "$executable" generate -c ${files[0]} ${args[@]} 2>&1 | tee "$tmpfile"
|
||||
retcode=${PIPESTATUS[0]}
|
||||
else
|
||||
if [ ${#files[@]} -eq 0 ]; then
|
||||
files=("${root}"/bin/configs/*.yaml)
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
# shellcheck disable=SC2068
|
||||
java ${JAVA_OPTS} -jar "$executable" batch ${BATCH_OPTS} --includes-base-dir "${root}" --fail-fast -- ${files[@]} 2>&1 | tee "$tmpfile"
|
||||
retcode=${PIPESTATUS[0]}
|
||||
fi
|
||||
|
||||
if [[ -n "$GENERATE_ERROR" ]]; then
|
||||
if [[ $retcode -ne 0 ]] || grep -q -i "at org.openapitools" "$tmpfile"; then
|
||||
echo "Found exception(s) when running the generator(s) to update the samples."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -27,15 +27,6 @@ workflows:
|
||||
set -e
|
||||
|
||||
./samples/client/petstore/swift6/swift6_test_all.sh
|
||||
- script@1.2.0:
|
||||
title: Run Swift5 tests
|
||||
inputs:
|
||||
- content: |
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
./samples/client/petstore/swift5/swift5_test_all.sh
|
||||
- script@1.2.0:
|
||||
title: Run swift-combine tests
|
||||
inputs:
|
||||
|
||||
@@ -723,3 +723,10 @@ Into this securityScheme:
|
||||
scheme: bearer
|
||||
type: http
|
||||
```
|
||||
|
||||
- `SORT_MODEL_PROPERTIES`: When set to true, model properties will be sorted alphabetically by name. This ensures deterministic code generation output regardless of property ordering in the source spec.
|
||||
|
||||
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 SORT_MODEL_PROPERTIES=true
|
||||
```
|
||||
|
||||
@@ -68,7 +68,7 @@ The following generators are available:
|
||||
* [scala-sttp4-jsoniter (beta)](generators/scala-sttp4-jsoniter.md)
|
||||
* [scalaz](generators/scalaz.md)
|
||||
* [swift-combine](generators/swift-combine.md)
|
||||
* [swift5](generators/swift5.md)
|
||||
* [swift5 (deprecated)](generators/swift5.md)
|
||||
* [swift6](generators/swift6.md)
|
||||
* [typescript (experimental)](generators/typescript.md)
|
||||
* [typescript-angular](generators/typescript-angular.md)
|
||||
|
||||
@@ -30,6 +30,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|
|
||||
|containerDefaultToNull|Set containers (array, set, map) default to null| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|legacy|
|
||||
|defaultToEmptyContainer|Initialize containers (array/set/map) to empty containers instead of null by default. Usage: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#default-values| |null|
|
||||
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|
||||
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|
||||
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|
||||
|
||||
@@ -44,6 +44,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|configPackage|configuration package for generated code| |org.openapitools.configuration|
|
||||
|containerDefaultToNull|Set containers (array, set, map) default to null| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|java8|
|
||||
|defaultToEmptyContainer|Initialize containers (array/set/map) to empty containers instead of null by default. Usage: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#default-values| |null|
|
||||
|delegatePattern|Whether to generate the server files using the delegate pattern| |false|
|
||||
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|
||||
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|
||||
@@ -110,7 +111,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|useOptional|Use Optional container for optional parameters| |false|
|
||||
|useResponseEntity|Use the `ResponseEntity` type to wrap return values of generated API methods. If disabled, method are annotated using a `@ResponseStatus` annotation, which has the status of the first response declared in the Api definition| |true|
|
||||
|useSealed|Whether to generate sealed model interfaces and classes| |false|
|
||||
|useSpringBoot3|Generate code and provide dependencies for use with Spring Boot 3.x. (Use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.| |false|
|
||||
|useSpringBoot3|Generate code and provide dependencies for use with Spring Boot ≥ 3 (use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.| |false|
|
||||
|useSpringBuiltInValidation|Disable `@Validated` at the class level when using built-in validation.| |false|
|
||||
|useSpringController|Annotate the generated API as a Spring Controller| |false|
|
||||
|useSwaggerUI|Open the OpenApi specification in swagger-ui. Will also import and configure needed dependencies| |true|
|
||||
|
||||
@@ -34,6 +34,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|configPackage|configuration package for generated code| |org.openapitools.configuration|
|
||||
|containerDefaultToNull|Set containers (array, set, map) default to null| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|java8|
|
||||
|defaultToEmptyContainer|Initialize containers (array/set/map) to empty containers instead of null by default. Usage: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#default-values| |null|
|
||||
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|
||||
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|
||||
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|
||||
|
||||
@@ -33,6 +33,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|configKey|Config key in @RegisterRestClient. Default to none.| |null|
|
||||
|containerDefaultToNull|Set containers (array, set, map) default to null| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|java8|
|
||||
|defaultToEmptyContainer|Initialize containers (array/set/map) to empty containers instead of null by default. Usage: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#default-values| |null|
|
||||
|disableDiscriminatorJsonIgnoreProperties|Ignore discriminator field type for Jackson serialization| |false|
|
||||
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|
||||
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|
||||
|
||||
@@ -32,6 +32,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|
|
||||
|containerDefaultToNull|Set containers (array, set, map) default to null| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|java8|
|
||||
|defaultToEmptyContainer|Initialize containers (array/set/map) to empty containers instead of null by default. Usage: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#default-values| |null|
|
||||
|disableDiscriminatorJsonIgnoreProperties|Ignore discriminator field type for Jackson serialization| |false|
|
||||
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|
||||
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|
||||
|
||||
@@ -32,6 +32,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|
|
||||
|containerDefaultToNull|Set containers (array, set, map) default to null| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|legacy|
|
||||
|defaultToEmptyContainer|Initialize containers (array/set/map) to empty containers instead of null by default. Usage: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#default-values| |null|
|
||||
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|
||||
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|
||||
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|
||||
|
||||
@@ -41,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|dateFormat|Specify the format pattern of date as a string| |null|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|java8|
|
||||
|datetimeFormat|Specify the format pattern of date-time as a string| |null|
|
||||
|defaultToEmptyContainer|Initialize containers (array/set/map) to empty containers instead of null by default. Usage: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#default-values| |null|
|
||||
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|
||||
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|
||||
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|
||||
|
||||
@@ -36,6 +36,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|dateFormat|Specify the format pattern of date as a string| |null|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|java8|
|
||||
|datetimeFormat|Specify the format pattern of date-time as a string| |null|
|
||||
|defaultToEmptyContainer|Initialize containers (array/set/map) to empty containers instead of null by default. Usage: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#default-values| |null|
|
||||
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|
||||
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|
||||
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|
||||
|
||||
@@ -37,6 +37,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|configKeyFromClassName|If true, set tag as key in @RegisterRestClient. Default to false. Only `microprofile` supports this option.| |null|
|
||||
|containerDefaultToNull|Set containers (array, set, map) default to null| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|java8|
|
||||
|defaultToEmptyContainer|Initialize containers (array/set/map) to empty containers instead of null by default. Usage: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#default-values| |null|
|
||||
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|
||||
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|
||||
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|
||||
|
||||
@@ -32,6 +32,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|
|
||||
|containerDefaultToNull|Set containers (array, set, map) default to null| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|legacy|
|
||||
|defaultToEmptyContainer|Initialize containers (array/set/map) to empty containers instead of null by default. Usage: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#default-values| |null|
|
||||
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|
||||
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|
||||
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|
||||
|
||||
@@ -33,6 +33,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|
|
||||
|containerDefaultToNull|Set containers (array, set, map) default to null| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|java8|
|
||||
|defaultToEmptyContainer|Initialize containers (array/set/map) to empty containers instead of null by default. Usage: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#default-values| |null|
|
||||
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|
||||
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|
||||
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|
||||
|
||||
@@ -35,6 +35,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|containerDefaultToNull|Set containers (array, set, map) default to null| |false|
|
||||
|controllerOnly|Whether to generate only API interface stubs without the server files.| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|java8|
|
||||
|defaultToEmptyContainer|Initialize containers (array/set/map) to empty containers instead of null by default. Usage: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#default-values| |null|
|
||||
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|
||||
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|
||||
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|
||||
|
||||
@@ -32,6 +32,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|
|
||||
|containerDefaultToNull|Set containers (array, set, map) default to null| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|legacy|
|
||||
|defaultToEmptyContainer|Initialize containers (array/set/map) to empty containers instead of null by default. Usage: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#default-values| |null|
|
||||
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|
||||
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|
||||
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|
||||
|
||||
@@ -32,6 +32,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|
|
||||
|containerDefaultToNull|Set containers (array, set, map) default to null| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|java8|
|
||||
|defaultToEmptyContainer|Initialize containers (array/set/map) to empty containers instead of null by default. Usage: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#default-values| |null|
|
||||
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|
||||
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|
||||
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|
||||
|
||||
@@ -32,6 +32,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|
|
||||
|containerDefaultToNull|Set containers (array, set, map) default to null| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|java8|
|
||||
|defaultToEmptyContainer|Initialize containers (array/set/map) to empty containers instead of null by default. Usage: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#default-values| |null|
|
||||
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|
||||
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|
||||
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|
||||
|
||||
@@ -32,6 +32,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|
|
||||
|containerDefaultToNull|Set containers (array, set, map) default to null| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|java8|
|
||||
|defaultToEmptyContainer|Initialize containers (array/set/map) to empty containers instead of null by default. Usage: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#default-values| |null|
|
||||
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|
||||
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|
||||
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|
||||
|
||||
@@ -37,6 +37,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|configKeyFromClassName|If true, set tag as key in @RegisterRestClient. Default to false. Only `microprofile` supports this option.| |null|
|
||||
|containerDefaultToNull|Set containers (array, set, map) default to null| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|java8|
|
||||
|defaultToEmptyContainer|Initialize containers (array/set/map) to empty containers instead of null by default. Usage: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#default-values| |null|
|
||||
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|
||||
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|
||||
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|
||||
|
||||
@@ -32,6 +32,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|
|
||||
|containerDefaultToNull|Set containers (array, set, map) default to null| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|legacy|
|
||||
|defaultToEmptyContainer|Initialize containers (array/set/map) to empty containers instead of null by default. Usage: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#default-values| |null|
|
||||
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|
||||
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|
||||
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|
||||
|
||||
@@ -33,6 +33,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|
|
||||
|containerDefaultToNull|Set containers (array, set, map) default to null| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|legacy|
|
||||
|defaultToEmptyContainer|Initialize containers (array/set/map) to empty containers instead of null by default. Usage: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#default-values| |null|
|
||||
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|
||||
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|
||||
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|
||||
|
||||
@@ -34,6 +34,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|
|
||||
|containerDefaultToNull|Set containers (array, set, map) default to null| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|legacy|
|
||||
|defaultToEmptyContainer|Initialize containers (array/set/map) to empty containers instead of null by default. Usage: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#default-values| |null|
|
||||
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|
||||
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|
||||
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|
||||
|
||||
@@ -34,6 +34,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|
|
||||
|containerDefaultToNull|Set containers (array, set, map) default to null| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|legacy|
|
||||
|defaultToEmptyContainer|Initialize containers (array/set/map) to empty containers instead of null by default. Usage: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#default-values| |null|
|
||||
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|
||||
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|
||||
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|
||||
|
||||
@@ -32,6 +32,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|
|
||||
|containerDefaultToNull|Set containers (array, set, map) default to null| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|legacy|
|
||||
|defaultToEmptyContainer|Initialize containers (array/set/map) to empty containers instead of null by default. Usage: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#default-values| |null|
|
||||
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|
||||
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|
||||
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|
||||
|
||||
@@ -32,6 +32,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|
|
||||
|containerDefaultToNull|Set containers (array, set, map) default to null| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|legacy|
|
||||
|defaultToEmptyContainer|Initialize containers (array/set/map) to empty containers instead of null by default. Usage: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#default-values| |null|
|
||||
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|
||||
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|
||||
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|
||||
|
||||
@@ -32,6 +32,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|
|
||||
|containerDefaultToNull|Set containers (array, set, map) default to null| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|legacy|
|
||||
|defaultToEmptyContainer|Initialize containers (array/set/map) to empty containers instead of null by default. Usage: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#default-values| |null|
|
||||
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|
||||
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|
||||
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|
||||
|
||||
@@ -32,6 +32,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false|
|
||||
|containerDefaultToNull|Set containers (array, set, map) default to null| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|legacy|
|
||||
|defaultToEmptyContainer|Initialize containers (array/set/map) to empty containers instead of null by default. Usage: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#default-values| |null|
|
||||
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|
||||
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|
||||
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|
||||
|
||||
@@ -56,7 +56,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|useFeignClientUrl|Whether to generate Feign client with url parameter.| |true|
|
||||
|useFlowForArrayReturnType|Whether to use Flow for array/collection return types when reactive is enabled. If false, will use List instead.| |true|
|
||||
|useResponseEntity|Whether (when false) to return actual type (e.g. List<Fruit>) and handle non-happy path responses via exceptions flow or (when true) return entire ResponseEntity (e.g. ResponseEntity<List<Fruit>>). If disabled, method are annotated using a @ResponseStatus annotation, which has the status of the first response declared in the Api definition| |true|
|
||||
|useSpringBoot3|Generate code and provide dependencies for use with Spring Boot 3.x. (Use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.| |false|
|
||||
|useSpringBoot3|Generate code and provide dependencies for use with Spring Boot ≥ 3 (use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.| |false|
|
||||
|useSwaggerUI|Open the OpenApi specification in swagger-ui. Will also import and configure needed dependencies| |true|
|
||||
|useTags|Whether to use tags for creating interface and controller class names| |false|
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|aggregateModelsName|Aggregated model filename. If set, all generated models will be combined into this single file.| |null|
|
||||
|customOptionsApi|Custom options for the api files.| |null|
|
||||
|customOptionsModel|Custom options for the model files.| |null|
|
||||
|extractEnumsToSeparateFiles|Extract enums to separate protobuf files and import them in models| |false|
|
||||
|numberedFieldNumberList|Field numbers in order.| |false|
|
||||
|startEnumsWithUnspecified|Introduces "UNSPECIFIED" as the first element of enumerations.| |false|
|
||||
|supportMultipleResponses|Support multiple responses| |true|
|
||||
|
||||
@@ -10,7 +10,7 @@ title: Documentation for the python-fastapi Generator
|
||||
| generator stability | BETA | |
|
||||
| generator type | SERVER | |
|
||||
| generator language | Python | |
|
||||
| generator language version | 3.7 | |
|
||||
| generator language version | 3.10 | |
|
||||
| generator default templating engine | mustache | |
|
||||
| helpTxt | Generates a Python FastAPI server (beta). Models are defined with the pydantic library | |
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|configPackage|configuration package for generated code| |org.openapitools.configuration|
|
||||
|containerDefaultToNull|Set containers (array, set, map) default to null| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|java8|
|
||||
|defaultToEmptyContainer|Initialize containers (array/set/map) to empty containers instead of null by default. Usage: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#default-values| |null|
|
||||
|delegatePattern|Whether to generate the server files using the delegate pattern| |false|
|
||||
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
|
||||
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|
||||
@@ -103,7 +104,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|useOptional|Use Optional container for optional parameters| |false|
|
||||
|useResponseEntity|Use the `ResponseEntity` type to wrap return values of generated API methods. If disabled, method are annotated using a `@ResponseStatus` annotation, which has the status of the first response declared in the Api definition| |true|
|
||||
|useSealed|Whether to generate sealed model interfaces and classes| |false|
|
||||
|useSpringBoot3|Generate code and provide dependencies for use with Spring Boot 3.x. (Use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.| |false|
|
||||
|useSpringBoot3|Generate code and provide dependencies for use with Spring Boot ≥ 3 (use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.| |false|
|
||||
|useSpringBuiltInValidation|Disable `@Validated` at the class level when using built-in validation.| |false|
|
||||
|useSpringController|Annotate the generated API as a Spring Controller| |false|
|
||||
|useSwaggerUI|Open the OpenApi specification in swagger-ui. Will also import and configure needed dependencies| |true|
|
||||
|
||||
@@ -7,7 +7,7 @@ title: Documentation for the swift5 Generator
|
||||
| Property | Value | Notes |
|
||||
| -------- | ----- | ----- |
|
||||
| generator name | swift5 | pass this to the generate command after -g |
|
||||
| generator stability | STABLE | |
|
||||
| generator stability | DEPRECATED | |
|
||||
| generator type | CLIENT | |
|
||||
| generator language | Swift | |
|
||||
| generator default templating engine | mustache | |
|
||||
|
||||
@@ -22,7 +22,7 @@ npm install @openapitools/openapi-generator-cli -g
|
||||
To install a specific version of the tool, pass the version during installation:
|
||||
<!-- RELEASE_VERSION -->
|
||||
```bash
|
||||
openapi-generator-cli version-manager set 7.17.0
|
||||
openapi-generator-cli version-manager set 7.19.0
|
||||
```
|
||||
<!-- /RELEASE_VERSION -->
|
||||
To install the tool as a dev dependency in your current project:
|
||||
@@ -119,18 +119,18 @@ docker run --rm \
|
||||
<!-- RELEASE_VERSION -->
|
||||
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 11 runtime at a minimum):
|
||||
|
||||
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.17.0/openapi-generator-cli-7.17.0.jar`
|
||||
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.19.0/openapi-generator-cli-7.19.0.jar`
|
||||
|
||||
For **Mac/Linux** users:
|
||||
|
||||
```bash
|
||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.17.0/openapi-generator-cli-7.17.0.jar -O openapi-generator-cli.jar
|
||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.19.0/openapi-generator-cli-7.19.0.jar -O openapi-generator-cli.jar
|
||||
```
|
||||
|
||||
For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.
|
||||
|
||||
```powershell
|
||||
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.17.0/openapi-generator-cli-7.17.0.jar
|
||||
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.19.0/openapi-generator-cli-7.19.0.jar
|
||||
```
|
||||
<!-- /RELEASE_VERSION -->
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase)
|
||||
<plugin>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<version>7.17.0</version>
|
||||
<version>7.19.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
@@ -130,7 +130,7 @@ This Mill library provides a Mill module that can be used to generate code from
|
||||
```scala
|
||||
//| mill-version: 1.0.6
|
||||
//| mvnDeps:
|
||||
//| - org.openapitools:openapi-generator-mill-plugin:7.19.0 # 1.
|
||||
//| - org.openapitools:openapi-generator-mill-plugin:7.20.0 # 1.
|
||||
|
||||
import mill.*
|
||||
|
||||
@@ -162,8 +162,8 @@ This gives access to the following tasks:
|
||||
|
||||
| Task | Description |
|
||||
|---------------------------|---------------------------------------------------------------------------------------------|
|
||||
| <configName>.generate | Generate code via Open API Tools Generator for Open API 2.0 or 3.x specification documents. |
|
||||
| <configName>.validateSpec | Validates the configured spec |
|
||||
| <configName>.generate | Generate code via Open API Tools Generator for Open API 2.0 or 3.x specification documents. |
|
||||
| <configName>.validateSpec | Validates the configured spec |
|
||||
|
||||
and a command
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.19.0</version>
|
||||
<version>7.20.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.19.0</version>
|
||||
<version>7.20.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -97,7 +97,7 @@ task validateGoodSpec(type: org.openapitools.generator.gradle.plugin.tasks.Valid
|
||||
[source,group]
|
||||
----
|
||||
plugins {
|
||||
id "org.openapi.generator" version "7.17.0"
|
||||
id "org.openapi.generator" version "7.19.0"
|
||||
}
|
||||
----
|
||||
|
||||
@@ -113,7 +113,7 @@ buildscript {
|
||||
// url "https://plugins.gradle.org/m2/"
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.openapitools:openapi-generator-gradle-plugin:7.17.0"
|
||||
classpath "org.openapitools:openapi-generator-gradle-plugin:7.19.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -759,7 +759,7 @@ buildscript {
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.2.1'
|
||||
classpath('org.openapitools:openapi-generator-gradle-plugin:7.17.0') {
|
||||
classpath('org.openapitools:openapi-generator-gradle-plugin:7.19.0') {
|
||||
exclude group: 'com.google.guava'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# RELEASE_VERSION
|
||||
openApiGeneratorVersion=7.19.0
|
||||
openApiGeneratorVersion=7.20.0-SNAPSHOT
|
||||
# /RELEASE_VERSION
|
||||
|
||||
# BEGIN placeholders
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.19.0</version>
|
||||
<version>7.20.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# RELEASE_VERSION
|
||||
openApiGeneratorVersion=7.19.0
|
||||
openApiGeneratorVersion=7.20.0-SNAPSHOT
|
||||
# /RELEASE_VERSION
|
||||
|
||||
@@ -12,7 +12,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase)
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.17.0</version>
|
||||
<version>7.19.0</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.19.0</version>
|
||||
<version>7.20.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.19.0</version>
|
||||
<version>7.20.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.19.0</version>
|
||||
<version>7.20.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.19.0</version>
|
||||
<version>7.20.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.19.0</version>
|
||||
<version>7.20.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.19.0</version>
|
||||
<version>7.20.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.19.0</version>
|
||||
<version>7.20.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# RELEASE_VERSION
|
||||
openApiGeneratorVersion=7.19.0
|
||||
openApiGeneratorVersion=7.20.0-SNAPSHOT
|
||||
# /RELEASE_VERSION
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.19.0</version>
|
||||
<version>7.20.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
@@ -139,6 +139,28 @@
|
||||
<goal>testCompile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<!-- see https://github.com/davidB/scala-maven-plugin/issues/604 why a workaround is needed -->
|
||||
<id>attach-javadocs</id>
|
||||
<goals>
|
||||
<goal>doc-jar</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<scaladocClassName>dotty.tools.scaladoc.Main</scaladocClassName>
|
||||
<sourceDir>${project.build.outputDirectory}</sourceDir>
|
||||
<args>-nobootcp</args>
|
||||
<includes>
|
||||
<include>**/*.tasty</include>
|
||||
</includes>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.scala-lang</groupId>
|
||||
<artifactId>scaladoc_3</artifactId>
|
||||
<version>3.7.4</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.19.0</version>
|
||||
<version>7.20.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>7.19.0</version>
|
||||
<version>7.20.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
@@ -488,7 +488,7 @@
|
||||
<dependency>
|
||||
<groupId>org.assertj</groupId>
|
||||
<artifactId>assertj-core</artifactId>
|
||||
<version>3.23.1</version>
|
||||
<version>3.27.7</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -456,6 +456,7 @@ public class CodegenConstants {
|
||||
public static final String USE_DEFAULT_VALUES_FOR_REQUIRED_VARS = "useDefaultValuesForRequiredVars";
|
||||
|
||||
public static final String DEFAULT_TO_EMPTY_CONTAINER = "defaultToEmptyContainer";
|
||||
public static final String DEFAULT_TO_EMPTY_CONTAINER_DESC = "Initialize containers (array/set/map) to empty containers instead of null by default. Usage: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#default-values";
|
||||
|
||||
// Vendor extensions
|
||||
public static final String X_INTERNAL = "x-internal";
|
||||
|
||||
@@ -88,6 +88,10 @@ public class CodegenDiscriminator {
|
||||
this.explicitMapping = explicitMapping;
|
||||
}
|
||||
|
||||
public boolean isExplicitMapping() {
|
||||
return explicitMapping;
|
||||
}
|
||||
|
||||
public MappedModel(String mappingName, String modelName) {
|
||||
this(mappingName, modelName, false);
|
||||
}
|
||||
|
||||
@@ -151,6 +151,9 @@ public class OpenAPINormalizer {
|
||||
boolean updateNumberToNullable;
|
||||
boolean updateBooleanToNullable;
|
||||
|
||||
// when set to true, sort model properties by name to ensure deterministic output
|
||||
final String SORT_MODEL_PROPERTIES = "SORT_MODEL_PROPERTIES";
|
||||
|
||||
// ============= end of rules =============
|
||||
|
||||
/**
|
||||
@@ -209,6 +212,7 @@ public class OpenAPINormalizer {
|
||||
ruleNames.add(SET_PRIMITIVE_TYPES_TO_NULLABLE);
|
||||
ruleNames.add(SIMPLIFY_ONEOF_ANYOF_ENUM);
|
||||
ruleNames.add(REMOVE_PROPERTIES_FROM_TYPE_OTHER_THAN_OBJECT);
|
||||
ruleNames.add(SORT_MODEL_PROPERTIES);
|
||||
|
||||
// rules that are default to true
|
||||
rules.put(SIMPLIFY_ONEOF_ANYOF, true);
|
||||
@@ -768,7 +772,7 @@ public class OpenAPINormalizer {
|
||||
}
|
||||
|
||||
if (schema.getProperties() != null && !schema.getProperties().isEmpty()) {
|
||||
normalizeProperties(schema.getProperties(), visitedSchemas);
|
||||
normalizeProperties(schema, visitedSchemas);
|
||||
}
|
||||
|
||||
if (schema.getAdditionalProperties() != null) {
|
||||
@@ -777,7 +781,7 @@ public class OpenAPINormalizer {
|
||||
|
||||
return schema;
|
||||
} else if (schema.getProperties() != null && !schema.getProperties().isEmpty()) {
|
||||
normalizeProperties(schema.getProperties(), visitedSchemas);
|
||||
normalizeProperties(schema, visitedSchemas);
|
||||
} else if (schema.getAdditionalProperties() instanceof Schema) { // map
|
||||
normalizeMapSchema(schema);
|
||||
normalizeSchema((Schema) schema.getAdditionalProperties(), visitedSchemas);
|
||||
@@ -880,10 +884,19 @@ public class OpenAPINormalizer {
|
||||
processSetPrimitiveTypesToNullable(schema);
|
||||
}
|
||||
|
||||
protected void normalizeProperties(Map<String, Schema> properties, Set<Schema> visitedSchemas) {
|
||||
protected void normalizeProperties(Schema schema, Set<Schema> visitedSchemas) {
|
||||
Map<String, Schema> properties = schema.getProperties();
|
||||
if (properties == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Sort properties by name if rule is enabled
|
||||
if (getRule(SORT_MODEL_PROPERTIES)) {
|
||||
Map<String, Schema> sortedProperties = new TreeMap<>(properties);
|
||||
schema.setProperties(sortedProperties);
|
||||
properties = sortedProperties;
|
||||
}
|
||||
|
||||
for (Map.Entry<String, Schema> propertiesEntry : properties.entrySet()) {
|
||||
Schema property = propertiesEntry.getValue();
|
||||
|
||||
@@ -1089,7 +1102,7 @@ public class OpenAPINormalizer {
|
||||
protected Schema normalizeComplexComposedSchema(Schema schema, Set<Schema> visitedSchemas) {
|
||||
// loop through properties, if any
|
||||
if (schema.getProperties() != null && !schema.getProperties().isEmpty()) {
|
||||
normalizeProperties(schema.getProperties(), visitedSchemas);
|
||||
normalizeProperties(schema, visitedSchemas);
|
||||
}
|
||||
|
||||
processRemoveAnyOfOneOfAndKeepPropertiesOnly(schema);
|
||||
@@ -1854,7 +1867,7 @@ public class OpenAPINormalizer {
|
||||
schema.addAnyOfItem(new BooleanSchema());
|
||||
break;
|
||||
default:
|
||||
LOGGER.error("Type {} not yet supported in openapi-normalizer to process OpenAPI 3.1 spec with multiple types.");
|
||||
LOGGER.error("Type {} not yet supported in openapi-normalizer to process OpenAPI 3.1 spec with multiple types.", String.valueOf(type));
|
||||
LOGGER.error("Please report the issue via https://github.com/OpenAPITools/openapi-generator/issues/new/.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -378,6 +378,8 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
|
||||
CliOption enumPropertyNamingOpt = new CliOption(CodegenConstants.ENUM_PROPERTY_NAMING, ENUM_PROPERTY_NAMING_DESC);
|
||||
cliOptions.add(enumPropertyNamingOpt.defaultValue(enumPropertyNaming.name()));
|
||||
|
||||
cliOptions.add(CliOption.newString(CodegenConstants.DEFAULT_TO_EMPTY_CONTAINER, CodegenConstants.DEFAULT_TO_EMPTY_CONTAINER_DESC));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -608,7 +608,7 @@ public class GoClientCodegen extends AbstractGoCodegen {
|
||||
} else if (codegenParameter.isPrimitiveType) { // primitive type
|
||||
if (codegenParameter.isString) {
|
||||
if (!StringUtils.isEmpty(codegenParameter.example) && !"null".equals(codegenParameter.example)) {
|
||||
return "\"" + codegenParameter.example + "\"";
|
||||
return "\"" + escapeText(codegenParameter.example) + "\"";
|
||||
} else {
|
||||
return "\"" + codegenParameter.paramName + "_example\"";
|
||||
}
|
||||
@@ -640,7 +640,7 @@ public class GoClientCodegen extends AbstractGoCodegen {
|
||||
return constructExampleCode(modelMaps.get(codegenParameter.dataType), modelMaps, processedModelMap, 0);
|
||||
} else if (codegenParameter.isEmail) { // email
|
||||
if (!StringUtils.isEmpty(codegenParameter.example) && !"null".equals(codegenParameter.example)) {
|
||||
return "\"" + codegenParameter.example + "\"";
|
||||
return "\"" + escapeText(codegenParameter.example) + "\"";
|
||||
} else {
|
||||
return "\"" + codegenParameter.paramName + "@example.com\"";
|
||||
}
|
||||
@@ -681,7 +681,7 @@ public class GoClientCodegen extends AbstractGoCodegen {
|
||||
} else if (codegenProperty.isPrimitiveType) { // primitive type
|
||||
if (codegenProperty.isString) {
|
||||
if (!StringUtils.isEmpty(codegenProperty.example) && !"null".equals(codegenProperty.example)) {
|
||||
return "\"" + codegenProperty.example + "\"";
|
||||
return "\"" + escapeText(codegenProperty.example) + "\"";
|
||||
} else {
|
||||
return "\"" + codegenProperty.name + "_example\"";
|
||||
}
|
||||
@@ -714,7 +714,7 @@ public class GoClientCodegen extends AbstractGoCodegen {
|
||||
return constructExampleCode(modelMaps.get(codegenProperty.dataType), modelMaps, processedModelMap, depth + 1);
|
||||
} else if (codegenProperty.isEmail) { // email
|
||||
if (!StringUtils.isEmpty(codegenProperty.example) && !"null".equals(codegenProperty.example)) {
|
||||
return "\"" + codegenProperty.example + "\"";
|
||||
return "\"" + escapeText(codegenProperty.example) + "\"";
|
||||
} else {
|
||||
return "\"" + codegenProperty.name + "@example.com\"";
|
||||
}
|
||||
|
||||
@@ -241,7 +241,7 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen
|
||||
addSwitch(BEAN_QUALIFIERS, "Whether to add fully-qualifier class names as bean qualifiers in @Component and " +
|
||||
"@RestController annotations. May be used to prevent bean names clash if multiple generated libraries" +
|
||||
" (contexts) added to single project.", beanQualifiers);
|
||||
addSwitch(USE_SPRING_BOOT3, "Generate code and provide dependencies for use with Spring Boot 3.x. (Use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.", useSpringBoot3);
|
||||
addSwitch(USE_SPRING_BOOT3, "Generate code and provide dependencies for use with Spring Boot ≥ 3 (use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.", useSpringBoot3);
|
||||
addSwitch(USE_FLOW_FOR_ARRAY_RETURN_TYPE, "Whether to use Flow for array/collection return types when reactive is enabled. If false, will use List instead.", useFlowForArrayReturnType);
|
||||
addSwitch(INCLUDE_HTTP_REQUEST_CONTEXT, "Whether to include HttpServletRequest (blocking) or ServerWebExchange (reactive) as additional parameter in generated methods.", includeHttpRequestContext);
|
||||
addSwitch(USE_RESPONSE_ENTITY,
|
||||
|
||||
@@ -214,7 +214,11 @@ public class PhpNextgenClientCodegen extends AbstractPhpCodegen {
|
||||
String phpReturnType = String.join("|", phpReturnTypeOptions);
|
||||
String docReturnType = String.join("|", docReturnTypeOptions);
|
||||
if (hasEmptyResponse) {
|
||||
phpReturnType = "?" + phpReturnType;
|
||||
if (phpReturnTypeOptions.size() > 1) {
|
||||
phpReturnType = phpReturnType + "|null";
|
||||
} else {
|
||||
phpReturnType = "?" + phpReturnType;
|
||||
}
|
||||
docReturnType = docReturnType + "|null";
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -330,7 +330,7 @@ public class PythonFastAPIServerCodegen extends AbstractPythonCodegen {
|
||||
|
||||
@Override
|
||||
public String generatorLanguageVersion() {
|
||||
return "3.7";
|
||||
return "3.10";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -601,6 +601,7 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
public ModelsMap postProcessModels(ModelsMap objs) {
|
||||
for (ModelMap mo : objs.getModels()) {
|
||||
CodegenModel cm = mo.getModel();
|
||||
boolean needsExtractSimpleType = false;
|
||||
for (CodegenProperty var : cm.vars) {
|
||||
// check to see if base name is an empty string
|
||||
if ("".equals(var.baseName)) {
|
||||
@@ -608,10 +609,17 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
var.baseName = "empty_string";
|
||||
}
|
||||
|
||||
if (!var.isPrimitiveType) {
|
||||
needsExtractSimpleType = true;
|
||||
}
|
||||
|
||||
// create extension x-r-doc-type to store the data type in r doc format
|
||||
var.vendorExtensions.put("x-r-doc-type", constructRdocType(var));
|
||||
}
|
||||
|
||||
// create extension x-r-has-non-primitive-field to indicate whether generated models need special handling for complex types
|
||||
cm.vendorExtensions.put("x-r-has-non-primitive-field", needsExtractSimpleType);
|
||||
|
||||
// apply the same fix, enhancement for allVars
|
||||
for (CodegenProperty var : cm.allVars) {
|
||||
// check to see if base name is an empty string
|
||||
|
||||
@@ -610,6 +610,10 @@ public class RustServerCodegen extends AbstractRustCodegen implements CodegenCon
|
||||
processParam(param, op);
|
||||
}
|
||||
|
||||
for (CodegenParameter param : op.pathParams) {
|
||||
processParam(param, op);
|
||||
}
|
||||
|
||||
// We keep track of the 'default' model type for this API. If there are
|
||||
// *any* XML responses, then we set the default to XML, otherwise we
|
||||
// let the default be JSON. It would be odd for an API to want to use
|
||||
@@ -1459,6 +1463,45 @@ public class RustServerCodegen extends AbstractRustCodegen implements CodegenCon
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine the appropriate Rust integer type based on format and min/max constraints.
|
||||
* Returns the fitted data type, or null if the baseType is not an integer.
|
||||
*
|
||||
* @param dataFormat The data format (e.g., "int32", "int64", "uint32", "uint64")
|
||||
* @param minimum The minimum value constraint
|
||||
* @param maximum The maximum value constraint
|
||||
* @param exclusiveMinimum Whether the minimum is exclusive
|
||||
* @param exclusiveMaximum Whether the maximum is exclusive
|
||||
* @return The fitted Rust integer type.
|
||||
*/
|
||||
private String applyIntegerTypeFitting(String dataFormat,
|
||||
String minimum, String maximum,
|
||||
boolean exclusiveMinimum, boolean exclusiveMaximum) {
|
||||
BigInteger min = Optional.ofNullable(minimum).filter(s -> !s.isEmpty()).map(BigInteger::new).orElse(null);
|
||||
BigInteger max = Optional.ofNullable(maximum).filter(s -> !s.isEmpty()).map(BigInteger::new).orElse(null);
|
||||
|
||||
boolean unsigned = canFitIntoUnsigned(min, exclusiveMinimum);
|
||||
|
||||
if (Strings.isNullOrEmpty(dataFormat)) {
|
||||
return bestFittingIntegerType(min, exclusiveMinimum, max, exclusiveMaximum, true);
|
||||
} else {
|
||||
switch (dataFormat) {
|
||||
// custom integer formats (legacy)
|
||||
case "uint32":
|
||||
return "u32";
|
||||
case "uint64":
|
||||
return "u64";
|
||||
case "int32":
|
||||
return unsigned ? "u32" : "i32";
|
||||
case "int64":
|
||||
return unsigned ? "u64" : "i64";
|
||||
default:
|
||||
LOGGER.warn("The integer format '{}' is not recognized and will be ignored.", dataFormat);
|
||||
return bestFittingIntegerType(min, exclusiveMinimum, max, exclusiveMaximum, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postProcessModelProperty(CodegenModel model, CodegenProperty property) {
|
||||
super.postProcessModelProperty(model, property);
|
||||
@@ -1492,41 +1535,12 @@ public class RustServerCodegen extends AbstractRustCodegen implements CodegenCon
|
||||
// Integer type fitting
|
||||
if (Objects.equals(property.baseType, "integer")) {
|
||||
|
||||
BigInteger minimum = Optional.ofNullable(property.getMinimum()).map(BigInteger::new).orElse(null);
|
||||
BigInteger maximum = Optional.ofNullable(property.getMaximum()).map(BigInteger::new).orElse(null);
|
||||
|
||||
boolean unsigned = canFitIntoUnsigned(minimum, property.getExclusiveMinimum());
|
||||
|
||||
if (Strings.isNullOrEmpty(property.dataFormat)) {
|
||||
property.dataType = bestFittingIntegerType(minimum,
|
||||
property.getExclusiveMinimum(),
|
||||
maximum,
|
||||
property.getExclusiveMaximum(),
|
||||
true);
|
||||
} else {
|
||||
switch (property.dataFormat) {
|
||||
// custom integer formats (legacy)
|
||||
case "uint32":
|
||||
property.dataType = "u32";
|
||||
break;
|
||||
case "uint64":
|
||||
property.dataType = "u64";
|
||||
break;
|
||||
case "int32":
|
||||
property.dataType = unsigned ? "u32" : "i32";
|
||||
break;
|
||||
case "int64":
|
||||
property.dataType = unsigned ? "u64" : "i64";
|
||||
break;
|
||||
default:
|
||||
LOGGER.warn("The integer format '{}' is not recognized and will be ignored.", property.dataFormat);
|
||||
property.dataType = bestFittingIntegerType(minimum,
|
||||
property.getExclusiveMinimum(),
|
||||
maximum,
|
||||
property.getExclusiveMaximum(),
|
||||
true);
|
||||
}
|
||||
}
|
||||
property.dataType = applyIntegerTypeFitting(
|
||||
property.dataFormat,
|
||||
property.getMinimum(),
|
||||
property.getMaximum(),
|
||||
property.getExclusiveMinimum(),
|
||||
property.getExclusiveMaximum());
|
||||
}
|
||||
|
||||
property.name = underscore(property.name);
|
||||
@@ -1580,6 +1594,17 @@ public class RustServerCodegen extends AbstractRustCodegen implements CodegenCon
|
||||
private void processParam(CodegenParameter param, CodegenOperation op) {
|
||||
String example = null;
|
||||
|
||||
// If a parameter is an integer, fit it into the right type.
|
||||
// Note: For CodegenParameter, baseType may be null, so we check isInteger/isLong/isShort flags instead.
|
||||
if (param.isInteger || param.isLong || param.isShort) {
|
||||
param.dataType = applyIntegerTypeFitting(
|
||||
param.dataFormat,
|
||||
param.minimum,
|
||||
param.maximum,
|
||||
param.exclusiveMinimum,
|
||||
param.exclusiveMaximum);
|
||||
}
|
||||
|
||||
// If a parameter uses UUIDs, we need to import the UUID package.
|
||||
if (uuidType.equals(param.dataType)) {
|
||||
additionalProperties.put("apiUsesUuid", true);
|
||||
|
||||
@@ -276,7 +276,7 @@ public class SpringCodegen extends AbstractJavaCodegen
|
||||
"Use `equalsIgnoreCase` when String for enum comparison",
|
||||
useEnumCaseInsensitive));
|
||||
cliOptions.add(CliOption.newBoolean(USE_SPRING_BOOT3,
|
||||
"Generate code and provide dependencies for use with Spring Boot 3.x. (Use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.",
|
||||
"Generate code and provide dependencies for use with Spring Boot ≥ 3 (use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.",
|
||||
useSpringBoot3));
|
||||
cliOptions.add(CliOption.newBoolean(GENERATE_CONSTRUCTOR_WITH_REQUIRED_ARGS,
|
||||
"Whether to generate constructors with required args for models",
|
||||
|
||||
@@ -134,7 +134,7 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
this.useOneOfInterfaces = true;
|
||||
|
||||
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
|
||||
.stability(Stability.STABLE)
|
||||
.stability(Stability.DEPRECATED)
|
||||
.build();
|
||||
|
||||
outputFolder = "generated-code" + File.separator + "swift";
|
||||
@@ -430,6 +430,8 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
public void processOpts() {
|
||||
super.processOpts();
|
||||
|
||||
LOGGER.warn("IMPORTANT: This generator has been deprecated. Please use `swift6` instead");
|
||||
|
||||
if (StringUtils.isEmpty(System.getenv("SWIFT_POST_PROCESS_FILE"))) {
|
||||
LOGGER.info("Environment variable SWIFT_POST_PROCESS_FILE not defined so the Swift code may not be properly formatted. To define it, try 'export SWIFT_POST_PROCESS_FILE=/usr/local/bin/swiftformat' (Linux/Mac)");
|
||||
LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI).");
|
||||
|
||||
@@ -491,6 +491,9 @@ public class Swift6ClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
additionalProperties.put(RESPONSE_AS, responseAs);
|
||||
if (ArrayUtils.contains(responseAs, RESPONSE_LIBRARY_PROMISE_KIT)) {
|
||||
additionalProperties.put("usePromiseKit", true);
|
||||
LOGGER.warn("NOTICE: We are considering deprecating PromiseKit support in the Swift 6 generator. " +
|
||||
"If you are still using it, please share your use case here: " +
|
||||
"https://github.com/OpenAPITools/openapi-generator/issues/22791");
|
||||
}
|
||||
if (ArrayUtils.contains(responseAs, RESPONSE_LIBRARY_RX_SWIFT)) {
|
||||
additionalProperties.put("useRxSwift", true);
|
||||
|
||||
@@ -235,7 +235,7 @@ public class URLPathUtils {
|
||||
public static boolean isRelativeUrl(List<Server> servers) {
|
||||
if (servers != null && servers.size() > 0) {
|
||||
final Server firstServer = servers.get(0);
|
||||
return Pattern.matches("^(\\/[\\w\\d]+)+", firstServer.getUrl());
|
||||
return Pattern.matches("^(\\/[\\w\\d.~@-]+)+", firstServer.getUrl());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
34
modules/openapi-generator/src/main/resources/Java/additional_properties.mustache
vendored
Normal file
34
modules/openapi-generator/src/main/resources/Java/additional_properties.mustache
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
{{#jackson}}
|
||||
{{#additionalPropertiesType}}
|
||||
/**
|
||||
* Set the additional (undeclared) property with the specified name and value.
|
||||
* Creates the property if it does not already exist, otherwise replaces it.
|
||||
* @param key the name of the property
|
||||
* @param value the value of the property
|
||||
* @return self reference
|
||||
*/
|
||||
@JsonAnySetter
|
||||
public {{classname}} putAdditionalProperty(String key, {{{.}}} value) {
|
||||
this.put(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the additional (undeclared) properties.
|
||||
* @return the additional (undeclared) properties
|
||||
*/
|
||||
@JsonAnyGetter
|
||||
public Map<String, {{{.}}}> getAdditionalProperties() {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the additional (undeclared) property with the specified name.
|
||||
* @param key the name of the property
|
||||
* @return the additional (undeclared) property with the specified name
|
||||
*/
|
||||
public {{{.}}} getAdditionalProperty(String key) {
|
||||
return this.get(key);
|
||||
}
|
||||
{{/additionalPropertiesType}}
|
||||
{{/jackson}}
|
||||
@@ -311,7 +311,7 @@
|
||||
{{/useJakartaEe}}
|
||||
<threetenbp-version>2.9.10</threetenbp-version>
|
||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||
<assertj-version>3.23.1</assertj-version>
|
||||
<assertj-version>3.27.7</assertj-version>
|
||||
<junit-version>5.10.2</junit-version>
|
||||
</properties>
|
||||
</project>
|
||||
|
||||
@@ -784,9 +784,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||
break;
|
||||
} catch (HttpServerErrorException | HttpClientErrorException ex) {
|
||||
if (ex instanceof HttpServerErrorException
|
||||
|| ((HttpClientErrorException) ex)
|
||||
.getStatusCode()
|
||||
.equals(HttpStatus.TOO_MANY_REQUESTS)) {
|
||||
|| ex.getStatusCode().equals(HttpStatus.TOO_MANY_REQUESTS)) {
|
||||
attempts++;
|
||||
if (attempts < maxAttemptsForRetry) {
|
||||
try {
|
||||
|
||||
@@ -17,6 +17,17 @@ import java.io.Serializable;
|
||||
{{#jackson}}
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
{{#models}}
|
||||
{{#model}}
|
||||
{{#additionalPropertiesType}}
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonAnySetter;
|
||||
import com.fasterxml.jackson.annotation.JsonAnyGetter;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
{{/additionalPropertiesType}}
|
||||
{{/model}}
|
||||
{{/models}}
|
||||
{{#withXml}}
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.*;
|
||||
{{/withXml}}
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
@JsonTypeName("{{name}}")
|
||||
{{/hasDiscriminatorWithNonEmptyMapping}}
|
||||
{{/isClassnameSanitized}}
|
||||
{{#additionalPropertiesType}}
|
||||
@JsonFormat(shape=JsonFormat.Shape.OBJECT)
|
||||
{{/additionalPropertiesType}}
|
||||
{{/jackson}}
|
||||
{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}}
|
||||
{{#vendorExtensions.x-class-extra-annotation}}
|
||||
@@ -281,6 +284,8 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
{{/isReadOnly}}
|
||||
|
||||
{{/vars}}
|
||||
{{>additional_properties}}
|
||||
|
||||
{{#parent}}
|
||||
{{#readWriteVars}}
|
||||
{{#isOverridden}}
|
||||
|
||||
@@ -220,7 +220,7 @@ for this project used jakarta.validation-api -->
|
||||
<swagger-core-version>1.5.22</swagger-core-version>
|
||||
<jetty-version>9.2.9.v20150224</jetty-version>
|
||||
<junit-version>4.13.2</junit-version>
|
||||
<logback-version>1.5.19</logback-version>
|
||||
<logback-version>1.5.25</logback-version>
|
||||
{{#useBeanValidation}}
|
||||
<beanvalidation-version>2.0.2</beanvalidation-version>
|
||||
{{/useBeanValidation}}
|
||||
|
||||
@@ -342,7 +342,7 @@ for this project used jakarta.validation-api -->
|
||||
{{/generateSpringApplication}}
|
||||
{{^generateSpringBootApplication}}
|
||||
<junit-version>4.13.2</junit-version>
|
||||
<logback-version>1.5.19</logback-version>
|
||||
<logback-version>1.5.25</logback-version>
|
||||
{{/generateSpringBootApplication}}
|
||||
<cxf-version>3.5.9</cxf-version>
|
||||
<jackson-jaxrs-version>2.17.1</jackson-jaxrs-version>
|
||||
|
||||
@@ -255,7 +255,7 @@ for this project used jakarta.validation-api -->
|
||||
{{/swagger2AnnotationLibrary}}
|
||||
<jetty-version>9.2.9.v20150224</jetty-version>
|
||||
<junit-version>4.13.2</junit-version>
|
||||
<logback-version>1.5.19</logback-version>
|
||||
<logback-version>1.5.25</logback-version>
|
||||
{{#useBeanValidation}}
|
||||
<beanvalidation-version>2.0.2</beanvalidation-version>
|
||||
{{/useBeanValidation}}
|
||||
|
||||
@@ -311,7 +311,7 @@ for this project used jakarta.validation-api -->
|
||||
{{/swagger2AnnotationLibrary}}
|
||||
<jetty-version>9.2.9.v20150224</jetty-version>
|
||||
<junit-version>4.13.2</junit-version>
|
||||
<logback-version>1.5.19</logback-version>
|
||||
<logback-version>1.5.25</logback-version>
|
||||
{{#useBeanValidation}}
|
||||
<beanvalidation-version>2.0.2</beanvalidation-version>
|
||||
{{/useBeanValidation}}
|
||||
|
||||
@@ -222,7 +222,7 @@
|
||||
<jersey3-version>3.1.3</jersey3-version>
|
||||
<jackson-version>2.17.1</jackson-version>
|
||||
<junit-version>4.13.2</junit-version>
|
||||
<logback-version>1.5.19</logback-version>
|
||||
<logback-version>1.5.25</logback-version>
|
||||
<servlet-api-version>5.0.0</servlet-api-version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
@@ -222,7 +222,7 @@ for this project used jakarta.validation-api -->
|
||||
<jersey2-version>2.35</jersey2-version>
|
||||
<jackson-version>2.17.1</jackson-version>
|
||||
<junit-version>4.13.2</junit-version>
|
||||
<logback-version>1.5.19</logback-version>
|
||||
<logback-version>1.5.25</logback-version>
|
||||
<servlet-api-version>4.0.4</servlet-api-version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
32
modules/openapi-generator/src/main/resources/JavaJaxRS/spec/additional_properties.mustache
vendored
Normal file
32
modules/openapi-generator/src/main/resources/JavaJaxRS/spec/additional_properties.mustache
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
{{#additionalProperties}}
|
||||
/**
|
||||
* Set the additional (undeclared) property with the specified name and value.
|
||||
* Creates the property if it does not already exist, otherwise replaces it.
|
||||
* @param key the name of the property
|
||||
* @param value the value of the property
|
||||
* @return self reference
|
||||
*/
|
||||
@JsonAnySetter
|
||||
public {{classname}} putAdditionalProperty(String key, {{{datatypeWithEnum}}} value) {
|
||||
this.put(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the additional (undeclared) properties.
|
||||
* @return the additional (undeclared) properties
|
||||
*/
|
||||
@JsonAnyGetter
|
||||
public Map<String, {{{datatypeWithEnum}}}> getAdditionalProperties() {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the additional (undeclared) property with the specified name.
|
||||
* @param key the name of the property
|
||||
* @return the additional (undeclared) property with the specified name
|
||||
*/
|
||||
public {{{datatypeWithEnum}}} getAdditionalProperty(String key) {
|
||||
return this.get(key);
|
||||
}
|
||||
{{/additionalProperties}}
|
||||
@@ -6,6 +6,8 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
||||
/**
|
||||
* {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}}
|
||||
*/
|
||||
{{>generatedAnnotation}}
|
||||
|
||||
{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} {
|
||||
{{#gson}}
|
||||
{{#allowableValues}}{{#enumVars}}
|
||||
|
||||
@@ -10,6 +10,13 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
{{#additionalProperties}}
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonAnySetter;
|
||||
import com.fasterxml.jackson.annotation.JsonAnyGetter;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
{{/additionalProperties}}
|
||||
{{/jackson}}
|
||||
{{#openApiNullable}}
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
@@ -30,7 +37,12 @@ import {{javaxPackage}}.xml.bind.annotation.XmlEnumValue;
|
||||
{{#useSwaggerAnnotations}}{{#description}}@ApiModel(description = "{{{.}}}"){{/description}}{{/useSwaggerAnnotations}}{{#useSwaggerV3Annotations}}
|
||||
@Schema({{#title}}title="{{{.}}}", {{/title}}{{#description}}description="{{{.}}}"{{/description}}{{^description}}description=""{{/description}}){{/useSwaggerV3Annotations}}{{#useMicroProfileOpenAPIAnnotations}}
|
||||
@org.eclipse.microprofile.openapi.annotations.media.Schema({{#title}}title="{{{.}}}", {{/title}}{{#description}}description="{{{.}}}"{{/description}}{{^description}}description=""{{/description}}){{/useMicroProfileOpenAPIAnnotations}}
|
||||
{{#jackson}}@JsonTypeName("{{name}}"){{/jackson}}
|
||||
{{#jackson}}
|
||||
@JsonTypeName("{{name}}")
|
||||
{{#additionalProperties}}
|
||||
@JsonFormat(shape=JsonFormat.Shape.OBJECT)
|
||||
{{/additionalProperties}}
|
||||
{{/jackson}}
|
||||
{{>generatedAnnotation}}{{>additionalModelTypeAnnotations}}{{>xmlPojoAnnotation}}
|
||||
{{#vendorExtensions.x-class-extra-annotation}}
|
||||
{{{vendorExtensions.x-class-extra-annotation}}}
|
||||
@@ -196,6 +208,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
|
||||
}
|
||||
{{/isMap}}
|
||||
{{/vars}}
|
||||
{{>additional_properties}}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -133,6 +133,13 @@ If your endpoint has multiple server objects in the servers array, you can set t
|
||||
void setServerIndex(const QString &operation, int serverIndex);
|
||||
```
|
||||
Parameter "operation" should be your operationid. "serverIndex" is the index you want to set as your default server. The function will check if there is a server with your index.
|
||||
|
||||
Alternatively, to set the server index globally for all operations:
|
||||
```c++
|
||||
void setServerIndex(int serverIndex);
|
||||
```
|
||||
This will apply the specified server index to all operations in the API.
|
||||
|
||||
Here is an example of multiple servers in the servers array. The first server will have index 0 and the second will have index 1.
|
||||
```yaml
|
||||
servers:
|
||||
|
||||
@@ -57,9 +57,9 @@ void {{classname}}::initializeServerConfigs() {
|
||||
}
|
||||
|
||||
/**
|
||||
* returns 0 on success and -1, -2 or -3 on failure.
|
||||
* -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found
|
||||
*/
|
||||
* returns 0 on success and -1, -2 or -3 on failure.
|
||||
* -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found
|
||||
*/
|
||||
int {{classname}}::setDefaultServerValue(int serverIndex, const QString &operation, const QString &variable, const QString &value) {
|
||||
auto it = _serverConfigs.find(operation);
|
||||
if (it != _serverConfigs.end() && serverIndex < it.value().size()) {
|
||||
@@ -67,12 +67,24 @@ int {{classname}}::setDefaultServerValue(int serverIndex, const QString &operati
|
||||
}
|
||||
return -3;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the server index.
|
||||
* @param operation The id to the target operation.
|
||||
* @param serverIndex The server index.
|
||||
*/
|
||||
void {{classname}}::setServerIndex(const QString &operation, int serverIndex) {
|
||||
if (_serverIndices.contains(operation) && serverIndex < _serverConfigs.find(operation).value().size()) {
|
||||
_serverIndices[operation] = serverIndex;
|
||||
}
|
||||
}
|
||||
|
||||
void {{classname}}::setServerIndex(int serverIndex) {
|
||||
for (auto keyIt = _serverIndices.keyBegin(); keyIt != _serverIndices.keyEnd(); keyIt++) {
|
||||
setServerIndex(*keyIt, serverIndex);
|
||||
}
|
||||
}
|
||||
|
||||
void {{classname}}::setApiKey(const QString &apiKeyName, const QString &apiKey) {
|
||||
_apiKeys.insert(apiKeyName, apiKey);
|
||||
}
|
||||
@@ -103,13 +115,13 @@ void {{classname}}::setNetworkAccessManager(QNetworkAccessManager* manager) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a new ServerConfiguration to the config map for a specific operation.
|
||||
* @param operation The id to the target operation.
|
||||
* @param url A string that contains the URL of the server
|
||||
* @param description A String that describes the server
|
||||
* @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template.
|
||||
* returns the index of the new server config on success and -1 if the operation is not found
|
||||
*/
|
||||
* Appends a new ServerConfiguration to the config map for a specific operation.
|
||||
* @param operation The id to the target operation.
|
||||
* @param url A string that contains the URL of the server
|
||||
* @param description A String that describes the server
|
||||
* @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template.
|
||||
* returns the index of the new server config on success and -1 if the operation is not found
|
||||
*/
|
||||
int {{classname}}::addServerConfiguration(const QString &operation, const QUrl &url, const QString &description, const QMap<QString, {{prefix}}ServerVariable> &variables) {
|
||||
if (_serverConfigs.contains(operation)) {
|
||||
_serverConfigs[operation].append({{prefix}}ServerConfiguration(
|
||||
@@ -123,11 +135,11 @@ int {{classname}}::addServerConfiguration(const QString &operation, const QUrl &
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a new ServerConfiguration to the config map for a all operations and sets the index to that server.
|
||||
* @param url A string that contains the URL of the server
|
||||
* @param description A String that describes the server
|
||||
* @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template.
|
||||
*/
|
||||
* Appends a new ServerConfiguration to the config map for a all operations and sets the index to that server.
|
||||
* @param url A string that contains the URL of the server
|
||||
* @param description A String that describes the server
|
||||
* @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template.
|
||||
*/
|
||||
void {{classname}}::setNewServerForAllOperations(const QUrl &url, const QString &description, const QMap<QString, {{prefix}}ServerVariable> &variables) {
|
||||
for (auto keyIt = _serverIndices.keyBegin(); keyIt != _serverIndices.keyEnd(); keyIt++) {
|
||||
setServerIndex(*keyIt, addServerConfiguration(*keyIt, url, description, variables));
|
||||
@@ -135,11 +147,11 @@ void {{classname}}::setNewServerForAllOperations(const QUrl &url, const QString
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a new ServerConfiguration to the config map for an operations and sets the index to that server.
|
||||
* @param URL A string that contains the URL of the server
|
||||
* @param description A String that describes the server
|
||||
* @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template.
|
||||
*/
|
||||
* Appends a new ServerConfiguration to the config map for an operations and sets the index to that server.
|
||||
* @param URL A string that contains the URL of the server
|
||||
* @param description A String that describes the server
|
||||
* @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template.
|
||||
*/
|
||||
void {{classname}}::setNewServer(const QString &operation, const QUrl &url, const QString &description, const QMap<QString, {{prefix}}ServerVariable> &variables) {
|
||||
setServerIndex(operation, addServerConfiguration(operation, url, description, variables));
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ public:
|
||||
void initializeServerConfigs();
|
||||
int setDefaultServerValue(int serverIndex,const QString &operation, const QString &variable,const QString &val);
|
||||
void setServerIndex(const QString &operation, int serverIndex);
|
||||
void setServerIndex(int serverIndex);
|
||||
void setApiKey(const QString &apiKeyName, const QString &apiKey);
|
||||
void setBearerToken(const QString &token);
|
||||
void setUsername(const QString &username);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{{>partial_header}}
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{{>partial_header}}
|
||||
using System;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using {{packageName}}.{{apiPackage}};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// <auto-generated>
|
||||
{{partial_header}}
|
||||
{{>partial_header}}
|
||||
|
||||
{{#nrt}}
|
||||
#nullable enable
|
||||
|
||||
@@ -53,4 +54,4 @@ namespace {{packageName}}.{{clientPackage}}
|
||||
parseQueryString[ClientUtils.ApiKeyHeaderToString(Header)] = Uri.EscapeDataString(_raw).ToString(){{nrt!}};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{{>partial_header}}
|
||||
using System;
|
||||
|
||||
namespace {{packageName}}.{{clientPackage}}
|
||||
|
||||
@@ -49,6 +49,11 @@ namespace {{packageName}}.{{clientPackage}}
|
||||
/// </summary>
|
||||
System.Net.Http.Headers.HttpResponseHeaders Headers { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The headers contained in the api response related to the content
|
||||
/// </summary>
|
||||
System.Net.Http.Headers.HttpContentHeaders ContentHeaders { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The path used when making the request.
|
||||
/// </summary>
|
||||
@@ -106,6 +111,11 @@ namespace {{packageName}}.{{clientPackage}}
|
||||
/// </summary>
|
||||
public System.Net.Http.Headers.HttpResponseHeaders Headers { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The headers contained in the api response related to the content
|
||||
/// </summary>
|
||||
public System.Net.Http.Headers.HttpContentHeaders ContentHeaders { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The DateTime when the request was retrieved.
|
||||
/// </summary>
|
||||
@@ -144,6 +154,7 @@ namespace {{packageName}}.{{clientPackage}}
|
||||
{
|
||||
StatusCode = httpResponseMessage.StatusCode;
|
||||
Headers = httpResponseMessage.Headers;
|
||||
ContentHeaders = httpResponseMessage.Content.Headers;
|
||||
IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode;
|
||||
ReasonPhrase = httpResponseMessage.ReasonPhrase;
|
||||
RawContent = rawContent;
|
||||
@@ -167,6 +178,7 @@ namespace {{packageName}}.{{clientPackage}}
|
||||
{
|
||||
StatusCode = httpResponseMessage.StatusCode;
|
||||
Headers = httpResponseMessage.Headers;
|
||||
ContentHeaders = httpResponseMessage.Content.Headers;
|
||||
IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode;
|
||||
ReasonPhrase = httpResponseMessage.ReasonPhrase;
|
||||
ContentStream = contentStream;
|
||||
@@ -178,6 +190,7 @@ namespace {{packageName}}.{{clientPackage}}
|
||||
OnCreated(httpRequestMessage, httpResponseMessage);
|
||||
}
|
||||
|
||||
|
||||
partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage);
|
||||
}
|
||||
{{#x-http-statuses-with-return}}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// <auto-generated>
|
||||
{{partial_header}}
|
||||
{{>partial_header}}
|
||||
|
||||
{{#nrt}}
|
||||
#nullable enable
|
||||
|
||||
@@ -43,4 +44,4 @@ namespace {{packageName}}.{{clientPackage}}
|
||||
request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", {{packageName}}.Client.ClientUtils.Base64Encode(_username + ":" + _password));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// <auto-generated>
|
||||
{{partial_header}}
|
||||
{{>partial_header}}
|
||||
|
||||
{{#nrt}}
|
||||
#nullable enable
|
||||
|
||||
@@ -38,4 +39,4 @@ namespace {{packageName}}.{{clientPackage}}
|
||||
request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _raw);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ using {{packageName}}.{{modelPackage}};
|
||||
{{/-first}}
|
||||
{{/models}}
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Net.Http.Headers;
|
||||
|
||||
{{>Assembly}}namespace {{packageName}}.{{clientPackage}}
|
||||
{
|
||||
@@ -311,6 +312,36 @@ using System.Runtime.CompilerServices;
|
||||
return string.Join(",", accepts);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Select the Accept header's value from the given accepts array:
|
||||
/// if JSON exists in the given array, use it;
|
||||
/// otherwise use all of them.
|
||||
/// </summary>
|
||||
/// <param name="accepts">The accepts array to select from.</param>
|
||||
/// <returns>The Accept header values to use.</returns>
|
||||
public static IEnumerable<MediaTypeWithQualityHeaderValue> SelectHeaderAcceptArray(string[] accepts)
|
||||
{
|
||||
if (accepts.Length == 0)
|
||||
{{#net80OrLater}}
|
||||
return [];
|
||||
{{/net80OrLater}}
|
||||
{{^net80OrLater}}
|
||||
return Enumerable.Empty<MediaTypeWithQualityHeaderValue>();
|
||||
{{/net80OrLater}}
|
||||
|
||||
if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase))
|
||||
{{#net80OrLater}}
|
||||
return [MediaTypeWithQualityHeaderValue.Parse("application/json")];
|
||||
{{/net80OrLater}}
|
||||
{{^net80OrLater}}
|
||||
return new [] { MediaTypeWithQualityHeaderValue.Parse("application/json") };
|
||||
{{/net80OrLater}}
|
||||
|
||||
return accepts.Select(MediaTypeWithQualityHeaderValue.Parse);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provides a case-insensitive check that a provided content type is a known JSON-like content type.
|
||||
/// </summary>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user