Compare commits

..

17 Commits

Author SHA1 Message Date
William Cheng
ff400e9a31 v7.19.0 release (#22732)
* v7.19.0 release

* update mill test
2026-01-19 18:06:38 +08:00
Xi Lu
24242be595 [Protobuf] Improve oneOf Handling by Unwrapping allOf for Complex Types (#22700)
* Improve Protobuf Generator's oneOf Handling allOf Unwrapping with Complex Types

* Address cubic-dev-ai comment
2026-01-19 17:00:31 +08:00
Daniel
502565b317 [java][jackson] fix: conditionally add jackson JsonIgnoreProperties for base class polymorphism fixes #12777 #22527 (#22528)
* fix: conditionally add jackson JsonIgnoreProperties for base class polymorphism

* fix: rename flag

* fix: rename flag

* fix: remove newline

* fix: regenerate example models

* fix: regenerate
2026-01-19 16:57:38 +08:00
Ilya Nemtsev
f355dc4c5c [Java][Native] Fix request compression (#22688)
* fix request compression

* fix edge case

* regenerated samples
2026-01-19 16:37:22 +08:00
William Cheng
73c9c1cbe5 update vertx to newer version in kotlin vertx server (#22731) 2026-01-19 15:09:24 +08:00
dependabot[bot]
9f62822de7 build(deps-dev): bump tar (#22724)
Bumps [tar](https://github.com/isaacs/node-tar) from 7.5.2 to 7.5.3.
- [Release notes](https://github.com/isaacs/node-tar/releases)
- [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/isaacs/node-tar/compare/v7.5.2...v7.5.3)

---
updated-dependencies:
- dependency-name: tar
  dependency-version: 7.5.3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-19 14:01:52 +08:00
dependabot[bot]
2b67b00996 build(deps): bump tar and @angular/cli (#22730)
Bumps [tar](https://github.com/isaacs/node-tar) to 7.5.3 and updates ancestor dependency [@angular/cli](https://github.com/angular/angular-cli). These dependencies need to be updated together.


Updates `tar` from 7.5.1 to 7.5.3
- [Release notes](https://github.com/isaacs/node-tar/releases)
- [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/isaacs/node-tar/compare/v7.5.1...v7.5.3)

Updates `@angular/cli` from 19.2.17 to 21.1.0
- [Release notes](https://github.com/angular/angular-cli/releases)
- [Changelog](https://github.com/angular/angular-cli/blob/main/CHANGELOG.md)
- [Commits](https://github.com/angular/angular-cli/compare/19.2.17...v21.1.0)

---
updated-dependencies:
- dependency-name: tar
  dependency-version: 7.5.3
  dependency-type: indirect
- dependency-name: "@angular/cli"
  dependency-version: 21.1.0
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-19 13:59:10 +08:00
William Cheng
4559cad6db update parser to newer version (#22729) 2026-01-19 13:22:01 +08:00
Thomas Faller
28904f850f Fix DevContainer by switching from moby to docker (#22725) 2026-01-19 12:56:27 +08:00
William Cheng
84692d8155 Revert "[kotlin] fix query parameter encoding (#22512)" (#22727)
This reverts commit a3d03bad09.
2026-01-19 12:44:04 +08:00
dependabot[bot]
f78c465bdd build(deps): bump @angular/compiler (#22659)
Bumps [@angular/compiler](https://github.com/angular/angular/tree/HEAD/packages/compiler) from 19.2.17 to 19.2.18.
- [Release notes](https://github.com/angular/angular/releases)
- [Changelog](https://github.com/angular/angular/blob/main/CHANGELOG.md)
- [Commits](https://github.com/angular/angular/commits/v19.2.18/packages/compiler)

---
updated-dependencies:
- dependency-name: "@angular/compiler"
  dependency-version: 19.2.18
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-18 17:42:54 +08:00
Marc Schlegel
60e3e405a5 Integrated example project for Mill into CI task (#22702)
* Integrated example project for Mill into CI task

The example project uses Mills meta-build to resolve the snapshot version from a properties file.
The properties-file is now integrated into `release_version_update.sh`.

* Add coursier cache to actions-cache

* Split Mill tests into separate steps

* try to exclude problematic dependencies from maven-cache so they are downloaded by coursier

* clear m2-cache prior to mill execution
2026-01-18 14:10:07 +08:00
dependabot[bot]
7f96a4a0a3 build(deps): bump tar and @angular/cli (#22720)
Bumps [tar](https://github.com/isaacs/node-tar) to 7.5.3 and updates ancestor dependency [@angular/cli](https://github.com/angular/angular-cli). These dependencies need to be updated together.


Updates `tar` from 7.5.1 to 7.5.3
- [Release notes](https://github.com/isaacs/node-tar/releases)
- [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/isaacs/node-tar/compare/v7.5.1...v7.5.3)

Updates `@angular/cli` from 20.3.13 to 21.1.0
- [Release notes](https://github.com/angular/angular-cli/releases)
- [Changelog](https://github.com/angular/angular-cli/blob/main/CHANGELOG.md)
- [Commits](https://github.com/angular/angular-cli/compare/20.3.13...v21.1.0)

---
updated-dependencies:
- dependency-name: tar
  dependency-version: 7.5.3
  dependency-type: indirect
- dependency-name: "@angular/cli"
  dependency-version: 21.1.0
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-18 14:08:29 +08:00
Matt Pollock
396c4c61eb [R] fix error handling in the R client (#22704)
* fix error handling in the R client

* adjust logic for avoiding logical vectors in a conditional statement
2026-01-18 13:16:33 +08:00
Matt Pollock
428d483f1e [R] fix set[object] deserialization (#22697)
* unpack dataframes within a list

* handle set/array

* update httr2 client
2026-01-18 12:56:17 +08:00
Matt Pollock
10d5aa7f56 [R] remove nuisance DUMMY_ENUM warning (#22692)
* drop nuisance warning

* update samples
2026-01-18 12:41:40 +08:00
William Cheng
756bed0be0 Add more R samples for testing (#22718)
* add more R samples for testing

* update tests

* update tests

* update tests
2026-01-18 12:29:44 +08:00
104 changed files with 5538 additions and 2544 deletions

View File

@@ -13,7 +13,7 @@
"ghcr.io/snebjorn/devcontainer-feature/chromium:latest": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "latest",
"moby": true
"moby": false
}
},
// Configure tool-specific properties.

View File

@@ -0,0 +1,69 @@
name: Mill plugin tests
on:
push:
paths:
- modules/openapi-generator-mill-plugin/**
pull_request:
paths:
- modules/openapi-generator-mill-plugin/**
jobs:
test:
name: Mill plugin tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 11
uses: actions/setup-java@v5
with:
java-version: 11
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
with:
path: |
~/.m2/repository
~/.gradle
~/.cache/coursier
!~/.gradle/caches/*/plugin-resolution/
!~/.m2/repository/org/openapitools/
!~/.cache/coursier/v1/https/repo1.maven.org/maven2/org/openapitools/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
- name: Maven Clean Install
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
run: |
./mvnw clean install -DskipTests -Dmaven.javadoc.skip=true
# This is needed because of differences in how Maven and Coursier download artifacts
# Maven will only download the pom when the transitive dependency is not needed in the current projects compile classpath
# whereas Coursier expects the artifact (jar) to be present in a Maven repository. When Coursier encounters a
# artifact folder with a pom it considers the artifact to be available and will then crash when the jar is missing.
- name: Clear m2 cache except openapitools (because otherwise coursier will fail to resolve artifacts where only poms are downloaded)
run: |
mv ~/.m2/repository/org/openapitools /tmp/openapitools-backup || true
rm -rf ~/.m2/repository/*
mkdir -p ~/.m2/repository/org
mv /tmp/openapitools-backup ~/.m2/repository/org/openapitools || true
- name: Mill Example - Test Validation Command
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
run: |
(cd modules/openapi-generator-mill-plugin/example/ && ./mill validateOpenapiSpec $(pwd)/api/petstore-invalid.yaml)
- name: Mill Example - Test Validation Task
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
run: |
(cd modules/openapi-generator-mill-plugin/example/ && ./mill openapi.validate)
- name: Mill Example - Test Compile Task
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
run: |
(cd modules/openapi-generator-mill-plugin/example/ && ./mill __.compile)

View File

@@ -7,3 +7,4 @@ additionalProperties:
artifactId: petstore-native-useGzipFeature
hideGenerationTimestamp: "true"
useJakartaEe: "true"
useGzipFeature: "true"

View File

@@ -93,6 +93,7 @@ declare -a xml_files=(
declare -a properties_files=(
"${root}/modules/openapi-generator-gradle-plugin/gradle.properties"
"${root}/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties"
"${root}/modules/openapi-generator-mill-plugin/example/mill-build/version.properties"
)
${cwd}/bump.sh -f ${version} -i ${inc} ${xml_files[@]}

View File

@@ -34,6 +34,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|disableDiscriminatorJsonIgnoreProperties|Ignore discriminator field type for Jackson serialization| |false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|

View File

@@ -49,6 +49,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|disableDiscriminatorJsonIgnoreProperties|Ignore discriminator field type for Jackson serialization| |false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|

View File

@@ -38,6 +38,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|disableDiscriminatorJsonIgnoreProperties|Ignore discriminator field type for Jackson serialization| |false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|

View File

@@ -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|
|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|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|

View File

@@ -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|
|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|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|

View File

@@ -36,6 +36,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|disableDiscriminatorJsonIgnoreProperties|Ignore discriminator field type for Jackson serialization| |false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|

View File

@@ -45,6 +45,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|disableDiscriminatorJsonIgnoreProperties|Ignore discriminator field type for Jackson serialization| |false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|

View File

@@ -40,6 +40,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|disableDiscriminatorJsonIgnoreProperties|Ignore discriminator field type for Jackson serialization| |false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|

View File

@@ -41,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|disableDiscriminatorJsonIgnoreProperties|Ignore discriminator field type for Jackson serialization| |false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|

View File

@@ -36,6 +36,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|disableDiscriminatorJsonIgnoreProperties|Ignore discriminator field type for Jackson serialization| |false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|

View File

@@ -37,6 +37,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|disableDiscriminatorJsonIgnoreProperties|Ignore discriminator field type for Jackson serialization| |false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|

View File

@@ -39,6 +39,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|disableDiscriminatorJsonIgnoreProperties|Ignore discriminator field type for Jackson serialization| |false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|

View File

@@ -36,6 +36,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|disableDiscriminatorJsonIgnoreProperties|Ignore discriminator field type for Jackson serialization| |false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|

View File

@@ -36,6 +36,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|disableDiscriminatorJsonIgnoreProperties|Ignore discriminator field type for Jackson serialization| |false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|

View File

@@ -36,6 +36,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|disableDiscriminatorJsonIgnoreProperties|Ignore discriminator field type for Jackson serialization| |false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|

View File

@@ -36,6 +36,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|disableDiscriminatorJsonIgnoreProperties|Ignore discriminator field type for Jackson serialization| |false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|

View File

@@ -41,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|disableDiscriminatorJsonIgnoreProperties|Ignore discriminator field type for Jackson serialization| |false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|

View File

@@ -36,6 +36,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|disableDiscriminatorJsonIgnoreProperties|Ignore discriminator field type for Jackson serialization| |false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|

View File

@@ -37,6 +37,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|disableDiscriminatorJsonIgnoreProperties|Ignore discriminator field type for Jackson serialization| |false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|

View File

@@ -38,6 +38,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|disableDiscriminatorJsonIgnoreProperties|Ignore discriminator field type for Jackson serialization| |false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|

View File

@@ -38,6 +38,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|disableDiscriminatorJsonIgnoreProperties|Ignore discriminator field type for Jackson serialization| |false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|

View File

@@ -36,6 +36,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|disableDiscriminatorJsonIgnoreProperties|Ignore discriminator field type for Jackson serialization| |false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|

View File

@@ -36,6 +36,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|disableDiscriminatorJsonIgnoreProperties|Ignore discriminator field type for Jackson serialization| |false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|

View File

@@ -36,6 +36,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|disableDiscriminatorJsonIgnoreProperties|Ignore discriminator field type for Jackson serialization| |false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|

View File

@@ -36,6 +36,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|disableDiscriminatorJsonIgnoreProperties|Ignore discriminator field type for Jackson serialization| |false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|

View File

@@ -42,6 +42,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
|disableDiscriminatorJsonIgnoreProperties|Ignore discriminator field type for Jackson serialization| |false|
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|

View File

@@ -4,7 +4,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<!-- RELEASE_VERSION -->
<version>7.19.0-SNAPSHOT</version>
<version>7.19.0</version>
<!-- /RELEASE_VERSION -->
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@@ -6,7 +6,7 @@
<artifactId>openapi-generator-project</artifactId>
<groupId>org.openapitools</groupId>
<!-- RELEASE_VERSION -->
<version>7.19.0-SNAPSHOT</version>
<version>7.19.0</version>
<!-- /RELEASE_VERSION -->
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@@ -1,5 +1,5 @@
# RELEASE_VERSION
openApiGeneratorVersion=7.19.0-SNAPSHOT
openApiGeneratorVersion=7.19.0
# /RELEASE_VERSION
# BEGIN placeholders

View File

@@ -4,7 +4,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<!-- RELEASE_VERSION -->
<version>7.19.0-SNAPSHOT</version>
<version>7.19.0</version>
<!-- /RELEASE_VERSION -->
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@@ -1,3 +1,3 @@
# RELEASE_VERSION
openApiGeneratorVersion=7.19.0-SNAPSHOT
openApiGeneratorVersion=7.19.0
# /RELEASE_VERSION

View File

@@ -13,7 +13,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.19.0-SNAPSHOT</version>
<version>7.19.0</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>

View File

@@ -15,7 +15,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.19.0-SNAPSHOT</version>
<version>7.19.0</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>

View File

@@ -19,7 +19,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.19.0-SNAPSHOT</version>
<version>7.19.0</version>
<!-- /RELEASE_VERSION -->
<dependencies>
<dependency>

View File

@@ -13,7 +13,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.19.0-SNAPSHOT</version>
<version>7.19.0</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>

View File

@@ -13,7 +13,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.19.0-SNAPSHOT</version>
<version>7.19.0</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>

View File

@@ -20,7 +20,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.19.0-SNAPSHOT</version>
<version>7.19.0</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>

View File

@@ -5,7 +5,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<!-- RELEASE_VERSION -->
<version>7.19.0-SNAPSHOT</version>
<version>7.19.0</version>
<!-- /RELEASE_VERSION -->
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@@ -1,7 +1,8 @@
//| mill-version: 1.0.6
//| mvnDeps:
//| - com.lihaoyi::mill-contrib-versionfile:$MILL_VERSION
//| - org.openapitools:openapi-generator-mill-plugin:$MILL_OPENAPITOOLS_PLUGIN_VERSION
//| # usually you would add the plugin dependency like the following,
//| # but for testing with SNAPSHOT versions, the plugin dependency is added in the meta-build
//| # mvnDeps:
//| # - org.openapitools:openapi-generator-mill-plugin:$MILL_OPENAPITOOLS_PLUGIN_VERSION
//|
package build
@@ -12,15 +13,12 @@ import mill.scalalib.publish.PomSettings
import mill.util.BuildInfo.{millBinPlatform, millVersion}
import javalib.*
import mill.contrib.versionfile.VersionFileModule
import org.openapitools.generator.mill.OpenApiModule
object `package` extends JavaModule with MavenModule with OpenApiModule {
// dependency on openapi-generator is set in Mills meta-build
// this is needed to point to a local maven repo
override def mvnDeps = Seq(
mvn"jakarta.platform:jakarta.jakartaee-api:11.0.0",
mvn"jakarta.platform:jakarta.jakartaee-api:10.0.0",
mvn"com.fasterxml.jackson.core:jackson-databind:2.20.0",
mvn"org.openapitools:jackson-databind-nullable:0.2.8"
)

View File

@@ -0,0 +1,36 @@
import coursier.LocalRepositories.Dangerous
import coursier.Repositories
import mill.scalalib.DepSyntax
import mill.*
import mill.api.Task
import mill.meta.MillBuildRootModule
import java.util.Properties
import java.io.FileInputStream
import scala.util.Using
object `package` extends MillBuildRootModule {
override def repositories = Task {
Seq(
// central needed for default deps
Repositories.central.root,
// the previously installed snapshot is in local maven
// see docs on Coursier, why m2 is considered dangerous
Dangerous.maven2Local.root)
}
def propsFile = Task.Source("version.properties")
def readOpenapiSnapshotVersion: Task[String] = Task {
val props = new Properties()
Using(new FileInputStream(propsFile().path.toIO)) { fis =>
props.load(fis)
props.getProperty("openApiGeneratorVersion")
}.get
}
override def mvnDeps = Seq(
mvn"org.openapitools:openapi-generator-mill-plugin:${readOpenapiSnapshotVersion()}"
)
}

View File

@@ -0,0 +1,3 @@
# RELEASE_VERSION
openApiGeneratorVersion=7.19.0
# /RELEASE_VERSION

View File

@@ -1,9 +0,0 @@
To test the Mill plugin, this project can be used.
> ![NOTE]
> The `mill-build` folder is only needed to look up the plugin from the local Maven repository for development purposes.
It requires that the current SNAPSHOT version of the plugin is installed in the local Maven repository.
Replace the version in `build.mill` or set the environment variable `$MILL_OPENAPITOOLS_PLUGIN_VERSION` to the desired version.
Run `./mill __.compile` to test if the plugin works or some of the modules tasks like `./mill openapi.validate`.

View File

@@ -1,17 +0,0 @@
import coursier.LocalRepositories.Dangerous
import coursier.Repositories
import mill.api.Task
import mill.meta.MillBuildRootModule
object `package` extends MillBuildRootModule {
override def repositories = Task {
Seq(
// central needed for default deps
Repositories.central.root,
// the previously installed snapshot is in local maven
// see docs on Coursier, why m2 is considered dangerous
Dangerous.maven2Local.root)
}
}

View File

@@ -1 +0,0 @@
7.16.0-SNAPSHOT

View File

@@ -4,7 +4,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<!-- RELEASE_VERSION -->
<version>7.19.0-SNAPSHOT</version>
<version>7.19.0</version>
<!-- /RELEASE_VERSION -->
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@@ -4,7 +4,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<!-- RELEASE_VERSION -->
<version>7.19.0-SNAPSHOT</version>
<version>7.19.0</version>
<!-- /RELEASE_VERSION -->
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@@ -4,7 +4,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<!-- RELEASE_VERSION -->
<version>7.19.0-SNAPSHOT</version>
<version>7.19.0</version>
<!-- /RELEASE_VERSION -->
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@@ -22,7 +22,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Sets;
import com.samskivert.mustache.Mustache;
import io.swagger.v3.oas.models.OpenAPI;
@@ -51,7 +50,6 @@ import org.openapitools.codegen.model.ModelMap;
import org.openapitools.codegen.model.ModelsMap;
import org.openapitools.codegen.model.OperationMap;
import org.openapitools.codegen.model.OperationsMap;
import org.openapitools.codegen.templating.mustache.ReplaceAllLambda;
import org.openapitools.codegen.utils.CamelizeOption;
import org.openapitools.codegen.utils.ModelUtils;
import org.slf4j.Logger;
@@ -103,6 +101,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
public static final String JAVAX_PACKAGE = "javaxPackage";
public static final String USE_JAKARTA_EE = "useJakartaEe";
public static final String CONTAINER_DEFAULT_TO_NULL = "containerDefaultToNull";
public static final String DISABLE_DISCRIMINATOR_JSON_IGNORE_PROPERTIES = "disableDiscriminatorJsonIgnoreProperties";
public static final String CAMEL_CASE_DOLLAR_SIGN = "camelCaseDollarSign";
public static final String USE_ONE_OF_INTERFACES = "useOneOfInterfaces";
@@ -199,6 +198,8 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
protected boolean jackson = false;
@Getter @Setter
protected boolean generateBuilders;
@Getter @Setter
protected boolean disableDiscriminatorJsonIgnoreProperties = false;
/**
* useBeanValidation has been moved from child generators to AbstractJavaCodegen.
* The reason is that getBeanValidation needs it
@@ -346,6 +347,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
cliOptions.add(CliOption.newBoolean(CONTAINER_DEFAULT_TO_NULL, "Set containers (array, set, map) default to null"));
cliOptions.add(CliOption.newBoolean(GENERATE_CONSTRUCTOR_WITH_ALL_ARGS, "whether to generate a constructor for all arguments").defaultValue(Boolean.FALSE.toString()));
cliOptions.add(CliOption.newBoolean(GENERATE_BUILDERS, "Whether to generate builders for models").defaultValue(Boolean.FALSE.toString()));
cliOptions.add(CliOption.newBoolean(DISABLE_DISCRIMINATOR_JSON_IGNORE_PROPERTIES, "Ignore discriminator field type for Jackson serialization", disableDiscriminatorJsonIgnoreProperties));
cliOptions.add(CliOption.newString(CodegenConstants.PARENT_GROUP_ID, CodegenConstants.PARENT_GROUP_ID_DESC));
cliOptions.add(CliOption.newString(CodegenConstants.PARENT_ARTIFACT_ID, CodegenConstants.PARENT_ARTIFACT_ID_DESC));
@@ -425,6 +427,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
convertPropertyToBooleanAndWriteBack(GENERATE_CONSTRUCTOR_WITH_ALL_ARGS, this::setGenerateConstructorWithAllArgs);
convertPropertyToBooleanAndWriteBack(GENERATE_BUILDERS, this::setGenerateBuilders);
convertPropertyToBooleanAndWriteBack(DISABLE_DISCRIMINATOR_JSON_IGNORE_PROPERTIES, this::setDisableDiscriminatorJsonIgnoreProperties);
if (StringUtils.isEmpty(System.getenv("JAVA_POST_PROCESS_FILE"))) {
LOGGER.info("Environment variable JAVA_POST_PROCESS_FILE not defined so the Java code may not be properly formatted. To define it, try 'export JAVA_POST_PROCESS_FILE=\"/usr/local/bin/clang-format -i\"' (Linux/Mac)");
LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI).");

View File

@@ -152,6 +152,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
@Setter protected boolean supportVertxFuture = false;
@Setter protected boolean useSealedOneOfInterfaces = false;
@Setter protected boolean useUnaryInterceptor = false;
protected String authFolder;
/**
* Serialization library.

View File

@@ -442,7 +442,19 @@ public class ProtobufSchemaCodegen extends DefaultCodegen implements CodegenConf
List<Schema> oneOfs = schema.getOneOf();
List<Schema> newOneOfs = new ArrayList<>();
for (Schema oneOf : oneOfs) {
Schema oneOfSchema = ModelUtils.getReferencedSchema(openAPI, oneOf);
Schema oneOfSchema = oneOf;
if (ModelUtils.isAllOf(oneOf) && oneOf.getAllOf() != null && oneOf.getAllOf().size() == 1) {
Object allOfObj = oneOf.getAllOf().get(0);
if (allOfObj instanceof Schema) {
Schema allOfItem = (Schema) allOfObj;
if (StringUtils.isNotEmpty(allOfItem.get$ref())) {
oneOfSchema = ModelUtils.getReferencedSchema(openAPI, allOfItem);
}
}
} else {
oneOfSchema = ModelUtils.getReferencedSchema(openAPI, oneOf);
}
if (ModelUtils.isArraySchema(oneOfSchema)) {
Schema innerSchema = generateNestedSchema(oneOfSchema, visitedSchemas);
innerSchema.setTitle(oneOf.getTitle());

View File

@@ -489,7 +489,7 @@ public class ApiClient {
if (encoding.isPresent()) {
for (String token : encoding.get().split(",")) {
if ("gzip".equalsIgnoreCase(token.trim())) {
return new GZIPInputStream(body);
return new GZIPInputStream(body, 8192);
}
}
}
@@ -531,9 +531,9 @@ public class ApiClient {
}
private boolean fillBuffer() throws IOException {
ensureInitialized();
while (chunkPosition >= currentChunk.length) {
buffer.reset();
ensureInitialized();
if (finished) {
return false;
}
@@ -570,6 +570,9 @@ public class ApiClient {
@Override
public int read(byte[] b, int off, int len) throws IOException {
if (len == 0) {
return 0;
}
if (!fillBuffer()) {
return -1;
}

View File

@@ -1,9 +1,10 @@
{{#jackson}}
{{^disableDiscriminatorJsonIgnoreProperties}}
@JsonIgnoreProperties(
value = "{{{discriminator.propertyBaseName}}}", // ignore manually set {{{discriminator.propertyBaseName}}}, it will be automatically generated by Jackson during serialization
allowSetters = true // allows the {{{discriminator.propertyBaseName}}} to be set during deserialization
)
){{/disableDiscriminatorJsonIgnoreProperties}}
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{{discriminator.propertyBaseName}}}", visible = true)
{{#discriminator.mappedModels}}
{{#-first}}

View File

@@ -4,9 +4,8 @@ import org.springframework.core.ParameterizedTypeReference
import org.springframework.http.HttpHeaders
import org.springframework.http.HttpMethod
import org.springframework.http.MediaType
import org.springframework.http.ResponseEntity
import org.springframework.web.client.RestClient
import org.springframework.web.util.UriComponentsBuilder
import org.springframework.http.ResponseEntity
import org.springframework.util.LinkedMultiValueMap
{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}open class ApiClient(protected val client: RestClient) {
@@ -36,13 +35,12 @@ import org.springframework.util.LinkedMultiValueMap
private fun <I> RestClient.method(requestConfig: RequestConfig<I>)=
method(HttpMethod.valueOf(requestConfig.method.name))
private fun <I> RestClient.RequestBodyUriSpec.uri(requestConfig: RequestConfig<I>): RestClient.RequestBodySpec {
val uriComponentsBuilder = UriComponentsBuilder.fromPath(requestConfig.path)
requestConfig.query.forEach { key, values ->
uriComponentsBuilder.queryParam(key, "{$key}")
private fun <I> RestClient.RequestBodyUriSpec.uri(requestConfig: RequestConfig<I>) =
uri(requestConfig.path) { builder ->
builder
.queryParams(LinkedMultiValueMap(requestConfig.query))
.build(requestConfig.params)
}
return uri(uriComponentsBuilder.encode().buildAndExpand(requestConfig.query + requestConfig.params).toUri())
}
private fun <I> RestClient.RequestBodySpec.headers(requestConfig: RequestConfig<I>) =
apply { requestConfig.headers.forEach { (name, value) -> header(name, value) } }

View File

@@ -21,7 +21,7 @@
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
{{/useJakartaEe}}
<junit.version>4.13.2</junit.version>
<vertx.version>4.5.22</vertx.version>
<vertx.version>4.5.24</vertx.version>
<maven-compiler-plugin.version>3.10.0</maven-compiler-plugin.version>
<vertx-openapi-router.version>1.0.2</vertx-openapi-router.version>
<maven-shade-plugin.version>3.2.4</maven-shade-plugin.version>

View File

@@ -150,7 +150,6 @@
if (typeof(stream_callback) == "closure") { # return void if streaming is enabled
return(invisible(NULL))
}
{{/vendorExtensions.x-streaming}}
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
return(local_var_response$content)
@@ -561,7 +560,7 @@
self$api_client$WriteFile(local_var_resp, data_file)
}
ApiResponse$new(content,resp)
ApiResponse$new(content = content, response = resp, status_code = local_var_resp$status_code)
{{/isPrimitiveType}}
{{^isPrimitiveType}}
# save response in a file
@@ -609,7 +608,9 @@
{{/useRlangExceptionHandling}}
{{/returnExceptionOnFailure}}
{{^returnExceptionOnFailure}}
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
{{/returnExceptionOnFailure}}
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
{{#returnExceptionOnFailure}}
@@ -626,7 +627,9 @@
{{/useRlangExceptionHandling}}
{{/returnExceptionOnFailure}}
{{^returnExceptionOnFailure}}
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
{{/returnExceptionOnFailure}}
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
{{#returnExceptionOnFailure}}
@@ -643,7 +646,7 @@
{{/useRlangExceptionHandling}}
{{/returnExceptionOnFailure}}
{{^returnExceptionOnFailure}}
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)

View File

@@ -351,6 +351,11 @@ ApiClient <- R6::R6Class(
return_obj <- NULL
primitive_types <- c("character", "numeric", "integer", "logical", "complex")
# for deserialization, uniqueness requirements do not matter
return_type <- gsub(pattern = "^(set|array)\\[",
replacement = "collection\\[",
x = return_type)
# To handle the "map" type
if (startsWith(return_type, "map(")) {
inner_return_type <- regmatches(return_type,
@@ -359,10 +364,10 @@ ApiClient <- R6::R6Class(
self$deserializeObj(obj[[name]], inner_return_type, pkg_env)
})
names(return_obj) <- names(obj)
} else if (startsWith(return_type, "array[")) {
# To handle the "array" type
} else if (startsWith(return_type, "collection[")) {
# To handle the "array" and "set" types
inner_return_type <- regmatches(return_type,
regexec(pattern = "array\\[(.*)\\]", return_type))[[1]][2]
regexec(pattern = "collection\\[(.*)\\]", return_type))[[1]][2]
if (c(inner_return_type) %in% primitive_types) {
return_obj <- vector("list", length = length(obj))
if (length(obj) > 0) {
@@ -371,6 +376,9 @@ ApiClient <- R6::R6Class(
}
}
} else {
if (is.list(obj) && length(obj) == 1 && is.data.frame(obj[[1]])) {
obj <- obj[[1]]
}
if (!is.null(nrow(obj))) {
return_obj <- vector("list", length = nrow(obj))
if (nrow(obj) > 0) {

View File

@@ -363,6 +363,11 @@ ApiClient <- R6::R6Class(
return_obj <- NULL
primitive_types <- c("character", "numeric", "integer", "logical", "complex")
# for deserialization, uniqueness requirements do not matter
return_type <- gsub(pattern = "^(set|array)\\[",
replacement = "collection\\[",
x = return_type)
# To handle the "map" type
if (startsWith(return_type, "map(")) {
inner_return_type <- regmatches(return_type,
@@ -371,10 +376,10 @@ ApiClient <- R6::R6Class(
self$deserializeObj(obj[[name]], inner_return_type, pkg_env)
})
names(return_obj) <- names(obj)
} else if (startsWith(return_type, "array[")) {
# To handle the "array" type
} else if (startsWith(return_type, "collection[")) {
# To handle the "array" and "set" types
inner_return_type <- regmatches(return_type,
regexec(pattern = "array\\[(.*)\\]", return_type))[[1]][2]
regexec(pattern = "collection\\[(.*)\\]", return_type))[[1]][2]
if (c(inner_return_type) %in% primitive_types) {
return_obj <- vector("list", length = length(obj))
if (length(obj) > 0) {
@@ -383,6 +388,9 @@ ApiClient <- R6::R6Class(
}
}
} else {
if (is.list(obj) && length(obj) == 1 && is.data.frame(obj[[1]])) {
obj <- obj[[1]]
}
if (!is.null(nrow(obj))) {
return_obj <- vector("list", length = nrow(obj))
if (nrow(obj) > 0) {

View File

@@ -30,9 +30,6 @@
stop("Use one of the valid values: ",
paste0(enumvec, collapse = ", "))
}
warning("Initializing {{{classname}}} with DUMMY_ENUM. Use one of the valid values: ",
paste0(enumvec, collapse = ", "),
". If you did not manually initialize {{{classname}}}, this may already be overwritten by an enum loaded from a JSON config.")
}
private$value <- val
},

View File

@@ -46,6 +46,7 @@ import java.util.*;
import java.util.stream.Collectors;
import static org.assertj.core.api.Assertions.assertThat;
import static org.openapitools.codegen.languages.AbstractJavaCodegen.DISABLE_DISCRIMINATOR_JSON_IGNORE_PROPERTIES;
public class AbstractJavaCodegenTest {
@@ -968,6 +969,15 @@ public class AbstractJavaCodegenTest {
Assert.assertEquals(defaultValue, "List<@Max(10)Integer>");
}
@Test
public void disableDiscriminatorJsonIgnorePropertiesFlagTest() {
codegen.additionalProperties().put(DISABLE_DISCRIMINATOR_JSON_IGNORE_PROPERTIES, true);
codegen.preprocessOpenAPI(FLATTENED_SPEC.get("3_0/petstore"));
Assert.assertTrue((boolean) codegen.additionalProperties().get(DISABLE_DISCRIMINATOR_JSON_IGNORE_PROPERTIES));
}
@Test
public void removeAnnotationsTest() {
Assert.assertEquals(codegen.removeAnnotations("@Min(0) @Max(10)Integer"), "Integer");

View File

@@ -3241,7 +3241,7 @@ public class JavaClientCodegenTest {
.setOutputDir(output.toString().replace("\\", "/"));
final Map<String, File> files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate()
.stream().collect(Collectors.toMap(File::getName, Function.identity()));;
.stream().collect(Collectors.toMap(File::getName, Function.identity()));
final JavaFileAssert apiClient = JavaFileAssert.assertThat(files.get("ApiClient.java"))
.printFileContent();
@@ -3553,23 +3553,23 @@ public class JavaClientCodegenTest {
output.deleteOnExit();
final CodegenConfigurator configurator = new CodegenConfigurator()
.setGeneratorName(JAVA_GENERATOR)
.setLibrary(JavaClientCodegen.NATIVE)
.setAdditionalProperties(properties)
.setInputSpec("src/test/resources/3_0/java/native/issue21991.yaml")
.setOutputDir(output.getAbsolutePath().replace("\\", "/"));
.setGeneratorName(JAVA_GENERATOR)
.setLibrary(JavaClientCodegen.NATIVE)
.setAdditionalProperties(properties)
.setInputSpec("src/test/resources/3_0/java/native/issue21991.yaml")
.setOutputDir(output.getAbsolutePath().replace("\\", "/"));
final ClientOptInput clientOptInput = configurator.toClientOptInput();
DefaultGenerator generator = new DefaultGenerator();
Map<String, File> files = generator.opts(clientOptInput).generate().stream()
.collect(Collectors.toMap(File::getName, Function.identity()));
.collect(Collectors.toMap(File::getName, Function.identity()));
File apiFile = files.get("Schema.java");
assertNotNull(apiFile);
JavaFileAssert.assertThat(apiFile).fileDoesNotContain(
"import io.swagger.v3.oas.annotations.media.Schema;"
"import io.swagger.v3.oas.annotations.media.Schema;"
);
}
@@ -3582,23 +3582,23 @@ public class JavaClientCodegenTest {
output.deleteOnExit();
final CodegenConfigurator configurator = new CodegenConfigurator()
.setGeneratorName(JAVA_GENERATOR)
.setLibrary(JavaClientCodegen.NATIVE)
.setAdditionalProperties(properties)
.setInputSpec("src/test/resources/3_0/java/native/issue21991.yaml")
.setOutputDir(output.getAbsolutePath().replace("\\", "/"));
.setGeneratorName(JAVA_GENERATOR)
.setLibrary(JavaClientCodegen.NATIVE)
.setAdditionalProperties(properties)
.setInputSpec("src/test/resources/3_0/java/native/issue21991.yaml")
.setOutputDir(output.getAbsolutePath().replace("\\", "/"));
final ClientOptInput clientOptInput = configurator.toClientOptInput();
DefaultGenerator generator = new DefaultGenerator();
Map<String, File> files = generator.opts(clientOptInput).generate().stream()
.collect(Collectors.toMap(File::getName, Function.identity()));
.collect(Collectors.toMap(File::getName, Function.identity()));
File apiFile = files.get("Schema.java");
assertNotNull(apiFile);
JavaFileAssert.assertThat(apiFile).fileContains(
"import io.swagger.v3.oas.annotations.media.Schema;"
"import io.swagger.v3.oas.annotations.media.Schema;"
);
}
@@ -3753,7 +3753,7 @@ public class JavaClientCodegenTest {
JavaFileAssert.assertThat(oneOfFile).fileContains(
"final TypeAdapter<some.pkg.A> adaptersomepkgA = gson.getDelegateAdapter(this, TypeToken.get(some.pkg.A.class));",
"final TypeAdapter<some.pkg.B> adaptersomepkgB = gson.getDelegateAdapter(this, TypeToken.get(some.pkg.B.class));",
"final TypeAdapter<some.pkg.B> adaptersomepkgB = gson.getDelegateAdapter(this, TypeToken.get(some.pkg.B.class));",
"public some.pkg.A getsomepkgA() throws ClassCastException {",
"public some.pkg.B getsomepkgB() throws ClassCastException {"
);
@@ -3803,10 +3803,11 @@ public class JavaClientCodegenTest {
//chain method calls for object initialization
class MethodCallVisitor extends VoidVisitorAdapter<Void> {
Map<String, Expression> expressionMap = new HashMap<>();
@Override
public void visit(MethodCallExpr n, Void arg) {
expressionMap.put(n.getNameAsString(), n.getArgument(0));
if(n.getScope().isPresent()) {
if (n.getScope().isPresent()) {
n.getScope().get().accept(this, arg);
}
}
@@ -3993,7 +3994,7 @@ public class JavaClientCodegenTest {
assertFileContains(
output.resolve("src/main/java/org/openapitools/client/api/QueryApi.java"),
"queryParams.putAll(apiClient.parameterToMultiValueMapJson(ApiClient.CollectionFormat" +
".valueOf(\"csv\".toUpperCase(Locale.ROOT)), \"json_serialized_object_array_ref_string_query\", jsonSerializedObjectArrayRefStringQuery));"
".valueOf(\"csv\".toUpperCase(Locale.ROOT)), \"json_serialized_object_array_ref_string_query\", jsonSerializedObjectArrayRefStringQuery));"
);
}
@@ -4064,6 +4065,22 @@ public class JavaClientCodegenTest {
.assertTypeAnnotations().containsWithName("SuppressWarnings");
}
@Test
public void disableDiscriminatorJsonIgnorePropertiesIsTrueThenJsonIgnorePropertiesShouldBeNotAdded() {
final Map<String, File> files = generateFromContract("src/test/resources/3_0/java/issue12777.yaml", RESTCLIENT,
Map.of(DISABLE_DISCRIMINATOR_JSON_IGNORE_PROPERTIES, "true"));
JavaFileAssert.assertThat(files.get("BaseConfiguration.java"))
.assertTypeAnnotations().doesNotContainWithName("JsonIgnoreProperties");
}
@Test
public void disableDiscriminatorJsonIgnorePropertiesIsTrueThenJsonIgnorePropertiesShouldBeAdded() {
final Map<String, File> files = generateFromContract("src/test/resources/3_0/java/issue12777.yaml", RESTCLIENT,
Map.of(DISABLE_DISCRIMINATOR_JSON_IGNORE_PROPERTIES, "false"));
JavaFileAssert.assertThat(files.get("BaseConfiguration.java"))
.assertTypeAnnotations().containsWithName("JsonIgnoreProperties");
}
@Test
public void testOneOfInterfaceWithEnumDiscriminatorHavingCustomDescription3_1() {
final Map<String, File> files = generateFromContract("src/test/resources/3_1/oneof_polymorphism_and_inheritance.yaml", WEBCLIENT,
@@ -4072,4 +4089,5 @@ public class JavaClientCodegenTest {
.isInterface()
.fileContains("public FruitType getFruitType()");
}
}

View File

@@ -18,8 +18,10 @@ package org.openapitools.codegen.protobuf;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.media.ArraySchema;
import io.swagger.v3.oas.models.media.BooleanSchema;
import io.swagger.v3.oas.models.media.IntegerSchema;
import io.swagger.v3.oas.models.media.MapSchema;
import io.swagger.v3.oas.models.media.NumberSchema;
import io.swagger.v3.oas.models.media.ObjectSchema;
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.media.StringSchema;
@@ -45,6 +47,7 @@ import java.util.Arrays;
import java.util.List;
import java.util.Map;
import static org.openapitools.codegen.TestUtils.createCodegenModelWrapper;
import static org.openapitools.codegen.languages.ProtobufSchemaCodegen.USE_SIMPLIFIED_ENUM_NAMES;
import static org.testng.Assert.assertEquals;
@@ -142,6 +145,64 @@ public class ProtobufSchemaCodegenTest {
output.deleteOnExit();
}
@Test
public void testCodeGenWithOneOfDiscriminator31() throws IOException {
System.setProperty("line.separator", "\n");
File output = Files.createTempDirectory("test").toFile();
final CodegenConfigurator configurator = new CodegenConfigurator()
.setGeneratorName("protobuf-schema")
.setInputSpec("src/test/resources/3_1/oneOf.yaml")
.setOutputDir(output.getAbsolutePath().replace("\\", "/"));
final ClientOptInput clientOptInput = configurator.toClientOptInput();
DefaultGenerator generator = new DefaultGenerator();
List<File> files = generator.opts(clientOptInput).generate();
TestUtils.ensureContainsFile(files, output, "models/fruit.proto");
// Get the processed OpenAPI with wrapper schemas
OpenAPI openAPI = clientOptInput.getOpenAPI();
ProtobufSchemaCodegen codegen = new ProtobufSchemaCodegen();
codegen.setOpenAPI(openAPI);
codegen.processOpts();
Schema fruitSchema = openAPI.getComponents().getSchemas().get("fruit");
Assert.assertNotNull(fruitSchema, "fruit schema should exist");
CodegenModel fruitModel = codegen.fromModel("fruit", fruitSchema);
codegen.postProcessModels(createCodegenModelWrapper(fruitModel));
Assert.assertNotNull(fruitModel.oneOf, "fruit model should have oneOf items");
Assert.assertTrue(fruitModel.oneOf.size() >= 2, "fruit model should have at least 2 oneOf items");
Assert.assertNotNull(fruitModel.vars, "fruit model should have vars");
Assert.assertTrue(fruitModel.vars.size() > 0, "fruit model should have at least one var");
Assert.assertEquals(fruitModel.vars.size(), 3, "fruit model should have 3 vars (one for each oneOf item)");
for (CodegenProperty var : fruitModel.vars) {
Assert.assertNotNull(var.name, "var name should not be null");
Assert.assertNotNull(var.dataType, "var dataType should not be null");
Assert.assertTrue(var.isModel, "var " + var.name + " should be a model type (isModel=" + var.isModel + ")");
Assert.assertFalse(var.isContainer, "var should not be a container (it references a model)");
// Check expected properties based on discriminator title
if (var.name.equals("apple_list")) {
Assert.assertEquals(var.dataType, "StringArray", "apple_list should reference StringArray");
} else if (var.name.equals("banana_map")) {
Assert.assertEquals(var.dataType, "FloatMap", "banana_map should reference FloatMap");
} else if (var.name.equals("orange_choice")) {
Assert.assertEquals(var.dataType, "Orange", "orange_choice should reference Orange");
} else {
Assert.fail("Unexpected var name: " + var.name + ". Expected one of: apple_list, banana_map, orange_choice");
}
}
output.deleteOnExit();
}
@Test(description = "convert a model with dollar signs")
public void modelTest() {
final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/dollar-in-names-pull14359.yaml");

View File

@@ -0,0 +1,64 @@
openapi: 3.0.1
info:
title: Example - Polymorphic Config
version: 1.0.0
paths: { }
components:
schemas:
# -------------------------
# Base type with discriminator
# -------------------------
BaseConfiguration:
type: object
properties:
id:
type: integer
format: int64
type:
$ref: '#/components/schemas/ConfigurationType'
required:
- type
discriminator:
propertyName: type
mapping:
CHILD_ONE: '#/components/schemas/ChildOneConfiguration'
CHILD_TWO: '#/components/schemas/ChildTwoConfiguration'
ConfigurationType:
type: string
description: Example discriminator enum
enum:
- CHILD_ONE
- CHILD_TWO
# -------------------------
# Child 1
# -------------------------
ChildOneConfiguration:
allOf:
- $ref: '#/components/schemas/BaseConfiguration'
- type: object
required:
- type
properties:
type:
$ref: '#/components/schemas/ConfigurationType'
additionalFieldOne:
type: string
additionalProperties: true
# -------------------------
# Child 2
# -------------------------
ChildTwoConfiguration:
allOf:
- $ref: '#/components/schemas/BaseConfiguration'
- type: object
required:
- type
properties:
type:
$ref: '#/components/schemas/ConfigurationType'
additionalFieldTwo:
type: integer
additionalProperties: true

View File

@@ -0,0 +1,42 @@
openapi: 3.1.0
info:
title: fruity
version: 0.0.1
paths:
/:
get:
responses:
'200':
description: desc
content:
application/json:
schema:
$ref: '#/components/schemas/fruit'
components:
schemas:
fruit:
oneOf:
- title: appleList
$ref: '#/components/schemas/appleArray'
- title: bananaMap
$ref: '#/components/schemas/bananaMap'
- title: orangeChoice
$ref: '#/components/schemas/orange'
appleArray:
type: array
items:
title: appleaArray
type: string
bananaMap:
type: object
additionalProperties:
type: number
orange:
title: orange
type: object
properties:
sweet:
type: boolean

View File

@@ -15,7 +15,7 @@
<packaging>pom</packaging>
<name>openapi-generator-project</name>
<!-- RELEASE_VERSION -->
<version>7.19.0-SNAPSHOT</version>
<version>7.19.0</version>
<!-- /RELEASE_VERSION -->
<url>https://github.com/openapitools/openapi-generator</url>
<scm>
@@ -1265,7 +1265,7 @@
<snakeyaml.version>2.4</snakeyaml.version>
<spotbugs-plugin.version>3.1.12.2</spotbugs-plugin.version>
<swagger-parser-groupid.version>io.swagger.parser.v3</swagger-parser-groupid.version>
<swagger-parser.version>2.1.36</swagger-parser.version>
<swagger-parser.version>2.1.37</swagger-parser.version>
<testng.version>7.10.2</testng.version>
<violations-maven-plugin.version>1.34</violations-maven-plugin.version>
<wagon-ssh-external.version>3.4.3</wagon-ssh-external.version>

View File

@@ -478,7 +478,7 @@ public class ApiClient {
if (encoding.isPresent()) {
for (String token : encoding.get().split(",")) {
if ("gzip".equalsIgnoreCase(token.trim())) {
return new GZIPInputStream(body);
return new GZIPInputStream(body, 8192);
}
}
}

View File

@@ -4,9 +4,8 @@ import org.springframework.core.ParameterizedTypeReference
import org.springframework.http.HttpHeaders
import org.springframework.http.HttpMethod
import org.springframework.http.MediaType
import org.springframework.http.ResponseEntity
import org.springframework.web.client.RestClient
import org.springframework.web.util.UriComponentsBuilder
import org.springframework.http.ResponseEntity
import org.springframework.util.LinkedMultiValueMap
open class ApiClient(protected val client: RestClient) {
@@ -36,13 +35,12 @@ open class ApiClient(protected val client: RestClient) {
private fun <I> RestClient.method(requestConfig: RequestConfig<I>)=
method(HttpMethod.valueOf(requestConfig.method.name))
private fun <I> RestClient.RequestBodyUriSpec.uri(requestConfig: RequestConfig<I>): RestClient.RequestBodySpec {
val uriComponentsBuilder = UriComponentsBuilder.fromPath(requestConfig.path)
requestConfig.query.forEach { key, values ->
uriComponentsBuilder.queryParam(key, "{$key}")
private fun <I> RestClient.RequestBodyUriSpec.uri(requestConfig: RequestConfig<I>) =
uri(requestConfig.path) { builder ->
builder
.queryParams(LinkedMultiValueMap(requestConfig.query))
.build(requestConfig.params)
}
return uri(uriComponentsBuilder.encode().buildAndExpand(requestConfig.query + requestConfig.params).toUri())
}
private fun <I> RestClient.RequestBodySpec.headers(requestConfig: RequestConfig<I>) =
apply { requestConfig.headers.forEach { (name, value) -> header(name, value) } }

View File

@@ -303,6 +303,11 @@ ApiClient <- R6::R6Class(
return_obj <- NULL
primitive_types <- c("character", "numeric", "integer", "logical", "complex")
# for deserialization, uniqueness requirements do not matter
return_type <- gsub(pattern = "^(set|array)\\[",
replacement = "collection\\[",
x = return_type)
# To handle the "map" type
if (startsWith(return_type, "map(")) {
inner_return_type <- regmatches(return_type,
@@ -311,10 +316,10 @@ ApiClient <- R6::R6Class(
self$deserializeObj(obj[[name]], inner_return_type, pkg_env)
})
names(return_obj) <- names(obj)
} else if (startsWith(return_type, "array[")) {
# To handle the "array" type
} else if (startsWith(return_type, "collection[")) {
# To handle the "array" and "set" types
inner_return_type <- regmatches(return_type,
regexec(pattern = "array\\[(.*)\\]", return_type))[[1]][2]
regexec(pattern = "collection\\[(.*)\\]", return_type))[[1]][2]
if (c(inner_return_type) %in% primitive_types) {
return_obj <- vector("list", length = length(obj))
if (length(obj) > 0) {
@@ -323,6 +328,9 @@ ApiClient <- R6::R6Class(
}
}
} else {
if (is.list(obj) && length(obj) == 1 && is.data.frame(obj[[1]])) {
obj <- obj[[1]]
}
if (!is.null(nrow(obj))) {
return_obj <- vector("list", length = nrow(obj))
if (nrow(obj) > 0) {

View File

@@ -148,11 +148,15 @@ AuthApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -239,11 +243,15 @@ AuthApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)

View File

@@ -250,11 +250,15 @@ BodyApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -349,11 +353,15 @@ BodyApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -447,11 +455,15 @@ BodyApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -541,11 +553,15 @@ BodyApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -640,11 +656,15 @@ BodyApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -739,11 +759,15 @@ BodyApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -838,11 +862,15 @@ BodyApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -937,11 +965,15 @@ BodyApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -1036,11 +1068,15 @@ BodyApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -1135,11 +1171,15 @@ BodyApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)

View File

@@ -181,11 +181,15 @@ FormApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -279,11 +283,15 @@ FormApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -408,11 +416,15 @@ FormApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)

View File

@@ -169,11 +169,15 @@ HeaderApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)

View File

@@ -184,11 +184,15 @@ PathApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)

View File

@@ -290,11 +290,15 @@ QueryApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -401,11 +405,15 @@ QueryApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -512,11 +520,15 @@ QueryApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -607,11 +619,15 @@ QueryApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -702,11 +718,15 @@ QueryApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -798,11 +818,15 @@ QueryApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -894,11 +918,15 @@ QueryApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -989,11 +1017,15 @@ QueryApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -1084,11 +1116,15 @@ QueryApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -1179,11 +1215,15 @@ QueryApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)
@@ -1283,11 +1323,15 @@ QueryApi <- R6::R6Class(
local_var_error_msg <- local_var_resp$response_as_text()
if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
ApiResponse$new(content = paste("Server returned ", local_var_resp$status_code, " response status code."),
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
ApiResponse$new("API client error", local_var_resp)
ApiResponse$new(content = "API client error",
response = local_var_resp,
status_code = local_var_resp$status_code)
} else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
if (is.null(local_var_resp$response) || local_var_resp$response == "") {
if (is.null(local_var_resp$response) || all(local_var_resp$response == "")) {
local_var_resp$response <- "API server error"
}
return(local_var_resp)

View File

@@ -29,9 +29,6 @@ StringEnumRef <- R6::R6Class(
stop("Use one of the valid values: ",
paste0(enumvec, collapse = ", "))
}
warning("Initializing StringEnumRef with DUMMY_ENUM. Use one of the valid values: ",
paste0(enumvec, collapse = ", "),
". If you did not manually initialize StringEnumRef, this may already be overwritten by an enum loaded from a JSON config.")
}
private$value <- val
},

File diff suppressed because it is too large Load Diff

View File

@@ -34,7 +34,7 @@
},
"devDependencies": {
"@angular/build": "^20.3.1",
"@angular/cli": "^20.3.13",
"@angular/cli": "^21.1.0",
"@angular/compiler-cli": "^20.3.0",
"@types/jasmine": "~5.1.8",
"jasmine-core": "~5.10.0",

View File

@@ -352,6 +352,11 @@ ApiClient <- R6::R6Class(
return_obj <- NULL
primitive_types <- c("character", "numeric", "integer", "logical", "complex")
# for deserialization, uniqueness requirements do not matter
return_type <- gsub(pattern = "^(set|array)\\[",
replacement = "collection\\[",
x = return_type)
# To handle the "map" type
if (startsWith(return_type, "map(")) {
inner_return_type <- regmatches(return_type,
@@ -360,10 +365,10 @@ ApiClient <- R6::R6Class(
self$deserializeObj(obj[[name]], inner_return_type, pkg_env)
})
names(return_obj) <- names(obj)
} else if (startsWith(return_type, "array[")) {
# To handle the "array" type
} else if (startsWith(return_type, "collection[")) {
# To handle the "array" and "set" types
inner_return_type <- regmatches(return_type,
regexec(pattern = "array\\[(.*)\\]", return_type))[[1]][2]
regexec(pattern = "collection\\[(.*)\\]", return_type))[[1]][2]
if (c(inner_return_type) %in% primitive_types) {
return_obj <- vector("list", length = length(obj))
if (length(obj) > 0) {
@@ -372,6 +377,9 @@ ApiClient <- R6::R6Class(
}
}
} else {
if (is.list(obj) && length(obj) == 1 && is.data.frame(obj[[1]])) {
obj <- obj[[1]]
}
if (!is.null(nrow(obj))) {
return_obj <- vector("list", length = nrow(obj))
if (nrow(obj) > 0) {

View File

@@ -1028,7 +1028,6 @@ PetApi <- R6::R6Class(
if (typeof(stream_callback) == "closure") { # return void if streaming is enabled
return(invisible(NULL))
}
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
return(local_var_response$content)
} else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
@@ -1165,7 +1164,6 @@ PetApi <- R6::R6Class(
if (typeof(stream_callback) == "closure") { # return void if streaming is enabled
return(invisible(NULL))
}
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
return(local_var_response$content)
} else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {

View File

@@ -352,6 +352,11 @@ ApiClient <- R6::R6Class(
return_obj <- NULL
primitive_types <- c("character", "numeric", "integer", "logical", "complex")
# for deserialization, uniqueness requirements do not matter
return_type <- gsub(pattern = "^(set|array)\\[",
replacement = "collection\\[",
x = return_type)
# To handle the "map" type
if (startsWith(return_type, "map(")) {
inner_return_type <- regmatches(return_type,
@@ -360,10 +365,10 @@ ApiClient <- R6::R6Class(
self$deserializeObj(obj[[name]], inner_return_type, pkg_env)
})
names(return_obj) <- names(obj)
} else if (startsWith(return_type, "array[")) {
# To handle the "array" type
} else if (startsWith(return_type, "collection[")) {
# To handle the "array" and "set" types
inner_return_type <- regmatches(return_type,
regexec(pattern = "array\\[(.*)\\]", return_type))[[1]][2]
regexec(pattern = "collection\\[(.*)\\]", return_type))[[1]][2]
if (c(inner_return_type) %in% primitive_types) {
return_obj <- vector("list", length = length(obj))
if (length(obj) > 0) {
@@ -372,6 +377,9 @@ ApiClient <- R6::R6Class(
}
}
} else {
if (is.list(obj) && length(obj) == 1 && is.data.frame(obj[[1]])) {
obj <- obj[[1]]
}
if (!is.null(nrow(obj))) {
return_obj <- vector("list", length = nrow(obj))
if (nrow(obj) > 0) {

View File

@@ -1028,7 +1028,6 @@ PetApi <- R6::R6Class(
if (typeof(stream_callback) == "closure") { # return void if streaming is enabled
return(invisible(NULL))
}
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
return(local_var_response$content)
} else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
@@ -1165,7 +1164,6 @@ PetApi <- R6::R6Class(
if (typeof(stream_callback) == "closure") { # return void if streaming is enabled
return(invisible(NULL))
}
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
return(local_var_response$content)
} else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {

View File

@@ -332,6 +332,11 @@ ApiClient <- R6::R6Class(
return_obj <- NULL
primitive_types <- c("character", "numeric", "integer", "logical", "complex")
# for deserialization, uniqueness requirements do not matter
return_type <- gsub(pattern = "^(set|array)\\[",
replacement = "collection\\[",
x = return_type)
# To handle the "map" type
if (startsWith(return_type, "map(")) {
inner_return_type <- regmatches(return_type,
@@ -340,10 +345,10 @@ ApiClient <- R6::R6Class(
self$deserializeObj(obj[[name]], inner_return_type, pkg_env)
})
names(return_obj) <- names(obj)
} else if (startsWith(return_type, "array[")) {
# To handle the "array" type
} else if (startsWith(return_type, "collection[")) {
# To handle the "array" and "set" types
inner_return_type <- regmatches(return_type,
regexec(pattern = "array\\[(.*)\\]", return_type))[[1]][2]
regexec(pattern = "collection\\[(.*)\\]", return_type))[[1]][2]
if (c(inner_return_type) %in% primitive_types) {
return_obj <- vector("list", length = length(obj))
if (length(obj) > 0) {
@@ -352,6 +357,9 @@ ApiClient <- R6::R6Class(
}
}
} else {
if (is.list(obj) && length(obj) == 1 && is.data.frame(obj[[1]])) {
obj <- obj[[1]]
}
if (!is.null(nrow(obj))) {
return_obj <- vector("list", length = nrow(obj))
if (nrow(obj) > 0) {

View File

@@ -1028,7 +1028,6 @@ PetApi <- R6::R6Class(
if (typeof(stream_callback) == "closure") { # return void if streaming is enabled
return(invisible(NULL))
}
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
return(local_var_response$content)
} else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
@@ -1165,7 +1164,6 @@ PetApi <- R6::R6Class(
if (typeof(stream_callback) == "closure") { # return void if streaming is enabled
return(invisible(NULL))
}
if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
return(local_var_response$content)
} else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {

View File

@@ -478,7 +478,7 @@ public class ApiClient {
if (encoding.isPresent()) {
for (String token : encoding.get().split(",")) {
if ("gzip".equalsIgnoreCase(token.trim())) {
return new GZIPInputStream(body);
return new GZIPInputStream(body, 8192);
}
}
}

View File

@@ -478,7 +478,7 @@ public class ApiClient {
if (encoding.isPresent()) {
for (String token : encoding.get().split(",")) {
if ("gzip".equalsIgnoreCase(token.trim())) {
return new GZIPInputStream(body);
return new GZIPInputStream(body, 8192);
}
}
}

View File

@@ -21,6 +21,7 @@ import org.openapitools.jackson.nullable.JsonNullableModule;
import java.io.InputStream;
import java.io.IOException;
import java.io.ByteArrayOutputStream;
import java.net.URI;
import java.net.URLEncoder;
import java.net.http.HttpClient;
@@ -37,6 +38,9 @@ import java.util.StringJoiner;
import java.util.function.Consumer;
import java.util.Optional;
import java.util.zip.GZIPInputStream;
import java.util.function.Supplier;
import java.util.Objects;
import java.util.zip.GZIPOutputStream;
import java.util.stream.Collectors;
import static java.nio.charset.StandardCharsets.UTF_8;
@@ -478,11 +482,122 @@ public class ApiClient {
if (encoding.isPresent()) {
for (String token : encoding.get().split(",")) {
if ("gzip".equalsIgnoreCase(token.trim())) {
return new GZIPInputStream(body);
return new GZIPInputStream(body, 8192);
}
}
}
return body;
}
/**
* Wraps a request body supplier with a streaming GZIP compressor so large payloads
* can be sent without buffering the entire contents in memory.
*
* @param bodySupplier Supplies the original request body InputStream
* @return BodyPublisher that emits gzip-compressed bytes from the supplied stream
*/
public static HttpRequest.BodyPublisher gzipRequestBody(Supplier<InputStream> bodySupplier) {
Objects.requireNonNull(bodySupplier, "bodySupplier must not be null");
return HttpRequest.BodyPublishers.ofInputStream(() -> new GzipCompressingInputStream(bodySupplier));
}
private static final class GzipCompressingInputStream extends InputStream {
private final Supplier<InputStream> supplier;
private final byte[] readBuffer = new byte[8192];
private final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
private InputStream source;
private GZIPOutputStream gzipStream;
private byte[] currentChunk = new byte[0];
private int chunkPosition = 0;
private boolean finished = false;
private GzipCompressingInputStream(Supplier<InputStream> supplier) {
this.supplier = Objects.requireNonNull(supplier, "bodySupplier must not be null");
}
private void ensureInitialized() throws IOException {
if (source == null) {
source = Objects.requireNonNull(supplier.get(), "bodySupplier returned null InputStream");
gzipStream = new GZIPOutputStream(buffer, true);
}
}
private boolean fillBuffer() throws IOException {
while (chunkPosition >= currentChunk.length) {
buffer.reset();
ensureInitialized();
if (finished) {
return false;
}
int bytesRead = source.read(readBuffer);
if (bytesRead == -1) {
gzipStream.finish();
gzipStream.close();
source.close();
finished = true;
} else {
gzipStream.write(readBuffer, 0, bytesRead);
gzipStream.flush();
}
currentChunk = buffer.toByteArray();
chunkPosition = 0;
if (currentChunk.length == 0 && !finished) {
continue;
}
if (currentChunk.length == 0 && finished) {
return false;
}
return true;
}
return true;
}
@Override
public int read() throws IOException {
if (!fillBuffer()) {
return -1;
}
return currentChunk[chunkPosition++] & 0xFF;
}
@Override
public int read(byte[] b, int off, int len) throws IOException {
if (len == 0) {
return 0;
}
if (!fillBuffer()) {
return -1;
}
int bytesToCopy = Math.min(len, currentChunk.length - chunkPosition);
System.arraycopy(currentChunk, chunkPosition, b, off, bytesToCopy);
chunkPosition += bytesToCopy;
return bytesToCopy;
}
@Override
public void close() throws IOException {
IOException exception = null;
if (source != null) {
try {
source.close();
} catch (IOException e) {
exception = e;
} finally {
source = null;
}
}
if (gzipStream != null) {
try {
gzipStream.close();
} catch (IOException e) {
exception = exception == null ? e : exception;
} finally {
gzipStream = null;
}
}
if (exception != null) {
throw exception;
}
}
}
}

View File

@@ -44,6 +44,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Consumer;
import java.util.function.Supplier;
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.19.0-SNAPSHOT")
public class PetApi {
@@ -267,10 +268,13 @@ public class PetApi {
localVarRequestBuilder.header("Content-Type", "application/json");
localVarRequestBuilder.header("Accept", "application/xml, application/json");
localVarRequestBuilder.header("Accept-Encoding", "gzip");
try {
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(pet);
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
Supplier<InputStream> localVarRequestBodySupplier = () -> new ByteArrayInputStream(localVarPostBody);
localVarRequestBuilder.header("Content-Encoding", "gzip");
localVarRequestBuilder.method("POST", ApiClient.gzipRequestBody(localVarRequestBodySupplier));
} catch (IOException e) {
throw new ApiException(e);
}

View File

@@ -478,7 +478,7 @@ public class ApiClient {
if (encoding.isPresent()) {
for (String token : encoding.get().split(",")) {
if ("gzip".equalsIgnoreCase(token.trim())) {
return new GZIPInputStream(body);
return new GZIPInputStream(body, 8192);
}
}
}

View File

@@ -4,9 +4,8 @@ import org.springframework.core.ParameterizedTypeReference
import org.springframework.http.HttpHeaders
import org.springframework.http.HttpMethod
import org.springframework.http.MediaType
import org.springframework.http.ResponseEntity
import org.springframework.web.client.RestClient
import org.springframework.web.util.UriComponentsBuilder
import org.springframework.http.ResponseEntity
import org.springframework.util.LinkedMultiValueMap
open class ApiClient(protected val client: RestClient) {
@@ -36,13 +35,12 @@ open class ApiClient(protected val client: RestClient) {
private fun <I> RestClient.method(requestConfig: RequestConfig<I>)=
method(HttpMethod.valueOf(requestConfig.method.name))
private fun <I> RestClient.RequestBodyUriSpec.uri(requestConfig: RequestConfig<I>): RestClient.RequestBodySpec {
val uriComponentsBuilder = UriComponentsBuilder.fromPath(requestConfig.path)
requestConfig.query.forEach { key, values ->
uriComponentsBuilder.queryParam(key, "{$key}")
private fun <I> RestClient.RequestBodyUriSpec.uri(requestConfig: RequestConfig<I>) =
uri(requestConfig.path) { builder ->
builder
.queryParams(LinkedMultiValueMap(requestConfig.query))
.build(requestConfig.params)
}
return uri(uriComponentsBuilder.encode().buildAndExpand(requestConfig.query + requestConfig.params).toUri())
}
private fun <I> RestClient.RequestBodySpec.headers(requestConfig: RequestConfig<I>) =
apply { requestConfig.headers.forEach { (name, value) -> header(name, value) } }

View File

@@ -26,7 +26,7 @@
},
"devDependencies": {
"@angular-devkit/build-angular": "^19.2.17",
"@angular/cli": "^19.0.0",
"@angular/cli": "^21.1.0",
"@angular/compiler-cli": "^19.0.0",
"@angular/language-service": "^19.0.0",
"@types/jasmine": "~4.3.4",

View File

@@ -10,7 +10,7 @@
"dependencies": {
"@angular/animations": "^19.0.0",
"@angular/common": "^19.0.0",
"@angular/compiler": "^19.2.17",
"@angular/compiler": "^19.2.18",
"@angular/core": "^19.0.0",
"@angular/forms": "^19.0.0",
"@angular/platform-browser": "^19.0.0",
@@ -1180,9 +1180,9 @@
}
},
"node_modules/@angular/compiler": {
"version": "19.2.17",
"resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-19.2.17.tgz",
"integrity": "sha512-qo8psYASAlDiQ8fAL8i/E2JfWH2nPTpZDKKZxSWvgBVA8o+zUEjYAJu6/k6btnu+4Qcb425T0rmM/zao6EU9Aw==",
"version": "19.2.18",
"resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-19.2.18.tgz",
"integrity": "sha512-3MscvODxRVxc3Cs0ZlHI5Pk5rEvE80otfvxZTMksOZuPlv1B+S8MjWfc3X3jk9SbyUEzODBEH55iCaBHD48V3g==",
"license": "MIT",
"dependencies": {
"tslib": "^2.3.0"
@@ -10478,9 +10478,9 @@
}
},
"node_modules/listr2/node_modules/ansi-regex": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz",
"integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==",
"version": "6.2.2",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz",
"integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==",
"dev": true,
"license": "MIT",
"engines": {
@@ -10491,9 +10491,9 @@
}
},
"node_modules/listr2/node_modules/ansi-styles": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz",
"integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==",
"version": "6.2.3",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz",
"integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==",
"dev": true,
"license": "MIT",
"engines": {
@@ -10511,9 +10511,9 @@
"license": "MIT"
},
"node_modules/listr2/node_modules/strip-ansi": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
"integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz",
"integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -10527,9 +10527,9 @@
}
},
"node_modules/listr2/node_modules/wrap-ansi": {
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz",
"integrity": "sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==",
"version": "9.0.2",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz",
"integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -11251,9 +11251,9 @@
"license": "MIT"
},
"node_modules/msgpackr": {
"version": "1.11.5",
"resolved": "https://registry.npmjs.org/msgpackr/-/msgpackr-1.11.5.tgz",
"integrity": "sha512-UjkUHN0yqp9RWKy0Lplhh+wlpdt9oQBYgULZOiFhV3VclSF1JnSQWZ5r9gORQlNYaUKQoR8itv7g7z1xDDuACA==",
"version": "1.11.8",
"resolved": "https://registry.npmjs.org/msgpackr/-/msgpackr-1.11.8.tgz",
"integrity": "sha512-bC4UGzHhVvgDNS7kn9tV8fAucIYUBuGojcaLiz7v+P63Lmtm0Xeji8B/8tYKddALXxJLpwIeBmUN3u64C4YkRA==",
"dev": true,
"license": "MIT",
"optional": true,
@@ -11792,9 +11792,9 @@
"license": "ISC"
},
"node_modules/ordered-binary": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/ordered-binary/-/ordered-binary-1.6.0.tgz",
"integrity": "sha512-IQh2aMfMIDbPjI/8a3Edr+PiOpcsB7yo8NdW7aHWVaoR/pcDldunMvnnwbk/auPGqmKeAdxtZl7MHX/QmPwhvQ==",
"version": "1.6.1",
"resolved": "https://registry.npmjs.org/ordered-binary/-/ordered-binary-1.6.1.tgz",
"integrity": "sha512-QkCdPooczexPLiXIrbVOPYkR3VO3T6v2OyKRkR1Xbhpy7/LAVXwahnRCgRp78Oe/Ehf0C/HATAxfSr6eA1oX+w==",
"dev": true,
"license": "MIT",
"optional": true
@@ -13424,9 +13424,9 @@
}
},
"node_modules/slice-ansi/node_modules/ansi-styles": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz",
"integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==",
"version": "6.2.3",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz",
"integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==",
"dev": true,
"license": "MIT",
"engines": {

Some files were not shown because too many files have changed in this diff Show More