Compare commits

..

42 Commits

Author SHA1 Message Date
Bruno Coelho
ea6f4c8780 [swift6][client] mark PromiseKit as deprecated (#22792)
* [swift6][client] make PromiseKit as deprecated

* [swift6][client] make PromiseKit as deprecated

* [swift6][client] make PromiseKit as deprecated
2026-01-23 17:02:26 +00:00
dependabot[bot]
ab42a1bef2 build(deps-dev): bump tar (#22793)
Bumps [tar](https://github.com/isaacs/node-tar) from 7.5.3 to 7.5.6.
- [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.3...v7.5.6)

---
updated-dependencies:
- dependency-name: tar
  dependency-version: 7.5.6
  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-24 00:51:29 +08:00
dependabot[bot]
943b80bbb4 build(deps-dev): bump tar (#22785)
Bumps [tar](https://github.com/isaacs/node-tar) from 7.5.3 to 7.5.6.
- [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.3...v7.5.6)

---
updated-dependencies:
- dependency-name: tar
  dependency-version: 7.5.6
  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-23 23:52:46 +08:00
dependabot[bot]
6ad16aaf7b build(deps-dev): bump tar (#22786)
Bumps [tar](https://github.com/isaacs/node-tar) from 7.5.3 to 7.5.6.
- [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.3...v7.5.6)

---
updated-dependencies:
- dependency-name: tar
  dependency-version: 7.5.6
  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-23 23:52:29 +08:00
Bruno Coelho
db7d39f622 [swift5][client] soft deprecate Swift 5 generator (#22789)
* [swift5][client] deprecate Swift 5 generator

* [swift5][client] deprecate Swift 5 generator
2026-01-23 15:50:46 +00:00
dependabot[bot]
acb80bac95 build(deps-dev): bump lodash (#22783)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.21...4.17.23)

---
updated-dependencies:
- dependency-name: lodash
  dependency-version: 4.17.23
  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-23 16:28:07 +08:00
dependabot[bot]
b15636e3e9 build(deps): bump lodash (#22782)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.21...4.17.23)

---
updated-dependencies:
- dependency-name: lodash
  dependency-version: 4.17.23
  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-23 16:27:59 +08:00
William Cheng
8a3507cfa7 update logback to newer version (#22781) 2026-01-23 15:55:16 +08:00
Bruno Coelho
2707e5101c [swift6][client] mark some closures as sendable (#22776) 2026-01-22 16:29:48 +00:00
William Cheng
cc045ab53c Fix output of bin/generate-samples.sh in tmux (#22772)
* bin/generate-samples: Remove warning about sleep

The sleep itself has been commented out for a long time (commit
04fa53b692 from September 2023, to be specific).

Signed-off-by: Stephen Finucane <stephen@that.guru>

* bin/generate-samples: Fix output on tmux

Commit 23dae2bcd8 reworked this script to start capturing exceptions
but the mechanism used was crude and broke output on tmux, since
`/dev/pts/0` is hardcoded to a specific pseudo-terminal but each tmux
pane gets its own pts. Rework this to use files instead.

Signed-off-by: Stephen Finucane <stephen@that.guru>

* update error message, trigger build failur

* trigger build failure

* Revert "trigger build failure"

This reverts commit 29536fab8a.

* add back null check

---------

Signed-off-by: Stephen Finucane <stephen@that.guru>
Co-authored-by: Stephen Finucane <stephen@that.guru>
2026-01-22 19:01:42 +08:00
Erwin de Haan
29befb95d2 Make TokenProvider not contain state so subclassing actually works correctly with JIT requested tokens (for long lived ApiClients) (#22233) 2026-01-22 18:44:38 +08:00
Erwin de Haan
3f9465edcb Support multi targetting (#22234) 2026-01-22 18:41:07 +08:00
William Cheng
2c463d9167 update C# samples 2026-01-22 17:15:29 +08:00
Erwin de Haan
5cffc45428 C# GenericHost support multiple accept headers and allow access to HttpContentHeaders on response (#22232)
* Add support for other Accept header values or full arrays when multiple options are present.

* Expose ContentHeaders on ApiResponse, to access ContentDisposition for example with file downloads.

* Update samples and documentation

* Fix build warning in samples
2026-01-22 16:48:03 +08:00
William Cheng
6fc64e2115 add docstring to cpp-qt methods (#22770) 2026-01-22 16:46:13 +08:00
Martin Delille
a1c948df9f [cpp=qt] Add global server index setter for all operations (#22760) 2026-01-22 16:28:17 +08:00
dependabot[bot]
bf5ced7354 build(deps): bump lodash (#22769)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.23.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.23)

---
updated-dependencies:
- dependency-name: lodash
  dependency-version: 4.17.23
  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-22 13:34:22 +08:00
dependabot[bot]
a045531ca7 build(deps): bump lodash (#22766)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.21...4.17.23)

---
updated-dependencies:
- dependency-name: lodash
  dependency-version: 4.17.23
  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-22 13:31:40 +08:00
dependabot[bot]
b66c93a864 build(deps): bump lodash (#22765)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.21...4.17.23)

---
updated-dependencies:
- dependency-name: lodash
  dependency-version: 4.17.23
  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-22 13:31:27 +08:00
dependabot[bot]
ea0504b17e build(deps): bump lodash (#22764)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.21...4.17.23)

---
updated-dependencies:
- dependency-name: lodash
  dependency-version: 4.17.23
  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-22 13:31:14 +08:00
dependabot[bot]
f2a49b1c27 build(deps): bump lodash (#22763)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.21...4.17.23)

---
updated-dependencies:
- dependency-name: lodash
  dependency-version: 4.17.23
  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-22 13:31:01 +08:00
dependabot[bot]
c189e5c263 build(deps-dev): bump lodash (#22762)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.21...4.17.23)

---
updated-dependencies:
- dependency-name: lodash
  dependency-version: 4.17.23
  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-22 13:30:43 +08:00
William Cheng
0f23c4ff17 update java undertow to newer version (#22759) 2026-01-22 12:21:55 +08:00
dependabot[bot]
342febde58 build(deps): bump @angular/core (#22654)
Bumps [@angular/core](https://github.com/angular/angular/tree/HEAD/packages/core) from 19.0.1 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/core)

---
updated-dependencies:
- dependency-name: "@angular/core"
  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-21 17:12:34 +08:00
dependabot[bot]
4034201640 build(deps): bump diff and mocha (#22745)
Bumps [diff](https://github.com/kpdecker/jsdiff) to 4.0.4 and updates ancestor dependency [mocha](https://github.com/mochajs/mocha). These dependencies need to be updated together.


Updates `diff` from 4.0.2 to 4.0.4
- [Changelog](https://github.com/kpdecker/jsdiff/blob/master/release-notes.md)
- [Commits](https://github.com/kpdecker/jsdiff/compare/v4.0.2...v4.0.4)

Updates `mocha` from 10.2.0 to 10.8.2
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v10.2.0...v10.8.2)

---
updated-dependencies:
- dependency-name: diff
  dependency-version: 4.0.4
  dependency-type: indirect
- dependency-name: mocha
  dependency-version: 10.8.2
  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-21 16:28:51 +08:00
dependabot[bot]
4a61a4ca74 build(deps): bump diff and ts-node (#22746)
Bumps [diff](https://github.com/kpdecker/jsdiff) to 4.0.4 and updates ancestor dependency [ts-node](https://github.com/TypeStrong/ts-node). These dependencies need to be updated together.


Updates `diff` from 3.5.0 to 4.0.4
- [Changelog](https://github.com/kpdecker/jsdiff/blob/master/release-notes.md)
- [Commits](https://github.com/kpdecker/jsdiff/compare/v3.5.0...v4.0.4)

Updates `ts-node` from 3.3.0 to 10.9.2
- [Release notes](https://github.com/TypeStrong/ts-node/releases)
- [Changelog](https://github.com/TypeStrong/ts-node/blob/main/development-docs/release-template.md)
- [Commits](https://github.com/TypeStrong/ts-node/compare/v3.3.0...v10.9.2)

---
updated-dependencies:
- dependency-name: diff
  dependency-version: 4.0.4
  dependency-type: indirect
- dependency-name: ts-node
  dependency-version: 10.9.2
  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-21 16:28:41 +08:00
dependabot[bot]
b862290aec build(deps): bump actions/cache from 4 to 5 (#22749)
Bumps [actions/cache](https://github.com/actions/cache) from 4 to 5.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-21 16:26:40 +08:00
dependabot[bot]
52d910be41 build(deps): bump tar and @angular/cli (#22750)
Bumps [tar](https://github.com/isaacs/node-tar) to 7.5.5 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.5
- [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.5)

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.5
  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-21 16:26:28 +08:00
dependabot[bot]
3a670a697a build(deps-dev): bump tar (#22752)
Bumps [tar](https://github.com/isaacs/node-tar) from 7.5.3 to 7.5.6.
- [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.3...v7.5.6)

---
updated-dependencies:
- dependency-name: tar
  dependency-version: 7.5.6
  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-21 16:26:18 +08:00
dependabot[bot]
0f136af41d build(deps): bump qs, body-parser and express (#22684)
Bumps [qs](https://github.com/ljharb/qs), [body-parser](https://github.com/expressjs/body-parser) and [express](https://github.com/expressjs/express). These dependencies needed to be updated together.

Updates `qs` from 6.13.0 to 6.14.1
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/qs/compare/v6.13.0...v6.14.1)

Updates `body-parser` from 1.20.3 to 1.20.4
- [Release notes](https://github.com/expressjs/body-parser/releases)
- [Changelog](https://github.com/expressjs/body-parser/blob/master/HISTORY.md)
- [Commits](https://github.com/expressjs/body-parser/compare/1.20.3...1.20.4)

Updates `express` from 4.21.1 to 4.22.1
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/v4.22.1/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.21.1...v4.22.1)

---
updated-dependencies:
- dependency-name: qs
  dependency-version: 6.14.1
  dependency-type: indirect
- dependency-name: body-parser
  dependency-version: 1.20.4
  dependency-type: indirect
- dependency-name: express
  dependency-version: 4.22.1
  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-21 14:37:57 +08:00
Marc Schlegel
32d4085105 Mill plugin (#22739)
* Revert "remove mill plugin (#22736)"

This reverts commit 084a0a46b4.

* Add workaround for scaladoc generation in Scala 3 & additional update after revert
2026-01-21 03:48:12 +08:00
Masanori ITOH
3be911d0e6 [Normalizer] add type information to an error message and fix #22743 (#22742) 2026-01-21 02:44:35 +08:00
dsteeley
c34d593d8f fix: Fix rust-server model generation following serde_valid upgrade (#22737) 2026-01-20 14:30:00 +08:00
Matt Pollock
9a0d711cf6 [R] optionally skip parsing responses to R6 objects (#22705)
* optionally skip parsing responses to R6 objects

* parse -> .parse

* scope .parse to endpoints that return data

* move handling of .parsed so that it applies to both primitive and non-primitive return types

* try, try, again
2026-01-20 12:44:39 +08:00
William Cheng
9adfe986a3 Prepare v7.20.0 release (#22738)
* Revert "v7.19.0 release (#22732)"

This reverts commit ff400e9a31.

* prepare v7.20.0 release

* update samples

* update doc
2026-01-20 03:13:58 +08:00
William Cheng
084a0a46b4 remove mill plugin (#22736) 2026-01-20 01:23:24 +08:00
Marc Schlegel
a62ed1dd2a Add doc goal for scala-maven-plugin (#22734) 2026-01-19 23:49:23 +08:00
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
8710 changed files with 15668 additions and 13740 deletions

View File

@@ -21,7 +21,7 @@ jobs:
distribution: 'temurin'
- name: Restore cache (read-only)
# only use restore keys, no save key because we need to clear the cache before running the examples
uses: actions/cache/restore@v4
uses: actions/cache/restore@v5
with:
path: |
~/.m2/repository

View File

@@ -15,7 +15,7 @@
<div align="center">
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.19.0`):
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.20.0`):
[![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator)
[![Bitrise](https://img.shields.io/bitrise/4a2b10a819d12b67/master?label=bitrise%3A%20Swift+4,5&token=859FMDR8QHwabCzwvZK6vQ)](https://app.bitrise.io/app/4a2b10a819d12b67)
@@ -148,8 +148,8 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
| OpenAPI Generator Version | Release Date | Notes |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- |
| 7.19.0 (upcoming minor release) [SNAPSHOT](https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-to-test-with-the-latest-master-of-openapi-generator) | 22.01.2026 | Minor release with breaking changes (with fallback) |
| [7.18.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.18.0) (latest stable release) | 22.12.2025 | Minor release with breaking changes (with fallback) |
| 7.20.0 (upcoming minor release) [SNAPSHOT](https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-to-test-with-the-latest-master-of-openapi-generator) | 20.02.2026 | Minor release with breaking changes (with fallback) |
| [7.19.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.19.0) (latest stable release) | 20.01.2026 | Minor release with breaking changes (with fallback) |
| [6.6.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v6.6.0) | 11.05.2023 | Minor release with breaking changes (with fallback) |
| [5.4.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.4.0) | 31.01.2022 | Minor release with breaking changes (with fallback) |
| [4.3.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.3.1) | 06.05.2020 | Patch release (enhancements, bug fixes, etc) |
@@ -212,16 +212,16 @@ See the different versions of the [openapi-generator-cli](https://search.maven.o
<!-- RELEASE_VERSION -->
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 11 runtime at a minimum):
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.18.0/openapi-generator-cli-7.18.0.jar`
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.19.0/openapi-generator-cli-7.19.0.jar`
For **Mac/Linux** users:
```sh
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.18.0/openapi-generator-cli-7.18.0.jar -O openapi-generator-cli.jar
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.19.0/openapi-generator-cli-7.19.0.jar -O openapi-generator-cli.jar
```
For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.
```
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.18.0/openapi-generator-cli-7.18.0.jar
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.19.0/openapi-generator-cli-7.19.0.jar
```
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
@@ -456,7 +456,7 @@ openapi-generator-cli version
To use a specific version of "openapi-generator-cli"
```sh
openapi-generator-cli version-manager set 7.18.0
openapi-generator-cli version-manager set 7.19.0
```
Or install it as dev-dependency:
@@ -480,7 +480,7 @@ pip install openapi-generator-cli
To install a specific version
```
pip install openapi-generator-cli==7.18.0
pip install openapi-generator-cli==7.19.0
```
You can also install with [jdk4py](https://github.com/activeviam/jdk4py) instead of java binary. (python>=3.10 is required)
@@ -506,7 +506,7 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat
(if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php -o c:\temp\php_api_client`)
<!-- RELEASE_VERSION -->
You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.18.0/openapi-generator-cli-7.18.0.jar)
You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.19.0/openapi-generator-cli-7.19.0.jar)
<!-- /RELEASE_VERSION -->
To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate`

View File

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

View File

@@ -47,26 +47,26 @@ For example:
echo "$header"
if [[ ${#files[@]} -eq 1 && "${files[0]}" != *'*'* ]]; then
# shellcheck disable=SC2086
# shellcheck disable=SC2068
java ${JAVA_OPTS} -jar "$executable" generate -c ${files[0]} ${args[@]}
else
echo "Please press CTRL+C to stop or the script will continue in 5 seconds."
#sleep 5
if [ ${#files[@]} -eq 0 ]; then
files=("${root}"/bin/configs/*.yaml)
fi
tmpfile=$(mktemp)
trap "rm -f $tmpfile" EXIT
# shellcheck disable=SC2086
# shellcheck disable=SC2068
if java ${JAVA_OPTS} -jar "$executable" batch ${BATCH_OPTS} --includes-base-dir "${root}" --fail-fast -- ${files[@]} 2>&1 | tee /dev/pts/0 | grep -q -i "exception"; then
echo "Found exception(s) when running the generator(s) to update the samples."
export GENERATE_ERROR=1
fi
if [[ ${#files[@]} -eq 1 && "${files[0]}" != *'*'* ]]; then
# shellcheck disable=SC2086
# shellcheck disable=SC2068
java ${JAVA_OPTS} -jar "$executable" generate -c ${files[0]} ${args[@]} 2>&1 | tee "$tmpfile"
retcode=${PIPESTATUS[0]}
else
if [ ${#files[@]} -eq 0 ]; then
files=("${root}"/bin/configs/*.yaml)
fi
# shellcheck disable=SC2086
# shellcheck disable=SC2068
java ${JAVA_OPTS} -jar "$executable" batch ${BATCH_OPTS} --includes-base-dir "${root}" --fail-fast -- ${files[@]} 2>&1 | tee "$tmpfile"
retcode=${PIPESTATUS[0]}
fi
if [[ -n "$GENERATE_ERROR" ]]; then
if [[ $retcode -ne 0 ]] || grep -q -i "at org.openapitools" "$tmpfile"; then
echo "Found exception(s) when running the generator(s) to update the samples."
exit 1
fi

View File

@@ -68,7 +68,7 @@ The following generators are available:
* [scala-sttp4-jsoniter (beta)](generators/scala-sttp4-jsoniter.md)
* [scalaz](generators/scalaz.md)
* [swift-combine](generators/swift-combine.md)
* [swift5](generators/swift5.md)
* [swift5 (deprecated)](generators/swift5.md)
* [swift6](generators/swift6.md)
* [typescript (experimental)](generators/typescript.md)
* [typescript-angular](generators/typescript-angular.md)

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

@@ -7,7 +7,7 @@ title: Documentation for the swift5 Generator
| Property | Value | Notes |
| -------- | ----- | ----- |
| generator name | swift5 | pass this to the generate command after -g |
| generator stability | STABLE | |
| generator stability | DEPRECATED | |
| generator type | CLIENT | |
| generator language | Swift | |
| generator default templating engine | mustache | |

View File

@@ -22,7 +22,7 @@ npm install @openapitools/openapi-generator-cli -g
To install a specific version of the tool, pass the version during installation:
<!-- RELEASE_VERSION -->
```bash
openapi-generator-cli version-manager set 7.17.0
openapi-generator-cli version-manager set 7.19.0
```
<!-- /RELEASE_VERSION -->
To install the tool as a dev dependency in your current project:
@@ -119,18 +119,18 @@ docker run --rm \
<!-- RELEASE_VERSION -->
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 11 runtime at a minimum):
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.17.0/openapi-generator-cli-7.17.0.jar`
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.19.0/openapi-generator-cli-7.19.0.jar`
For **Mac/Linux** users:
```bash
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.17.0/openapi-generator-cli-7.17.0.jar -O openapi-generator-cli.jar
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.19.0/openapi-generator-cli-7.19.0.jar -O openapi-generator-cli.jar
```
For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.
```powershell
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.17.0/openapi-generator-cli-7.17.0.jar
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.19.0/openapi-generator-cli-7.19.0.jar
```
<!-- /RELEASE_VERSION -->

View File

@@ -16,7 +16,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase)
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>7.17.0</version>
<version>7.19.0</version>
<executions>
<execution>
<goals>
@@ -130,7 +130,7 @@ This Mill library provides a Mill module that can be used to generate code from
```scala
//| mill-version: 1.0.6
//| mvnDeps:
//| - org.openapitools:openapi-generator-mill-plugin:7.19.0 # 1.
//| - org.openapitools:openapi-generator-mill-plugin:7.20.0 # 1.
import mill.*

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.20.0-SNAPSHOT</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.20.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@@ -97,7 +97,7 @@ task validateGoodSpec(type: org.openapitools.generator.gradle.plugin.tasks.Valid
[source,group]
----
plugins {
id "org.openapi.generator" version "7.17.0"
id "org.openapi.generator" version "7.19.0"
}
----
@@ -113,7 +113,7 @@ buildscript {
// url "https://plugins.gradle.org/m2/"
}
dependencies {
classpath "org.openapitools:openapi-generator-gradle-plugin:7.17.0"
classpath "org.openapitools:openapi-generator-gradle-plugin:7.19.0"
}
}
@@ -759,7 +759,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath('org.openapitools:openapi-generator-gradle-plugin:7.17.0') {
classpath('org.openapitools:openapi-generator-gradle-plugin:7.19.0') {
exclude group: 'com.google.guava'
}
}

View File

@@ -1,5 +1,5 @@
# RELEASE_VERSION
openApiGeneratorVersion=7.19.0-SNAPSHOT
openApiGeneratorVersion=7.20.0-SNAPSHOT
# /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.20.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../../pom.xml</relativePath>
</parent>

View File

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

View File

@@ -12,7 +12,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase)
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.17.0</version>
<version>7.19.0</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>

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.20.0-SNAPSHOT</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.20.0-SNAPSHOT</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.20.0-SNAPSHOT</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.20.0-SNAPSHOT</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.20.0-SNAPSHOT</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.20.0-SNAPSHOT</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.20.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../../pom.xml</relativePath>
</parent>

View File

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

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.20.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../../pom.xml</relativePath>
</parent>
@@ -139,6 +139,28 @@
<goal>testCompile</goal>
</goals>
</execution>
<execution>
<!-- see https://github.com/davidB/scala-maven-plugin/issues/604 why a workaround is needed -->
<id>attach-javadocs</id>
<goals>
<goal>doc-jar</goal>
</goals>
<configuration>
<scaladocClassName>dotty.tools.scaladoc.Main</scaladocClassName>
<sourceDir>${project.build.outputDirectory}</sourceDir>
<args>-nobootcp</args>
<includes>
<include>**/*.tasty</include>
</includes>
<dependencies>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scaladoc_3</artifactId>
<version>3.7.4</version>
</dependency>
</dependencies>
</configuration>
</execution>
</executions>
</plugin>
<plugin>

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.20.0-SNAPSHOT</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.20.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@@ -1854,7 +1854,7 @@ public class OpenAPINormalizer {
schema.addAnyOfItem(new BooleanSchema());
break;
default:
LOGGER.error("Type {} not yet supported in openapi-normalizer to process OpenAPI 3.1 spec with multiple types.");
LOGGER.error("Type {} not yet supported in openapi-normalizer to process OpenAPI 3.1 spec with multiple types.", String.valueOf(type));
LOGGER.error("Please report the issue via https://github.com/OpenAPITools/openapi-generator/issues/new/.");
}
}

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

@@ -134,7 +134,7 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig
this.useOneOfInterfaces = true;
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
.stability(Stability.STABLE)
.stability(Stability.DEPRECATED)
.build();
outputFolder = "generated-code" + File.separator + "swift";
@@ -430,6 +430,8 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig
public void processOpts() {
super.processOpts();
LOGGER.warn("IMPORTANT: This generator has been deprecated. Please use `swift6` instead");
if (StringUtils.isEmpty(System.getenv("SWIFT_POST_PROCESS_FILE"))) {
LOGGER.info("Environment variable SWIFT_POST_PROCESS_FILE not defined so the Swift code may not be properly formatted. To define it, try 'export SWIFT_POST_PROCESS_FILE=/usr/local/bin/swiftformat' (Linux/Mac)");
LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI).");

View File

@@ -491,6 +491,9 @@ public class Swift6ClientCodegen extends DefaultCodegen implements CodegenConfig
additionalProperties.put(RESPONSE_AS, responseAs);
if (ArrayUtils.contains(responseAs, RESPONSE_LIBRARY_PROMISE_KIT)) {
additionalProperties.put("usePromiseKit", true);
LOGGER.warn("NOTICE: We are considering deprecating PromiseKit support in the Swift 6 generator. " +
"If you are still using it, please share your use case here: " +
"https://github.com/OpenAPITools/openapi-generator/issues/22791");
}
if (ArrayUtils.contains(responseAs, RESPONSE_LIBRARY_RX_SWIFT)) {
additionalProperties.put("useRxSwift", true);

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

@@ -220,7 +220,7 @@ for this project used jakarta.validation-api -->
<swagger-core-version>1.5.22</swagger-core-version>
<jetty-version>9.2.9.v20150224</jetty-version>
<junit-version>4.13.2</junit-version>
<logback-version>1.5.19</logback-version>
<logback-version>1.5.25</logback-version>
{{#useBeanValidation}}
<beanvalidation-version>2.0.2</beanvalidation-version>
{{/useBeanValidation}}

View File

@@ -342,7 +342,7 @@ for this project used jakarta.validation-api -->
{{/generateSpringApplication}}
{{^generateSpringBootApplication}}
<junit-version>4.13.2</junit-version>
<logback-version>1.5.19</logback-version>
<logback-version>1.5.25</logback-version>
{{/generateSpringBootApplication}}
<cxf-version>3.5.9</cxf-version>
<jackson-jaxrs-version>2.17.1</jackson-jaxrs-version>

View File

@@ -255,7 +255,7 @@ for this project used jakarta.validation-api -->
{{/swagger2AnnotationLibrary}}
<jetty-version>9.2.9.v20150224</jetty-version>
<junit-version>4.13.2</junit-version>
<logback-version>1.5.19</logback-version>
<logback-version>1.5.25</logback-version>
{{#useBeanValidation}}
<beanvalidation-version>2.0.2</beanvalidation-version>
{{/useBeanValidation}}

View File

@@ -311,7 +311,7 @@ for this project used jakarta.validation-api -->
{{/swagger2AnnotationLibrary}}
<jetty-version>9.2.9.v20150224</jetty-version>
<junit-version>4.13.2</junit-version>
<logback-version>1.5.19</logback-version>
<logback-version>1.5.25</logback-version>
{{#useBeanValidation}}
<beanvalidation-version>2.0.2</beanvalidation-version>
{{/useBeanValidation}}

View File

@@ -222,7 +222,7 @@
<jersey3-version>3.1.3</jersey3-version>
<jackson-version>2.17.1</jackson-version>
<junit-version>4.13.2</junit-version>
<logback-version>1.5.19</logback-version>
<logback-version>1.5.25</logback-version>
<servlet-api-version>5.0.0</servlet-api-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

View File

@@ -222,7 +222,7 @@ for this project used jakarta.validation-api -->
<jersey2-version>2.35</jersey2-version>
<jackson-version>2.17.1</jackson-version>
<junit-version>4.13.2</junit-version>
<logback-version>1.5.19</logback-version>
<logback-version>1.5.25</logback-version>
<servlet-api-version>4.0.4</servlet-api-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

View File

@@ -133,6 +133,13 @@ If your endpoint has multiple server objects in the servers array, you can set t
void setServerIndex(const QString &operation, int serverIndex);
```
Parameter "operation" should be your operationid. "serverIndex" is the index you want to set as your default server. The function will check if there is a server with your index.
Alternatively, to set the server index globally for all operations:
```c++
void setServerIndex(int serverIndex);
```
This will apply the specified server index to all operations in the API.
Here is an example of multiple servers in the servers array. The first server will have index 0 and the second will have index 1.
```yaml
servers:

View File

@@ -57,9 +57,9 @@ void {{classname}}::initializeServerConfigs() {
}
/**
* returns 0 on success and -1, -2 or -3 on failure.
* -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found
*/
* returns 0 on success and -1, -2 or -3 on failure.
* -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found
*/
int {{classname}}::setDefaultServerValue(int serverIndex, const QString &operation, const QString &variable, const QString &value) {
auto it = _serverConfigs.find(operation);
if (it != _serverConfigs.end() && serverIndex < it.value().size()) {
@@ -67,12 +67,24 @@ int {{classname}}::setDefaultServerValue(int serverIndex, const QString &operati
}
return -3;
}
/**
* Sets the server index.
* @param operation The id to the target operation.
* @param serverIndex The server index.
*/
void {{classname}}::setServerIndex(const QString &operation, int serverIndex) {
if (_serverIndices.contains(operation) && serverIndex < _serverConfigs.find(operation).value().size()) {
_serverIndices[operation] = serverIndex;
}
}
void {{classname}}::setServerIndex(int serverIndex) {
for (auto keyIt = _serverIndices.keyBegin(); keyIt != _serverIndices.keyEnd(); keyIt++) {
setServerIndex(*keyIt, serverIndex);
}
}
void {{classname}}::setApiKey(const QString &apiKeyName, const QString &apiKey) {
_apiKeys.insert(apiKeyName, apiKey);
}
@@ -103,13 +115,13 @@ void {{classname}}::setNetworkAccessManager(QNetworkAccessManager* manager) {
}
/**
* Appends a new ServerConfiguration to the config map for a specific operation.
* @param operation The id to the target operation.
* @param url A string that contains the URL of the server
* @param description A String that describes the server
* @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template.
* returns the index of the new server config on success and -1 if the operation is not found
*/
* Appends a new ServerConfiguration to the config map for a specific operation.
* @param operation The id to the target operation.
* @param url A string that contains the URL of the server
* @param description A String that describes the server
* @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template.
* returns the index of the new server config on success and -1 if the operation is not found
*/
int {{classname}}::addServerConfiguration(const QString &operation, const QUrl &url, const QString &description, const QMap<QString, {{prefix}}ServerVariable> &variables) {
if (_serverConfigs.contains(operation)) {
_serverConfigs[operation].append({{prefix}}ServerConfiguration(
@@ -123,11 +135,11 @@ int {{classname}}::addServerConfiguration(const QString &operation, const QUrl &
}
/**
* Appends a new ServerConfiguration to the config map for a all operations and sets the index to that server.
* @param url A string that contains the URL of the server
* @param description A String that describes the server
* @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template.
*/
* Appends a new ServerConfiguration to the config map for a all operations and sets the index to that server.
* @param url A string that contains the URL of the server
* @param description A String that describes the server
* @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template.
*/
void {{classname}}::setNewServerForAllOperations(const QUrl &url, const QString &description, const QMap<QString, {{prefix}}ServerVariable> &variables) {
for (auto keyIt = _serverIndices.keyBegin(); keyIt != _serverIndices.keyEnd(); keyIt++) {
setServerIndex(*keyIt, addServerConfiguration(*keyIt, url, description, variables));
@@ -135,11 +147,11 @@ void {{classname}}::setNewServerForAllOperations(const QUrl &url, const QString
}
/**
* Appends a new ServerConfiguration to the config map for an operations and sets the index to that server.
* @param URL A string that contains the URL of the server
* @param description A String that describes the server
* @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template.
*/
* Appends a new ServerConfiguration to the config map for an operations and sets the index to that server.
* @param URL A string that contains the URL of the server
* @param description A String that describes the server
* @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template.
*/
void {{classname}}::setNewServer(const QString &operation, const QUrl &url, const QString &description, const QMap<QString, {{prefix}}ServerVariable> &variables) {
setServerIndex(operation, addServerConfiguration(operation, url, description, variables));
}

View File

@@ -30,6 +30,7 @@ public:
void initializeServerConfigs();
int setDefaultServerValue(int serverIndex,const QString &operation, const QString &variable,const QString &val);
void setServerIndex(const QString &operation, int serverIndex);
void setServerIndex(int serverIndex);
void setApiKey(const QString &apiKeyName, const QString &apiKey);
void setBearerToken(const QString &token);
void setUsername(const QString &username);

View File

@@ -49,6 +49,11 @@ namespace {{packageName}}.{{clientPackage}}
/// </summary>
System.Net.Http.Headers.HttpResponseHeaders Headers { get; }
/// <summary>
/// The headers contained in the api response related to the content
/// </summary>
System.Net.Http.Headers.HttpContentHeaders ContentHeaders { get; }
/// <summary>
/// The path used when making the request.
/// </summary>
@@ -106,6 +111,11 @@ namespace {{packageName}}.{{clientPackage}}
/// </summary>
public System.Net.Http.Headers.HttpResponseHeaders Headers { get; }
/// <summary>
/// The headers contained in the api response related to the content
/// </summary>
public System.Net.Http.Headers.HttpContentHeaders ContentHeaders { get; }
/// <summary>
/// The DateTime when the request was retrieved.
/// </summary>
@@ -144,6 +154,7 @@ namespace {{packageName}}.{{clientPackage}}
{
StatusCode = httpResponseMessage.StatusCode;
Headers = httpResponseMessage.Headers;
ContentHeaders = httpResponseMessage.Content.Headers;
IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode;
ReasonPhrase = httpResponseMessage.ReasonPhrase;
RawContent = rawContent;
@@ -167,6 +178,7 @@ namespace {{packageName}}.{{clientPackage}}
{
StatusCode = httpResponseMessage.StatusCode;
Headers = httpResponseMessage.Headers;
ContentHeaders = httpResponseMessage.Content.Headers;
IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode;
ReasonPhrase = httpResponseMessage.ReasonPhrase;
ContentStream = contentStream;
@@ -178,6 +190,7 @@ namespace {{packageName}}.{{clientPackage}}
OnCreated(httpRequestMessage, httpResponseMessage);
}
partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage);
}
{{#x-http-statuses-with-return}}

View File

@@ -18,6 +18,7 @@ using {{packageName}}.{{modelPackage}};
{{/-first}}
{{/models}}
using System.Runtime.CompilerServices;
using System.Net.Http.Headers;
{{>Assembly}}namespace {{packageName}}.{{clientPackage}}
{
@@ -311,6 +312,36 @@ using System.Runtime.CompilerServices;
return string.Join(",", accepts);
}
/// <summary>
/// Select the Accept header's value from the given accepts array:
/// if JSON exists in the given array, use it;
/// otherwise use all of them.
/// </summary>
/// <param name="accepts">The accepts array to select from.</param>
/// <returns>The Accept header values to use.</returns>
public static IEnumerable<MediaTypeWithQualityHeaderValue> SelectHeaderAcceptArray(string[] accepts)
{
if (accepts.Length == 0)
{{#net80OrLater}}
return [];
{{/net80OrLater}}
{{^net80OrLater}}
return Enumerable.Empty<MediaTypeWithQualityHeaderValue>();
{{/net80OrLater}}
if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase))
{{#net80OrLater}}
return [MediaTypeWithQualityHeaderValue.Parse("application/json")];
{{/net80OrLater}}
{{^net80OrLater}}
return new [] { MediaTypeWithQualityHeaderValue.Parse("application/json") };
{{/net80OrLater}}
return accepts.Select(MediaTypeWithQualityHeaderValue.Parse);
}
/// <summary>
/// Provides a case-insensitive check that a provided content type is a known JSON-like content type.
/// </summary>

View File

@@ -1,6 +1,5 @@
// <auto-generated>
{{>partial_header}}
{{#nrt}}
#nullable enable
@@ -17,21 +16,21 @@ namespace {{packageName}}.{{clientPackage}}
/// <typeparam name="TTokenBase"></typeparam>
{{>visibility}} class RateLimitProvider<TTokenBase> : TokenProvider<TTokenBase> where TTokenBase : TokenBase
{
internal Dictionary<string, global::System.Threading.Channels.Channel<TTokenBase>> AvailableTokens { get; } = new{{^net70OrLater}} Dictionary<string, global::System.Threading.Channels.Channel<TTokenBase>>{{/net70OrLater}}();
public Dictionary<string, global::System.Threading.Channels.Channel<TTokenBase>> AvailableTokens { get; } = new{{^net70OrLater}} Dictionary<string, global::System.Threading.Channels.Channel<TTokenBase>>{{/net70OrLater}}();
/// <summary>
/// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout.
/// </summary>
/// <param name="container"></param>
public RateLimitProvider(TokenContainer<TTokenBase> container) : base(container.Tokens)
public RateLimitProvider(TokenContainer<TTokenBase> container) : base()
{
foreach(TTokenBase token in _tokens)
foreach(TTokenBase token in container.Tokens)
token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40));
{{#lambda.copy}}
global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(_tokens.Length)
global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(container.Tokens.Count)
{
FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropWrite
FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropOldest
};
AvailableTokens.Add(string.Empty, global::System.Threading.Channels.Channel.CreateBounded<TTokenBase>(options));
@@ -45,7 +44,7 @@ namespace {{packageName}}.{{clientPackage}}
{
global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(apiKeyTokenContainer.Tokens.Count(t => ClientUtils.ApiKeyHeaderToString(t.Header).Equals(header)))
{
FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropWrite
FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropOldest
};
AvailableTokens.Add(header, global::System.Threading.Channels.Channel.CreateBounded<TTokenBase>(options));
@@ -65,7 +64,7 @@ namespace {{packageName}}.{{clientPackage}}
{{/hasApiKeyMethods}}
foreach (var availableToken in AvailableTokens)
foreach(TTokenBase token in _tokens)
foreach(TTokenBase token in container.Tokens)
{
{{#hasApiKeyMethods}}
if (token is ApiKeyToken apiKeyToken)
@@ -86,7 +85,7 @@ namespace {{packageName}}.{{clientPackage}}
}
/// <inheritdoc/>
protected internal override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}})
public override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}})
{
if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel<TTokenBase>{{nrt?}} tokens))
throw new KeyNotFoundException($"Could not locate a token for header '{header}'.");

View File

@@ -19,8 +19,8 @@ namespace {{packageName}}.{{clientPackage}}
internal TimeSpan? Timeout { get; set; }
internal delegate void TokenBecameAvailableEventHandler(object sender);
internal event TokenBecameAvailableEventHandler{{nrt?}} TokenBecameAvailable;
public delegate void TokenBecameAvailableEventHandler(object sender);
public event TokenBecameAvailableEventHandler{{nrt?}} TokenBecameAvailable;
/// <summary>

View File

@@ -1,6 +1,5 @@
// <auto-generated>
{{>partial_header}}
{{#nrt}}
#nullable enable
@@ -17,25 +16,6 @@ namespace {{packageName}}
/// </summary>
{{>visibility}} abstract class TokenProvider<TTokenBase> where TTokenBase : TokenBase
{
/// <summary>
/// The array of tokens.
/// </summary>
protected TTokenBase[] _tokens;
/// <summary>
/// Gets an authentication token to be used in request authorization.
/// </summary>
/// <param name="header"></param>
/// <param name="cancellation"></param>
protected internal abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}});
/// <summary>
/// Instantiates a TokenProvider.
/// </summary>
/// <param name="tokens"></param>
public TokenProvider(IEnumerable<TTokenBase> tokens)
{
_tokens = tokens.ToArray();
}
public abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}});
}
}

View File

@@ -8,6 +8,7 @@
{{/nrt}}
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
{{#net80OrLater}}
{{#lambda.uniqueLines}}
{{#operations}}
@@ -20,6 +21,7 @@ using System.Linq;
{{/lambda.uniqueLines}}
{{/net80OrLater}}
using System.Net;
using System.IO;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using System.Net.Http;
@@ -605,10 +607,10 @@ namespace {{packageName}}.{{apiPackage}}
{{#produces}}
{{#-first}}
string{{nrt?}} acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars);
IEnumerable<MediaTypeWithQualityHeaderValue> acceptHeaderValuesLocalVar = ClientUtils.SelectHeaderAcceptArray(acceptLocalVars);
if (acceptLocalVar != null)
httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar));
foreach (var acceptLocalVar in acceptHeaderValuesLocalVar)
httpRequestMessageLocalVar.Headers.Accept.Add(acceptLocalVar);
{{/-first}}
{{/produces}}
{{#net60OrLater}}

View File

@@ -36,13 +36,74 @@
<PackageReference Include="RestSharp" Version="112.0.0" />
{{/useRestSharp}}
{{#useGenericHost}}
<PackageReference Include="Microsoft.Extensions.Http" Version="{{#lambda.first}}{{#netStandard}}5.0.0 {{/netStandard}}{{#net47}}7.0.0 {{/net47}}{{#net48}}7.0.0 {{/net48}}{{#net6.0}}6.0.0 {{/net6.0}}{{#net7.0}}7.0.0 {{/net7.0}}{{#net8.0}}8.0.1 {{/net8.0}}{{#net9.0}}9.0.5 {{/net9.0}}{{#net10.0}}10.0.1 {{/net10.0}}{{/lambda.first}}" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="{{#lambda.first}}{{#netStandard}}5.0.0 {{/netStandard}}{{#net47}}7.0.0 {{/net47}}{{#net48}}7.0.0 {{/net48}}{{#net6.0}}6.0.1 {{/net6.0}}{{#net7.0}}7.0.1 {{/net7.0}}{{#net8.0}}8.0.1 {{/net8.0}}{{#net9.0}}9.0.5 {{/net9.0}}{{#net10.0}}10.0.1 {{/net10.0}}{{/lambda.first}}" />
{{#netStandard}}
<PackageReference Include="Microsoft.Extensions.Http" Condition="'$(TargetFramework)' == 'netstandard1.3' or '$(TargetFramework)' == 'netstandard1.4' or '$(TargetFramework)' == 'netstandard1.5' or '$(TargetFramework)' == 'netstandard1.6' or '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1'" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting" Condition="'$(TargetFramework)' == 'netstandard1.3' or '$(TargetFramework)' == 'netstandard1.4' or '$(TargetFramework)' == 'netstandard1.5' or '$(TargetFramework)' == 'netstandard1.6' or '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1'" Version="6.0.1" />
{{/netStandard}}
{{#net47}}
<PackageReference Include="Microsoft.Extensions.Http" Condition="'$(TargetFramework)' == 'net47' or '$(TargetFramework)' == 'net471' or '$(TargetFramework)' == 'net472'" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Condition="'$(TargetFramework)' == 'net47' or '$(TargetFramework)' == 'net471' or '$(TargetFramework)' == 'net472'" Version="7.0.0" />
{{/net47}}
{{#net48}}
<PackageReference Include="Microsoft.Extensions.Http" Condition="'$(TargetFramework)' == 'net48' or '$(TargetFramework)' == 'net481'" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Condition="'$(TargetFramework)' == 'net48' or '$(TargetFramework)' == 'net481'" Version="7.0.0" />
{{/net48}}
{{#net6.0}}
<PackageReference Include="Microsoft.Extensions.Http" Condition="'$(TargetFramework)' == 'net6.0'" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting" Condition="'$(TargetFramework)' == 'net6.0'" Version="6.0.1" />
{{/net6.0}}
{{#net7.0}}
<PackageReference Include="Microsoft.Extensions.Http" Condition="'$(TargetFramework)' == 'net7.0'" Version=7.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting" Condition="'$(TargetFramework)' == 'net7.0'" Version="7.0.1" />
{{/net7.0}}
{{#net8.0}}
<PackageReference Include="Microsoft.Extensions.Http" Condition="'$(TargetFramework)' == 'net8.0'" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting" Condition="'$(TargetFramework)' == 'net8.0'" Version="8.0.1" />
{{/net8.0}}
{{#net9.0}}
<PackageReference Include="Microsoft.Extensions.Http" Condition="'$(TargetFramework)' == 'net9.0'" Version="9.0.6" />
<PackageReference Include="Microsoft.Extensions.Hosting" Condition="'$(TargetFramework)' == 'net9.0'" Version="9.0.6" />
{{/net9.0}}
{{#net10.0}}
<PackageReference Include="Microsoft.Extensions.Http" Condition="'$(TargetFramework)' == 'net10.0'" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting" Condition="'$(TargetFramework)' == 'net10.0'" Version="10.0.1" />
{{/net10.0}}
{{#supportsRetry}}
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="{{#lambda.first}}{{#netStandard}}5.0.1 {{/netStandard}}{{#net47}}7.0.0 {{/net47}}{{#net48}}7.0.0 {{/net48}}{{#net6.0}}6.0.19 {{/net6.0}}{{#net7.0}}7.0.11 {{/net7.0}}{{#net8.0}}8.0.8 {{/net8.0}}{{#net9.0}}9.0.5 {{/net9.0}}{{#net10.0}}10.0.1 {{/net10.0}}{{/lambda.first}}" />
{{#netStandard}}
<PackageReference Include="Microsoft.Extensions.Http.Polly" Condition="'$(TargetFramework)' == 'netstandard1.3' or '$(TargetFramework)' == 'netstandard1.4' or '$(TargetFramework)' == 'netstandard1.5' or '$(TargetFramework)' == 'netstandard1.6' or '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1'" Version="5.0.1" />
{{/netStandard}}
{{#net47}}
<PackageReference Include="Microsoft.Extensions.Http.Polly" Condition="'$(TargetFramework)' == 'net47' or '$(TargetFramework)' == 'net471' or '$(TargetFramework)' == 'net472'" Version="7.0.0" />
{{/net47}}
{{#net48}}
<PackageReference Include="Microsoft.Extensions.Http.Polly" Condition="'$(TargetFramework)' == 'net48' or '$(TargetFramework)' == 'net481'" Version="7.0.0" />
{{/net48}}
{{#net6.0}}
<PackageReference Include="Microsoft.Extensions.Http.Polly" Condition="'$(TargetFramework)' == 'net6.0'" Version="6.0.36" />
{{/net6.0}}
{{#net7.0}}
<PackageReference Include="Microsoft.Extensions.Http.Polly" Condition="'$(TargetFramework)' == 'net7.0'" Version="7.0.20" />
{{/net7.0}}
{{#net8.0}}
<PackageReference Include="Microsoft.Extensions.Http.Polly" Condition="'$(TargetFramework)' == 'net8.0'" Version="8.0.20" />
{{/net8.0}}
{{#net9.0}}
<PackageReference Include="Microsoft.Extensions.Http.Polly" Condition="'$(TargetFramework)' == 'net9.0'" Version="9.0.6" />
{{/net9.0}}
{{#net10.0}}
<PackageReference Include="Microsoft.Extensions.Http.Polly" Condition="'$(TargetFramework)' == 'net10.0'" Version="10.0.1" />
{{/net10.0}}
{{/supportsRetry}}
{{#net80OrLater}}
<PackageReference Include="Microsoft.Net.Http.Headers" Version="{{#lambda.first}}{{#net8.0}}8.0.8 {{/net8.0}}{{#net9.0}}9.0.5 {{/net9.0}}{{#net10.0}}10.0.1 {{/net10.0}}{{/lambda.first}}" />
{{#net8.0}}
<PackageReference Include="Microsoft.Net.Http.Headers" Condition="'$(TargetFramework)' == 'net8.0'" Version="8.0.17" />
{{/net8.0}}
{{#net9.0}}
<PackageReference Include="Microsoft.Net.Http.Headers" Condition="'$(TargetFramework)' == 'net9.0'" Version="9.0.6" />
{{/net9.0}}
{{#net10.0}}
<PackageReference Include="Microsoft.Net.Http.Headers" Condition="'$(TargetFramework)' == 'net10.0'" Version="10.0.1" />
{{/net10.0}}
{{/net80OrLater}}
{{^net60OrLater}}
<PackageReference Include="System.Threading.Channels" Version="8.0.0" />

View File

@@ -29,7 +29,7 @@
<version.logback>1.5.19</version.logback>
<version.junit>4.13.2</version.junit>
<version.mockito>2.1.0-beta.124</version.mockito>
<version.undertow>2.3.20.Final</version.undertow>
<version.undertow>2.3.21.Final</version.undertow>
<version.jsonpath>2.2.0</version.jsonpath>
<version.httpclient>4.5.13</version.httpclient>
<version.httpasyncclient>4.1.2</version.httpasyncclient>

View File

@@ -142,10 +142,13 @@
#' @param data_file (optional) name of the data file to save the result
{{/returnType}}
#' @param ... Other optional arguments
{{#returnType}}
#' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text.
{{/returnType}}
#'
#' @return {{{returnType}}}{{^returnType}}void{{/returnType}}
{{{operationId}}} = function({{#requiredParams}}{{paramName}}, {{/requiredParams}}{{#optionalParams}}{{paramName}} = {{^defaultValue}}NULL{{/defaultValue}}{{{defaultValue}}}, {{/optionalParams}}{{#vendorExtensions.x-streaming}}stream_callback = NULL, {{/vendorExtensions.x-streaming}}{{#returnType}}data_file = NULL, {{/returnType}}...) {
local_var_response <- self${{{operationId}}}{{WithHttpInfo}}({{#allParams}}{{paramName}}, {{/allParams}}{{#vendorExtensions.x-streaming}}stream_callback = stream_callback, {{/vendorExtensions.x-streaming}}{{#returnType}}data_file = data_file, {{/returnType}}...)
{{{operationId}}} = function({{#requiredParams}}{{paramName}}, {{/requiredParams}}{{#optionalParams}}{{paramName}} = {{^defaultValue}}NULL{{/defaultValue}}{{{defaultValue}}}, {{/optionalParams}}{{#vendorExtensions.x-streaming}}stream_callback = NULL, {{/vendorExtensions.x-streaming}}{{#returnType}}data_file = NULL, {{/returnType}}...{{#returnType}}, .parse = TRUE{{/returnType}}) {
local_var_response <- self${{{operationId}}}{{WithHttpInfo}}({{#allParams}}{{paramName}}, {{/allParams}}{{#vendorExtensions.x-streaming}}stream_callback = stream_callback, {{/vendorExtensions.x-streaming}}{{#returnType}}data_file = data_file, {{/returnType}}...{{#returnType}}, .parse = .parse{{/returnType}})
{{#vendorExtensions.x-streaming}}
if (typeof(stream_callback) == "closure") { # return void if streaming is enabled
return(invisible(NULL))
@@ -178,9 +181,12 @@
#' @param data_file (optional) name of the data file to save the result
{{/returnType}}
#' @param ... Other optional arguments
{{#returnType}}
#' @param .parse Logical. If \code{TRUE} then the response will be parsed to a generated type. If \code{FALSE} the response will be returned as unparsed text.
{{/returnType}}
#'
#' @return API response ({{{returnType}}}{{^returnType}}void{{/returnType}}) with additional information such as HTTP status code, headers
{{{operationId}}}{{WithHttpInfo}} = function({{#requiredParams}}{{paramName}}, {{/requiredParams}}{{#optionalParams}}{{paramName}} = {{^defaultValue}}NULL{{/defaultValue}}{{{defaultValue}}}, {{/optionalParams}}{{#vendorExtensions.x-streaming}}stream_callback = NULL, {{/vendorExtensions.x-streaming}}{{#returnType}}data_file = NULL, {{/returnType}}...) {
{{{operationId}}}{{WithHttpInfo}} = function({{#requiredParams}}{{paramName}}, {{/requiredParams}}{{#optionalParams}}{{paramName}} = {{^defaultValue}}NULL{{/defaultValue}}{{{defaultValue}}}, {{/optionalParams}}{{#vendorExtensions.x-streaming}}stream_callback = NULL, {{/vendorExtensions.x-streaming}}{{#returnType}}data_file = NULL, {{/returnType}}...{{#returnType}}, .parse = TRUE{{/returnType}}) {
args <- list(...)
query_params <- list()
header_params <- c()
@@ -559,6 +565,10 @@
if (!is.null(data_file)) {
self$api_client$WriteFile(local_var_resp, data_file)
}
if (!.parse) {
local_var_resp$content <- local_var_resp$response_as_text()
return(local_var_resp)
}
ApiResponse$new(content = content, response = resp, status_code = local_var_resp$status_code)
{{/isPrimitiveType}}
@@ -567,6 +577,10 @@
if (!is.null(data_file)) {
self$api_client$WriteFile(local_var_resp, data_file)
}
if (!.parse) {
local_var_resp$content <- local_var_resp$response_as_text()
return(local_var_resp)
}
deserialized_resp_obj <- tryCatch(
self$api_client$DeserializeResponse(local_var_resp, "{{returnType}}"),

View File

@@ -106,6 +106,17 @@ impl std::ops::DerefMut for {{{classname}}} {
}
}
{{^hasConflictingModelNames}}
#[cfg(feature = "validate")]
impl serde_valid::validation::ValidateCompositedMinLength for {{{classname}}} {
fn validate_composited_min_length(
&self,
_min_length: usize,
) -> Result<(), serde_valid::validation::Composited<serde_valid::validation::error::MinLengthError>> {
Ok(())
}
}
{{/hasConflictingModelNames}}
{{#exts.x-to-string-support}}
{{#exts.x-is-string}}
impl std::fmt::Display for {{{classname}}} {
@@ -364,13 +375,13 @@ pub struct {{{classname}}} {
)]
{{/hasConflictingModelNames}}
{{/hasValidation}}
{{#required}}
{{^hasConflictingModelNames}}{{>validate}}{{/hasConflictingModelNames}}
{{^hasConflictingModelNames}}
{{#exts.x-needs-nested-validation}}
#[cfg_attr(feature = "validate", validate)]
{{^minLength}}{{^maxLength}}{{^minItems}}{{^maxItems}}#[cfg_attr(feature = "validate", validate)]{{/maxItems}}{{/minItems}}{{/maxLength}}{{/minLength}}
{{/exts.x-needs-nested-validation}}
{{/hasConflictingModelNames}}
{{#required}}
pub {{{name}}}: {{{dataType}}},
{{/required}}
{{^required}}
@@ -378,9 +389,10 @@ pub struct {{{classname}}} {
#[serde(deserialize_with = "swagger::nullable_format::deserialize_optional_nullable")]
#[serde(default = "swagger::nullable_format::default_optional_nullable")]
{{/isNullable}}
{{^hasConflictingModelNames}}{{>validate}}{{/hasConflictingModelNames}}
{{^hasConflictingModelNames}}
{{#exts.x-needs-nested-validation}}
#[cfg_attr(feature = "validate", validate)]
{{^minLength}}{{^maxLength}}{{^minItems}}{{^maxItems}}#[cfg_attr(feature = "validate", validate)]{{/maxItems}}{{/minItems}}{{/maxLength}}{{/minLength}}
{{/exts.x-needs-nested-validation}}
{{/hasConflictingModelNames}}
#[serde(skip_serializing_if="Option::is_none")]

View File

@@ -94,9 +94,7 @@ extension {{projectName}}API {
- parameter apiConfiguration: The configuration for the http request.{{/apiStaticMethod}}
- returns: Promise<{{{returnType}}}{{#returnType}}{{#isResponseOptional}}?{{/isResponseOptional}}{{/returnType}}{{^returnType}}Void{{/returnType}}>
*/
{{#isDeprecated}}
@available(*, deprecated, message: "This operation is deprecated.")
{{/isDeprecated}}
@available(*, deprecated, message: "{{#isDeprecated}}This operation is deprecated. | {{/isDeprecated}}NOTICE: We are considering deprecating PromiseKit support in the Swift 6 generator. If you are still using it, please share your use case here: https://github.com/OpenAPITools/openapi-generator/issues/22791")
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} {{#apiStaticMethod}}class {{/apiStaticMethod}}func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#apiStaticMethod}}{{#hasParams}}, {{/hasParams}}apiConfiguration: {{projectName}}APIConfiguration = {{projectName}}APIConfiguration.shared{{/apiStaticMethod}}) -> Promise<{{{returnType}}}{{#returnType}}{{#isResponseOptional}}?{{/isResponseOptional}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {
let deferred = Promise<{{{returnType}}}{{#returnType}}{{#isResponseOptional}}?{{/isResponseOptional}}{{/returnType}}{{^returnType}}Void{{/returnType}}>.pending()
{{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#apiStaticMethod}}{{#hasParams}}, {{/hasParams}}apiConfiguration: apiConfiguration{{/apiStaticMethod}}).execute { result in

View File

@@ -242,7 +242,7 @@ fileprivate class URLSessionRequestBuilderConfiguration: @unchecked Sendable {
}
}
fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, httpResponse: HTTPURLResponse, error: Error?, completion: @escaping (_ result: Swift.Result<Response<T>, ErrorResponse>) -> Void) {
fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, httpResponse: HTTPURLResponse, error: Error?, completion: @Sendable @escaping (_ result: Swift.Result<Response<T>, ErrorResponse>) -> Void) {
switch T.self {
case is Void.Type:
@@ -320,7 +320,7 @@ fileprivate class URLSessionRequestBuilderConfiguration: @unchecked Sendable {
}
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class URLSessionDecodableRequestBuilder<T: Decodable>: URLSessionRequestBuilder<T>, @unchecked Sendable {
override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, httpResponse: HTTPURLResponse, error: Error?, completion: @escaping (_ result: Swift.Result<Response<T>, ErrorResponse>) -> Void) {
override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, httpResponse: HTTPURLResponse, error: Error?, completion: @Sendable @escaping (_ result: Swift.Result<Response<T>, ErrorResponse>) -> Void) {
switch T.self {
case is String.Type:
@@ -398,7 +398,7 @@ fileprivate class URLSessionRequestBuilderConfiguration: @unchecked Sendable {
}
fileprivate final class SessionDelegate: NSObject, URLSessionTaskDelegate {
func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @Sendable @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling
@@ -458,7 +458,7 @@ private class FormDataEncoding: ParameterEncoding {
let contentTypeForFormPart: (_ fileURL: URL) -> String?
init(contentTypeForFormPart: @escaping (_ fileURL: URL) -> String?) {
init(contentTypeForFormPart: @Sendable @escaping (_ fileURL: URL) -> String?) {
self.contentTypeForFormPart = contentTypeForFormPart
}
@@ -712,19 +712,19 @@ extension JSONDataEncoding: ParameterEncoding {}
}
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} protocol OpenAPIInterceptor {
func intercept<T>(urlRequest: URLRequest, urlSession: URLSessionProtocol, requestBuilder: RequestBuilder<T>, completion: @escaping (Result<URLRequest, Error>) -> Void)
func intercept<T>(urlRequest: URLRequest, urlSession: URLSessionProtocol, requestBuilder: RequestBuilder<T>, completion: @Sendable @escaping (Result<URLRequest, Error>) -> Void)
func retry<T>(urlRequest: URLRequest, urlSession: URLSessionProtocol, requestBuilder: RequestBuilder<T>, data: Data?, response: URLResponse?, error: Error, completion: @escaping (OpenAPIInterceptorRetry) -> Void)
func retry<T>(urlRequest: URLRequest, urlSession: URLSessionProtocol, requestBuilder: RequestBuilder<T>, data: Data?, response: URLResponse?, error: Error, completion: @Sendable @escaping (OpenAPIInterceptorRetry) -> Void)
}
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} class DefaultOpenAPIInterceptor: OpenAPIInterceptor {
public init() {}
public func intercept<T>(urlRequest: URLRequest, urlSession: URLSessionProtocol, requestBuilder: RequestBuilder<T>, completion: @escaping (Result<URLRequest, any Error>) -> Void) {
public func intercept<T>(urlRequest: URLRequest, urlSession: URLSessionProtocol, requestBuilder: RequestBuilder<T>, completion: @Sendable @escaping (Result<URLRequest, any Error>) -> Void) {
completion(.success(urlRequest))
}
public func retry<T>(urlRequest: URLRequest, urlSession: URLSessionProtocol, requestBuilder: RequestBuilder<T>, data: Data?, response: URLResponse?, error: Error, completion: @escaping (OpenAPIInterceptorRetry) -> Void) {
public func retry<T>(urlRequest: URLRequest, urlSession: URLSessionProtocol, requestBuilder: RequestBuilder<T>, data: Data?, response: URLResponse?, error: Error, completion: @Sendable @escaping (OpenAPIInterceptorRetry) -> Void) {
completion(.dontRetry)
}
}

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.20.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<url>https://github.com/openapitools/openapi-generator</url>
<scm>

View File

@@ -1 +1 @@
7.19.0-SNAPSHOT
7.20.0-SNAPSHOT

View File

@@ -6,7 +6,7 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap
- API version: 0.1.0
- SDK version: 1.0.0
- Generator version: 7.19.0-SNAPSHOT
- Generator version: 7.20.0-SNAPSHOT
- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
<a id="frameworks-supported"></a>

View File

@@ -1 +1 @@
7.19.0-SNAPSHOT
7.20.0-SNAPSHOT

View File

@@ -7,7 +7,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat
- API version: 0.1.0
- Package version: 1.0.0
- Generator version: 7.19.0-SNAPSHOT
- Generator version: 7.20.0-SNAPSHOT
- Build package: org.openapitools.codegen.languages.GoClientCodegen
## Installation

View File

@@ -1 +1 @@
7.19.0-SNAPSHOT
7.20.0-SNAPSHOT

View File

@@ -7,7 +7,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat
- API version: 0.1.0
- Package version: 1.0.0
- Generator version: 7.19.0-SNAPSHOT
- Generator version: 7.20.0-SNAPSHOT
- Build package: org.openapitools.codegen.languages.GoClientCodegen
## Installation

View File

@@ -1 +1 @@
7.19.0-SNAPSHOT
7.20.0-SNAPSHOT

View File

@@ -4,7 +4,7 @@ Echo Server API
- API version: 0.1.0
- Generator version: 7.19.0-SNAPSHOT
- Generator version: 7.20.0-SNAPSHOT
Echo Server API

View File

@@ -80,7 +80,7 @@ import org.openapitools.client.auth.Authentication;
import org.openapitools.client.auth.HttpBasicAuth;
import org.openapitools.client.auth.HttpBearerAuth;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.19.0-SNAPSHOT")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
public class ApiClient extends JavaTimeFormatter {
protected Map<String, String> defaultHeaderMap = new HashMap<String, String>();
protected Map<String, String> defaultCookieMap = new HashMap<String, String>();

View File

@@ -16,7 +16,7 @@ package org.openapitools.client;
import java.util.Map;
import java.util.List;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.19.0-SNAPSHOT")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
public class ApiException extends Exception {
private static final long serialVersionUID = 1L;

View File

@@ -17,7 +17,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
import java.util.Collections;
import java.util.Map;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.19.0-SNAPSHOT")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
public abstract class BaseApi {
protected ApiClient apiClient;

View File

@@ -17,7 +17,7 @@ import java.util.Objects;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Supplier;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.19.0-SNAPSHOT")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
public class Configuration {
public static final String VERSION = "0.1.0";

View File

@@ -20,7 +20,7 @@ import java.time.format.DateTimeParseException;
* Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class.
* It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}.
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.19.0-SNAPSHOT")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
public class JavaTimeFormatter {
private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME;

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