Compare commits

...

139 Commits

Author SHA1 Message Date
William Cheng
5c7b8b64b7 update samples 2025-10-29 18:22:37 +08:00
William Cheng
044bd9c63e Merge branch 'bugfix/fix-formparams-defaultvalue' of https://github.com/JoseLora/openapi-generator into JoseLora-bugfix/fix-formparams-defaultvalue 2025-10-29 18:19:47 +08:00
William Cheng
3d4f29eac7 [PYTHON-FASTAPI] update starlette to newer version 0.49.1 (#22243)
* update starlette to newer version 0.49.1

* update fastapi to newer version
2025-10-29 15:18:27 +08:00
William Cheng
351b601368 openapi-normalizer: Add REMOVE_PROPERTIES_FROM_TYPE_OTHER_THAN_OBJECT normalize option (#22236)
* fix bug 21680: Introduce REMOVE_PROPERTIES_FROM_TYPE_OTHER_THAN_OBJECT normalize option

* Advise to use REMOVE_PROPERTIES_FROM_TYPE_OTHER_THAN_OBJECT

* update doc

---------

Co-authored-by: Guillaume ALAMOME <guillaume.alamome@gmail.com>
2025-10-28 13:54:49 +08:00
Jason Frey
2c248e6c93 [ruby] Introduce ApiModelBase (#22052)
The Ruby code that is generated copies numerous methods into every
model. This creates bloat both in file size and run-time memory usage.
This commit introduces a base class for all models to store common
methods. This commit's focus is only on static methods that do not
change between models.
2025-10-28 12:42:51 +08:00
Eddie Sholl
68b0dfe6d1 Expose mtls certificate config params in python and php configuration templates (#22229)
* Expose mtls config params in python template

* Expose certFile and keyFile configuration items to support mtls in php generated client

* Regenerate of examples
2025-10-28 12:33:05 +08:00
Leon Linhart
31e462dc3e Make Gradle properties non-nullable (#22050)
They were never really intended to support null values, so this is kind of a bug. However, this is technically also breaking for users that set these properties to `null` explicitly (instead of leaving them unset).
2025-10-27 15:18:08 +08:00
Elliott Kember
74488fa3c3 Update modelOneOf.mustache (#22220)
Adds booleans to modelOneOf
2025-10-27 15:15:57 +08:00
William Cheng
8c54f18f7c remove BACKTICK_PLAN.md 2025-10-27 14:56:13 +08:00
Anshul Singhvi
57d12811ef [Julia] Fix docstring parameter formatting with backticks (#22190)
* [Julia] Fix docstring parameter formatting with backticks

Wrap parameter names in backticks in generated Julia client docstrings
to prevent markdown from misinterpreting underscores as italic formatting.

This fixes an issue where parameter names like `pet_id`, `api_key`, and
`additional_metadata` would render incorrectly in documentation, with
underscores being treated as markdown italic markers instead of literal
characters.

Related issue: JuliaComputing/OpenAPI.jl#72

* Also wrap data types and return types in backticks

* Regenerate Julia client samples with backticked docstrings

* [Julia] Add backticks to all markdown documentation templates

Extend backtick formatting to markdown documentation templates for
both Julia client and server generators. This ensures consistent
markdown rendering of identifiers with underscores.

Changes:
- julia-client/api_doc.mustache: Add backticks to function signatures,
  parameter names, types, and return types in markdown API docs
- julia-server/api_doc.mustache: Same changes for server API docs
- julia-client/model_doc.mustache: Add backticks to property names and
  types in markdown model documentation
- julia-server/model_doc.mustache: Same changes for server model docs

All generated markdown files now properly display identifiers like
`pet_id`, `Custom_Type`, `update_pet_with_form` with literal
underscores instead of broken italic formatting.

Related to JuliaComputing/OpenAPI.jl#72
2025-10-27 14:55:35 +08:00
lbilger
676efae183 [Java] Add import for java.util.Arrays if there is a set property in a model. Arrays.asList is used when initializing the property if it has a default value. (#22207) 2025-10-27 14:55:10 +08:00
Rens Groothuijsen
a4d05b38f5 [go] Correctly set default array value on query parameters (#22060) 2025-10-27 10:30:08 +08:00
Mattias Sehlstedt
75ae04ecfd Fix so that the x-field-extra-annotation properly split any array items (#22226)
* Fix so that the x-field-extra-annotation properly split any array items

* Add a unit test to show that the annotations are generated as expected
2025-10-27 09:56:38 +08:00
rignicat
808d106e0c [jaxrs] Support jackson option (true by default) (#22169)
* allow configuring jackson, remove jackson import if disabled

* do not generate root resource or application file if generating interface

* change template files to remove jackson if disabled

* updated samples and docs as required by PR checklist
2025-10-27 09:56:07 +08:00
William Cheng
9d810e0fbb update jackson databind nullable to v0.2.8 (#22230) 2025-10-27 00:35:51 +08:00
Kevin Liddle
91a499b8c6 [rust-axum] Fix polymorphic type discriminators (#22222)
* [rust-axum] Make discriminator field name camelCase

* [rust-axum] Give polymorphic enum values a serde alias using the mapping keys if available

* update samples

* update test file checksum
2025-10-25 22:43:56 +08:00
dependabot[bot]
eda2e67b94 Bump actions/download-artifact from 5 to 6 (#22225)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '6'
  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>
2025-10-25 17:31:18 +08:00
Rens Groothuijsen
8643bc1d66 [python-fastapi] Remove additional slashes in query regex (#22223) 2025-10-25 17:16:17 +08:00
dependabot[bot]
2b22d172da Bump actions/upload-artifact from 4 to 5 (#22224)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  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>
2025-10-25 17:14:59 +08:00
William Cheng
d605afeef5 update vertx-web to 4.x 2025-10-23 10:32:20 +08:00
William Cheng
6eff628139 update logback to newer versions (#22204) 2025-10-22 18:51:38 +08:00
William Cheng
1d071288f8 use path from spec in ts angular documentation (#22194) 2025-10-21 15:40:48 +08:00
dependabot[bot]
816befc466 Bump vite and @angular-devkit/build-angular (#22192)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) to 6.4.1 and updates ancestor dependency [@angular-devkit/build-angular](https://github.com/angular/angular-cli). These dependencies need to be updated together.


Updates `vite` from 6.3.6 to 6.4.1
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/create-vite@6.4.1/packages/vite)

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

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 6.4.1
  dependency-type: indirect
- dependency-name: "@angular-devkit/build-angular"
  dependency-version: 19.2.17
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-21 15:08:27 +08:00
William Cheng
3d00fd2adc update C# samples 2025-10-21 11:40:43 +08:00
Fabian Buchenberger
00d16496c8 [csharp] do not use deprecated HttpRequestMessage.Properties (#20737) 2025-10-21 10:58:47 +08:00
William Cheng
57752d190c add cache: gradle to java setup workflow (#22183) 2025-10-20 17:15:36 +08:00
William Cheng
6572d5d9a6 Use JDK11 for kotlin-server projects (#22182)
* use jdk11 for kotlin server projects

* test with jdk11 by default
2025-10-20 16:54:50 +08:00
William Cheng
c15ba67fc9 update kotlin-spring projects to use jdk11 (#22181) 2025-10-20 15:48:10 +08:00
William Cheng
63ddce0c1b default REFACTOR_ALLOF_WITH_PROPERTIES_ONLY to true (#22180) 2025-10-20 11:39:09 +08:00
Kevin Liddle
01139e6963 [rust-axum] don't include quotes in output string from Display trait for string types (#22161)
* [rust-axum] don't include quotes in output string from Display trait for string types

* [rust-axum] update samples
2025-10-20 10:35:18 +08:00
Sven Allers
e7dae1a81e Custom error messages for size, length, min & max validations in Spring & Spring-Kotlin (#22090)
* Custom error messages for size, length, min & max validations in Spring & Spring-Kotlin

* Run scripts
2025-10-19 21:25:03 +08:00
Ilia
4e7bba659b [dart] Fix compile error in inline enum properties with "default" values(#22120) (#22165) 2025-10-19 20:47:20 +08:00
jpfinne
88bba259e9 OpenApiNormalizer FILTER improvements. Multi filters + filter on path (#22128)
* Use Filter Parser and allow multiple filters

* OpenAPINormalizer fails for invalid FILTER syntax

* Fix typo

* Use constants for filter keys.
Improve exception handling and tests.

* Fix format missing Locale.ROOT

* Make Filter extensible

* Additional unit test for invalid filter
2025-10-18 22:39:44 +08:00
William Cheng
8c85e3cedc [typescript-axios] Add support for AWSv4 Signature (#22174)
* [typescript-axios] Add support for AWSv4 Signature

* update typescript-axios.md file

* update doc

---------

Co-authored-by: qasim <qasim@calo.app>
2025-10-18 16:52:24 +08:00
Jérémy Reynard
d840c495c4 [FEAT] Support nullable Array<org.springframework.web.multipart.MultipartFile> in Kotlin-Spring generator (#21994)
* Support nullable `org.springframework.web.multipart.MultipartFile` in Kotlin Spring generator

- nullable is only supported for MultipartFile. However, Array<MultipartFile> could be also nullable

* Support nullable `org.springframework.web.multipart.MultipartFile` in Kotlin Spring generator

* Support nullable `org.springframework.web.multipart.MultipartFile` in Kotlin Spring generator

Update kotlin-spring-additionalproperties samples
2025-10-18 16:44:19 +08:00
Martin Tomašovič
7c000687e4 [csharp][generichost] Fix DateOnly parsing (#22099)
* Fix DateOnly parsing

* update samples
2025-10-18 14:58:36 +08:00
Mattias Sehlstedt
23a2aafe91 [CSHARP] Fix how the array type is set when using NULLABLE_REFERENCE_TYPES (#22071)
* Fix how the type is calculated for deep inline arrays

* Add list alias objects to petstore specification and regenerate samples
2025-10-18 14:58:08 +08:00
daberni
2afe7d29cd [Spring] Remove unnecessary modifiers from API interface templates (#22132)
* public static final String PATH_

* regenerate samples
2025-10-18 14:56:59 +08:00
William Cheng
6ede03d546 remove includeEndpointUrl (#22173) 2025-10-18 14:52:51 +08:00
Rostislav Svoboda
ee85775afd chore: Misc cleanup related to deprecations (#22172)
* Replace deprecated StringUtils.startsWith methods

* Add missing @Deprecated annotations
2025-10-18 14:52:19 +08:00
Robin Csutorás
94e8997cc7 [typescript-angular] Add includeEndpointUrl option to include endpoint URLs in generated service comments (#22152)
Adds a new boolean option 'includeEndpointUrl' that, when enabled, includes endpoint URL information as JSDoc comments in generated service methods and interfaces. This helps developers quickly identify the HTTP method and path for each API operation.

Co-authored-by: Robin Csutoras <robin.csutoras@Robins-Laptop.local>
2025-10-18 14:35:58 +08:00
jheyens
552ab4c6d5 Java-wiremock: Correctly handle multiple MIME-types in HTTP-Accept-headers (#22133)
* Java-wiremock: Allow matching multiple Accept-header values

* Wiremock: Ignore casing when matching requests' Content-Type headers

* Java-wiremock: Regenerate samples
2025-10-18 14:27:03 +08:00
daberni
2b00bab60a [Spring] Optimize and omit unnecessary imports on Api in ApiController templates (#22164)
* Optimize imports

* remove unnecessary blank line

* revert unintended indentation
2025-10-18 14:19:35 +08:00
Zach Hornback
ccd43a5ce4 [python-fastapi] Fix: Skip sorting of path operations (#22163) (#22166)
* [python-fastapi] Fix: Skip sorting of path operations (#22163)

Make use of helpful code added in
243f501aef to skip sorting of path
parameters.  In FastAPI, order matters, see link for details:
https://fastapi.tiangolo.com/tutorial/path-params/?h=path#order-matters

Issue: https://github.com/OpenAPITools/openapi-generator/issues/22163

* Update samples after previous commit

Reading comprehension is hard.  I missed the part of step 3 where
samples would be updated in response to the change I had previous
submitted.

Via this commit, update samples to match expectations.  The order of
various endpoint implementations is now changed in the sample, matchcing
the order in the yaml files that created them.
2025-10-18 14:18:15 +08:00
Rens Groothuijsen
592c262277 Set default value for isOauth field (#22162) 2025-10-17 15:49:26 +08:00
Bradford Hovinen
40b9d69d5a Support deprecated API endpoints in reqwest-based Rust clients (#22131)
Previously, if an API endpoint was marked deprecated, this fact was not
reflected in the generated Rust clients using the reqwest library. We
want to know exactly when our client code is using a deprecated endpoint,
so marking the corresponding functions with the `#[deprecatd]` attribute
would be very helpful. Uses of the endpoint would then be picked up by
linters so that we can react.

This adds a line to the template which marks functions generated from
deprecated endpoints with the `#[deprecated]` attribute.

This does not touch any of the other client generators for Rust or any
other language, since they are out of scope for our needs.

Co-authored-by: Bradford Hovinen <bho@qwello.eu>
2025-10-16 19:41:28 +08:00
CG
323f978674 fix(kotlin-spring): the generated RequestHeader defaultValue for String parameters contains duplicated double quotes (#22123) 2025-10-16 18:34:33 +08:00
William Cheng
4fe1c4ac73 feat(typescript-fetch): add docs support (#22110)
* feat(typescript-fetch): add docs support

fixes #18276

* chore: regenerate

- generate-samples.sh
- export_docs_generators.sh

* chore: address PR feedback

* update samples

* update samples

* clean up unused files

---------

Co-authored-by: Aaron Heckmann <aaron@plane.so>
2025-10-16 18:21:41 +08:00
monksy
ecaf3ea48a Removed a duplicate binding for an address for rust-server (#22116)
* Removed a duplicate binding for an address for rust-server. The address binding happens higher up in the method.

* Updated samples.
2025-10-16 17:04:41 +08:00
jheyens
ce1e9e0866 Jersey2/3: Fixes a bug in OAuth token renewal, where the previous HTTP 401 code is reused even after the retry succeeds (#22134)
* Jersey2/3: Fix a bug where, when using OAuth, the HTTP 401 status code persisted even if the second request after renewing the Bearer access token succeeded

* Jersey2/3: Regenerate samples
2025-10-16 16:32:05 +08:00
Adnan
fc12a1b63a feat(rust-axum): make the Object value public (#22144)
* feat(rust-axum): make the Object value public

* feat(rust-axum): regenerate samples
2025-10-16 15:01:19 +08:00
William Cheng
bce0ea65fe CircleCI: clean up unused tests/setup (#22158)
* clean up circleci tests

* ignore .angular

* trigger build failure

* Revert "trigger build failure"

This reverts commit ee228266b1.
2025-10-16 14:50:41 +08:00
Linh Tran Tuan
117042aa44 [Rust-Axum] Fix wrong validation for non-model Body (#22155)
* Fix Issue 21143

* Update
2025-10-16 14:25:01 +08:00
William Cheng
c680f39ad7 Fix TypeScript Angular v20 tests with correct versions (#22156)
* fix ts angular v20 tetss with correct versions

* restore old version

* fix pom.xml
2025-10-16 14:14:11 +08:00
William Cheng
211f51702d Update package.json manually in angular v19 tests (#22151)
* update package.json manually in angular v19 tests

* fix angular v19 tests

* remove declarations
2025-10-15 21:25:01 +08:00
sermler
a4a24a8168 [typescript-fetch] Rework fix infinite recursion with self-referencing discriminator mappings (#22149)
* Prevent ConcurrentModificationException

* Update typescript-fetch samples

* Add fixture sample

* Update samples
2025-10-15 19:25:45 +08:00
William Cheng
cbb27163a0 Add samples to test jaxrs spec (withXml option enabled) (#22148)
* add samples to test jaxrs spec with xml option enabled

* add new files
2025-10-15 18:11:19 +08:00
William Cheng
fdbabee87e Add tests for typescript angular v17, v18, v20 (#22145)
* add tests for angular v17, v18, v20

* trigger build failure

* Revert "trigger build failure"

This reverts commit bab6448ed1.

* update samples
2025-10-15 18:08:52 +08:00
William Cheng
cdd120d976 update samples 2025-10-15 17:53:01 +08:00
maushomu
9d110fcb6b [Java][jaxrs-spec] withXml support (#22140)
* withXml support in pojo.mustache

* Create xmlPojoAnnotation.mustache

* withXml support in enumClass.mustache
2025-10-15 17:43:15 +08:00
Robert Marsal
57324efd48 fix: typescript docs not being put in a docs directory (#22124)
* fix: typescript docs not being put in a docs directory

* fix: platform agnostic path separator
2025-10-15 17:13:51 +08:00
William Cheng
21d29dacc2 Add tests for TypeScript Angular v19 (#22139)
* add tests for ts angular v19

* fix transfer cache
2025-10-15 16:36:03 +08:00
dependabot[bot]
c27f9c3ebc Bump actions/setup-java from 4 to 5 (#22137)
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 4 to 5.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-java
  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>
2025-10-15 16:30:14 +08:00
William Cheng
486e0c5e61 Test TypeScript Angular v16 in Github workflow (#22138)
* test ts angular v16 in github workflow

* trigger build failure

* Revert "trigger build failure"

This reverts commit c7987599a9.
2025-10-15 14:51:40 +08:00
sermler
4bedcb754b [typescript-fetch] Fix infinite recursion with self-referencing discriminator mappings (#21956)
* Add selfReferencingDiscriminatorMapping to ExtendedCodegenModel

* Add selfReferencingDiscriminatorMapping to template
2025-10-14 13:39:58 +02:00
William Cheng
89b0bc48fa Add workflow to test TypeScript clients (#22126)
* add workflow to test ts clients

* update

* update

* run petstore

* update

* trigger build
2025-10-14 16:33:29 +08:00
Ivan Leb
0b9172ef5c add cache to efficiently lookup CodegenModel in csharp codegen (#22094)
Co-authored-by: ivan_leb <ivan_leb@mail.ru>
2025-10-14 15:13:26 +08:00
Raymond Carino
b199901aab [fix] Apply REMOVE_X_INTERNAL normalizer to nested inline properties (#22097)
* fix: Apply REMOVE_X_INTERNAL normalizer to nested inline properties

When REMOVE_X_INTERNAL=true is set, the normalizer removes the x-internal
extension from top-level schemas in components/schemas but fails to remove
it from inline object properties within those schemas.

This causes issues when:
1. A schema is imported cross-file (e.g., admin.yaml imports from chat.yaml)
2. That schema has an inline object property with x-internal: true
3. The inline property has type: object with nested properties

Result: TypeScript generator creates a type reference but no interface
definition, causing compilation errors.

This fix applies the same x-internal removal logic to normalizeProperties()
that already exists in normalizeComponentsSchemas(), ensuring inline
properties are handled consistently.

Fixes behavior for inline schemas with x-internal in cross-file imports.

* Update modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* test: Add test case for REMOVE_X_INTERNAL with inline properties

Adds test to verify that REMOVE_X_INTERNAL normalizer correctly removes
x-internal extension from inline object properties, not just top-level schemas.

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Revert "Apply suggestion from @Copilot"

This reverts commit c899e9ec96.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-14 14:44:59 +08:00
William Cheng
941a5ccf13 Add workflow to test TypeScript server (#22125)
* add workflow to test TS servers

* fix path

* trigger build failure

* Revert "trigger build failure"

This reverts commit a0bf0199d3.

* remove ts server tests in circleci
2025-10-14 13:50:59 +08:00
Simon Podlipsky
5f13c53825 fix(php,php-nextgen): remove useless string cast from ObjectSerializer.mustache (#22121) 2025-10-14 13:14:02 +08:00
Beppe Catanese
1240d103ff [Typescript]: add deprecated tags for attributes (#22108)
* Add deprecated annotation when attribute is deprecated

* Generate samples
2025-10-13 08:44:35 +02:00
Mattias Sehlstedt
42af4f9529 Move all vendor extension definitions within AbstractCSharpCodegen to CodegenConstants. Then adjust other usages of those same vendor extension definitions to the created constants. (#22112) 2025-10-12 23:21:17 +08:00
Sarvesh Mungurwadi
81a3488556 fixed Bean Validation pattern (#19748) 2025-10-12 09:27:15 +08:00
William Cheng
08da0abfca remove unused files in java samples (#22105) 2025-10-11 00:51:11 +08:00
Artem Shubovych
fb277f82d5 [java] [spring] Fix annotationLibrary option being ignored in spring generator (#22046)
* Fix annotationLibrary option being ignored in spring generator

* Generate sample code

* Sample generator weirdness

* Revert "Sample generator weirdness"
2025-10-11 00:15:04 +08:00
Amaury Graillat
6b1b5cc4c5 Update c curl generator to support float (#21103)
* [C-Curl] Client generator does not handle float properly (#21092)

- Change function signature to float*
- Change generator to convert float to string
- Similar change for double and long

* [C-Curl] Client generator does not handle float properly (#21092)

- Generate samples
- Fix generator for headers and path params

* Revert "[C-Curl] Client generator does not handle float properly (#21092)"

This reverts commit ba044a65d5.

* Revert "[C-Curl] Client generator does not handle float properly (#21092)"

This reverts commit f99c5b0382.

* [C-Curl] Client generator does not handle float properly (#21092)

- Convert float, double and long to string
- Generate samples

* [C-Curl] Client generator does not handle float properly (#21092)

- Add missing yaml example file

* [C-Curl] Client generator does not handle float properly (#21092)

- Transfer float and double in scientific notation with resp. 7 and 16 decimals
- Adapt string size to number of required characters

* [C-Curl] Client generator does not handle float properly (#21092)

- Fix unused variable.
- Fix snprintf string

* * [C-Curl] Client generator does not handle float properly (#21092)

- Generating samples

* * [C-Curl] Client generator does not handle float properly (#21092)

- Always allocate the exact string size
2025-10-08 14:23:45 +08:00
dependabot[bot]
fd84c8fbd6 Bump s4u/setup-maven-action from 1.18.0 to 1.19.0 (#22085)
Bumps [s4u/setup-maven-action](https://github.com/s4u/setup-maven-action) from 1.18.0 to 1.19.0.
- [Release notes](https://github.com/s4u/setup-maven-action/releases)
- [Commits](https://github.com/s4u/setup-maven-action/compare/v1.18.0...v1.19.0)

---
updated-dependencies:
- dependency-name: s4u/setup-maven-action
  dependency-version: 1.19.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-07 10:46:42 +08:00
dependabot[bot]
f092f72cc5 Bump actions/setup-node from 4 to 5 (#22086)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4 to 5.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-node
  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>
2025-10-07 10:46:23 +08:00
Antoine Reilles
37cac71f87 [java-cxf-cdi] @Api description is deprecated (#22083)
@Api(description=...) is deprecated.
Remove its usage: it is not used by swagger-ui, and generated warnings
at build
2025-10-07 02:10:20 +08:00
José María Lora
3cf4994ba2 Merge branch 'master' into bugfix/fix-formparams-defaultvalue 2025-10-06 19:40:07 +02:00
Timo Schwarz
b8d805980a Spring 7 WebClient Compatibility (#22030)
* Update Spring Boot dependency for WebClient

* Adapt WebClient ApiClient to change in HttpHeaders with Spring 7

---------

Co-authored-by: Timo Schwarz <timo.schwarz@bredex.de>
2025-10-06 21:07:57 +08:00
William Cheng
b49ec6e033 [fix][elixir] missing type mapping for AnyType (#22081)
* fix: unmapped anytype

* add tests for any type in elixir client

---------

Co-authored-by: Enrique Fernandez <enrique@bluelabs.eu>
2025-10-06 15:10:10 +08:00
Mattias Sehlstedt
4352a2fcd0 [Test] [Java] Add test example of how to handle x-parent without REF_AS_PARENT_IN_ALLOF normalization (#22058)
* Add test to illustrate example of how to handle x-parent without REF_AS_PARENT_IN_ALLOF normalization

* Minor change to retrigger build
2025-10-06 13:07:50 +08:00
William Cheng
6f3dacafc4 update ts samples 2025-10-06 01:45:35 +08:00
Sebastien Dionne
2d2e1c41c4 Fix typos and linguistic errors in documentation (#22078) 2025-10-06 01:32:00 +08:00
William Cheng
a955bead08 Migrate JS tests to Github workflows (#22077)
* update samples

* fix name

* update

* remove

* clean up test
2025-10-06 01:11:49 +08:00
jpfinne
d7b79a26c6 [Spring] add support for api versioning. Fix #22027 (#22028)
* Add spring api versioning support

* Do not add version if not requested

* Fix duplicate VendorExtensions

* Improve description

* Fix removal of RequestMapping version attribute if x-spring-api-version: '' is set at the operation level
2025-10-03 19:59:38 +08:00
William Cheng
1d7d399ec2 fix additional properties handling in 3.1 spec (#22056) 2025-10-03 11:06:39 +08:00
William Cheng
4121803442 update php samples 2025-10-03 10:02:59 +08:00
benkarrer-lab
602549cb36 php: render tag description in Api docs (api_doc.mustache) via operationTagDescription (#14395) (#22064)
Co-authored-by: benkarrer-lab <benkarrer-lab@users.noreply.github.com>
2025-10-03 09:57:32 +08:00
dependabot[bot]
1c082c7287 Bump gradle/actions from 4 to 5 (#22061)
Bumps [gradle/actions](https://github.com/gradle/actions) from 4 to 5.
- [Release notes](https://github.com/gradle/actions/releases)
- [Commits](https://github.com/gradle/actions/compare/v4...v5)

---
updated-dependencies:
- dependency-name: gradle/actions
  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>
2025-10-02 15:27:53 +08:00
Jean-Marc Le Roux
7ab9364094 [Rust] Configurable default features from reqwest dependency (#22041)
* fix(rust): Remove default features from reqwest dependency

This change removes the default features (specifically native-tls) from the reqwest
dependency in the Rust client generator. This allows users to explicitly choose
their TLS backend without automatically including openssl-sys as a transitive dependency.

Users can now explicitly enable TLS backends using feature flags:
- native-tls
- rustls-tls
- default-tls

Fixes #21933

* feat(rust): Add reqwestDefaultFeatures option with backward-compatible default

This change adds a new generator option `reqwestDefaultFeatures` that allows
users to configure the default Cargo features for the reqwest dependency.

The option accepts:
- An array of strings in YAML config: reqwestDefaultFeatures: ["native-tls"]
- A comma-separated string via CLI: --additional-properties=reqwestDefaultFeatures=native-tls
- An empty value for no defaults: reqwestDefaultFeatures: []

Default value: ["native-tls"] (maintains backward compatibility)

This addresses the feedback in #21933 to make the change opt-in rather than
breaking existing users.

Users can now:
- Keep the current behavior (default)
- Opt-out: reqwestDefaultFeatures: []
- Use alternative TLS: reqwestDefaultFeatures: ["rustls-tls"]
- Combine features: reqwestDefaultFeatures: ["native-tls", "cookies"]

Fixes #21933
2025-10-02 01:47:08 +08:00
Ilia
28e7e7f2eb [kotlin] Add AnyOf/oneOf to multiplatform (#22035) 2025-10-02 01:44:54 +08:00
Mattias Sehlstedt
e8a688a724 Define codegen vendor extensions in CodegenConstants (#22054)
* Add an enum to centralize common internal vendor extensions used for Codegen processing

* Extend the normalizer tests to illustrate that an AllOfs with several refs have all of them marked as parents

* Add x-internal to the Codegen vendor extensions

* Move the Codegen vendor extensions into CodegenConstants

* Add assertion to JavaClient CodegenTest
2025-10-02 01:44:11 +08:00
Beppe Catanese
ddb15d4b9d Delete docs/generators/postman.md (#22044) 2025-09-29 19:01:36 +08:00
William Cheng
885ea07b17 Prepare 7.17.0 (#22040)
* Revert "v7.16.0 release"

This reverts commit 31299af0fc.

* prepare 7.17.0-SNAPSHOT

* update doc, samples
2025-09-28 17:25:13 +08:00
William Cheng
c0b72ee970 update readme with 7.16.0 2025-09-28 16:23:38 +08:00
William Cheng
ee76a05def v7.16.0 release (#22039) 2025-09-28 16:01:01 +08:00
William Cheng
30096d63b7 Revert "fix(rust): Add anyOf support to Rust client generator (#21896)" (#22038)
This reverts commit ee40887d47.
2025-09-28 12:23:50 +08:00
Yonatan Karp-Rudin
44a3be170f fix(kotlin-spring): add missing constructor parentheses for hashmap models (#22029)
* fix(kotlin-spring): add missing constructor parentheses for hashmap models

This commit fixes a bug in the kotlin-spring generator where models
defined with additionalProperties would result in uncompilable code.
The generated data class was missing the constructor invocation '()'
when inheriting from a map type.

This has been corrected to only add parentheses when the parent is a map.

The existing samples have been regenerated to reflect this change.

* Trigger CI
2025-09-27 22:06:05 +08:00
Linh Tran Tuan
e38f6c0580 [Rust-Axum] Support AnyOf, AllOf (#21948)
* Support AnyOf, AllOf

* Update

* Fix

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update
2025-09-27 16:01:37 +08:00
Viacheslav Zavoruev
2afac1aa28 [typescript-axios]: withSeparateModelsAndApi handles importFileExtension (#22032)
Separate models are located in `modelPackage` folder with `index.ts` file. ESM requires an index file with the provided extension when `importFileExtension` is defined.
2025-09-27 09:55:26 +02:00
Alex Kondratev
bab5ca2452 [python] add async httpx support (#22021)
* [python] fix #19255 add async httpx support

* update docs

* 1. "async" parameter for templates
2. hand written tests for python-httpx
3. CI workflow updated

* fix mypy
2025-09-27 15:30:50 +08:00
William Cheng
c1931c10da Add tests with optional body for go-server (#22034)
* add tests with optional body for go-server

* update workfllow
2025-09-27 14:28:28 +08:00
Ihar Hrachyshka
d8d9744154 go: Fix missing imports for optional body params. (#22014)
Previous mustache template was using #isBodyParam outside of #operation
context, so it was not effective.

Even if we'd add the proper context, we'd then risk generating duplicate
imports for multiple matching parameters.

For this reason, this patch implements detection of an optional body
parameter in code, making sure the corresponding import is added just
once.

Fixes #19237
2025-09-27 14:16:53 +08:00
KaizenCode
dc0d5c6839 replace deprecated 'typings' field with standard 'types' in package.json (#21371)
* replace deprecated 'typings' field with standard 'types' in package.json

* regenerate samples after replacing 'typings' with 'types' field

---------

Co-authored-by: winiga <winiga@rocketmail.com>
2025-09-25 14:23:43 +02:00
jpfinne
89edad5b8a Add vendorExtensions.x-class-extra-annotation to oneOf interfaces (#22020) 2025-09-25 15:40:12 +08:00
William Cheng
258d971f42 kotlin client: add docstring to new function (#22025)
* kotlin client: add docstring

* fix
2025-09-25 15:09:47 +08:00
daberni
5e8dcc9f07 [kotlin] Fix defaultValue in query parameters (#22002) 2025-09-25 15:02:15 +08:00
William Cheng
67b24330c9 Add tests for jaxrs cxf swagger2 client (#22019)
* add test for jaxrs cxf swagger2 client

* revert
2025-09-24 17:15:08 +08:00
fwermelskirchen
f02acaf27e [cxf] add support for Swagger2 (#22010)
* [cxf] add support for Swagger2

Closes #3668

* regen samples

* regen docs

* unconditionally include parameter imports

* Add swagger2 update samples

---------

Co-authored-by: Jens Kleine-Herzbruch <jensgr@gmx.net>
2025-09-24 15:18:37 +08:00
Tilman Holube
75804e4e31 Bump Jackson to 2.19.2 and databind-nullable to 0.2.7 (#22017) 2025-09-24 13:49:19 +08:00
Artem Shubovych
fe6da71327 [java] Fix annotationLibrary option being ignored (#21992)
* Only register the Swagger annotation imports for the corresponding annotationLibrary

* Fix the issue in a specific generator

* Add unit test
2025-09-23 16:31:01 +08:00
William Cheng
2f69ad9f26 update java samples 2025-09-22 15:43:37 +08:00
William Cheng
e5437e06a3 Update Ruby faraday to use ruby fake petstore test spec (#22008)
* update ruby faraday to use ruby fake petstore test spec

* clean up, regenerate samples

* update test
2025-09-21 23:33:40 +08:00
jpfinne
7e9b9615db [Java] [Spring] Use deduction configOptions for oneOfInterfaces (#20919)
* fix(java): x-discriminator-value should not produce @JsonTypeName

* fix(java): Remove unused getDiscriminatorValue()

* build at Fednot

* build at Fednot

* build at Fednot: skip sonar

* scm for release at fednot

* build fednot not 7.5.0-FEDNOT-SNAPSHOT

* build fednot not 7.5.0-FEDNOT-SNAPSHOT

* test all vars

* rollback custom pom.xml

* commit master

* commit test

* Samples for deduction

* add files  for deduction

* small improvements

* Merge changes from martin-mfg
Merge master

* Merge changes from martin-mfg
Merge master

* Merge changes from martin-mfg
Add comment to force rebuild

* Merge master

* regenerate doc

* regenerate client

* regenerate client

---------

Co-authored-by: Jean-Paul Finne <jean-paul.finne@fednot.be>
Co-authored-by: martin-mfg <2026226+martin-mfg@users.noreply.github.com>
2025-09-21 23:22:39 +08:00
William Cheng
731668b199 remove travis, appveyor from project (#22007) 2025-09-21 22:26:55 +08:00
William Cheng
24d7c3e904 Refactor Scala client, server Github workflow for testing (#22005)
* refactor scala client server workflow for testing

* fix

* migrate circleci scala tests

* add service, update host table

* java 8

* add distribution

* java 17

* 2.13.x

* update

* clean up circleci config
2025-09-21 16:27:03 +08:00
William Cheng
71a6901d1e Add GitHub workflow to test Clojure client (#22004)
* add workflow to test clojure client;

* add file

* run tests

* remove server

* Revert "remove server"

This reverts commit bda9143219.

* clean up circleci
2025-09-21 00:32:44 +08:00
William Cheng
f1a273de16 Test Java clients with Petstore server in Github workflow (#22003)
* test java clients with petstore in github workflow

* update

* clean up
2025-09-21 00:00:52 +08:00
William Cheng
3a63c2f7d2 Migrate Go petstore tests from circleci to github workflow (#21997)
* migrate go tests from circleci to github workflow

* update samples

* update samples

* update workflow

* update samples

* update samples

* update test

* update tests

* update tests

* fix

* fix

* update host table

* update tests

* update spec

* new spec
2025-09-19 17:10:31 +08:00
Mattias Sehlstedt
73c8728343 [Java] [Spring-client] Exclude discriminator from nullable annotation (#21981)
* Exclude the discriminator from getting a nullable-annotation

* Update samples
2025-09-19 14:50:58 +08:00
William Cheng
ac3c37095d [C#][httpclient] Add tests for nonPublicApi option (#21996)
* add samples to test nonPublicApi option

* add option to test nonPublicApi

* update test

* update tests
2025-09-19 14:49:26 +08:00
William Cheng
a55525c634 update php samples 2025-09-19 14:28:41 +08:00
Kevin
ec0edf433a Issue 21958 php-slim4 throws exception (#21962)
authenticatorConfig was being overwritten instead of having additional fields added.
Changed the reqex from requiring leading whitespace to having it optional.
2025-09-19 14:25:41 +08:00
ferenc-a
1c950018c8 Fix visibility for enum in C# generator (#21984) 2025-09-18 18:11:52 +08:00
Bruno Coelho
7a5d0d1a71 [kotlin][client] remove old deprecated apis (#21988) 2025-09-18 17:28:42 +08:00
Jason Frey
327599996d [bash] Fix issue where paste command doesn't work on Mac (#21986) 2025-09-18 17:27:51 +08:00
Jason Frey
5bdb691fb6 [bash] Drop old client.sh from petstore sample (#21987)
The bash config is configured to generate with a scriptName of
petstore-cli. As such, it will never generate client.sh and related
files. This seems to be a leftover from before the bash config was
introduced, and is not needed.
2025-09-18 17:27:10 +08:00
William Cheng
fec88b3e88 Migrate tests from AppVeyor to GitHub workflow (#21982)
* migrate tests from appveyor to github workflow

* test with dotnet 7

* test on windows

* set dotnet version

* Revert "set dotnet version"

This reverts commit 87af6a63ad.

* use localhost

* update

* update

* update tets

* update

* remove appveyor
2025-09-17 16:03:02 +08:00
William Cheng
0e1cba6eb6 update commons deps to newer versions (#21980) 2025-09-16 17:40:27 +08:00
William Cheng
45e4fa1633 Add workflow for PowerShell clients (#21979)
* add workflow for powershell client

* update

* fix container

* import, test

* combine

* use localhost

* update tests

* remove powershell tests from appveyor.yml
2025-09-16 15:24:22 +08:00
William Cheng
46de9c8c16 separate workflow to test java with sbt (#21978) 2025-09-16 14:24:58 +08:00
William Cheng
ab6c827098 Mark scala-lagom-server as deprecated (#21977)
* mark scala-lagom-server as deprecated

* update workflow
2025-09-16 13:59:00 +08:00
José María Lora
df2a8d6d46 Merge branch 'master' into bugfix/fix-formparams-defaultvalue 2025-05-16 12:28:47 +02:00
José María Lora
ade1e5838e Merge branch 'master' into bugfix/fix-formparams-defaultvalue 2025-04-10 17:39:55 +02:00
José María Lora
8ecdb15528 Merge branch 'master' into bugfix/fix-formparams-defaultvalue 2025-01-29 14:04:42 +01:00
José María Lora
ce89695bb6 chore: remove unwanted formatting changes 2024-12-13 12:22:00 +01:00
José María Lora
a424b5af8e fix: add support for default values in formParams template 2024-12-13 12:12:16 +01:00
10283 changed files with 225061 additions and 44361 deletions

View File

@@ -1,6 +1,6 @@
<!--
Please follow the issue template below for bug reports and feature requests.
Also please indicate in the issue title which language/library is concerned. Eg: [JAVA] Bug generating foo with bar
Also please indicate in the issue title which language/library is concerned. E.g.: [JAVA] Bug generating foo with bar
-->
##### Description

View File

@@ -18,7 +18,7 @@ assignees: ''
<!--
Please follow the issue template below for bug reports.
Also please indicate in the issue title which language/library is concerned. Eg: [BUG][JAVA] Bug generating foo with bar
Also please indicate in the issue title which language/library is concerned. E.g.: [BUG][JAVA] Bug generating foo with bar
-->
##### Description

View File

@@ -19,6 +19,7 @@ jobs:
with:
java-version: 11
distribution: 'temurin'
cache: gradle
- name: Cache maven dependencies
uses: actions/cache@v4
env:

View File

@@ -37,6 +37,7 @@ jobs:
with:
distribution: 'temurin'
java-version: 11
cache: gradle
# Cache Gradle Dependencies
- name: Setup Gradle Dependencies Cache
uses: actions/cache@v4

View File

@@ -27,6 +27,7 @@ jobs:
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: gradle
- uses: actions/cache@v4
with:
@@ -44,12 +45,12 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- uses: gradle/actions/setup-gradle@v4
- uses: gradle/actions/setup-gradle@v5
with:
gradle-version: '8.14.3'
- name: Setup Maven
uses: s4u/setup-maven-action@v1.18.0
uses: s4u/setup-maven-action@v1.19.0
with:
java-version: ${{ matrix.java }}
maven-version: 3.8.8
@@ -61,7 +62,7 @@ jobs:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
- name: Upload Maven build artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
if: matrix.java == '11' && matrix.os == 'ubuntu-latest'
with:
name: artifact
@@ -91,12 +92,13 @@ jobs:
- name: Check out code
uses: actions/checkout@v5
- name: Setup Maven
uses: s4u/setup-maven-action@v1.18.0
uses: s4u/setup-maven-action@v1.19.0
with:
java-version: 11
maven-version: 3.8.8
cache: gradle
- name: Download build artifact
uses: actions/download-artifact@v5
uses: actions/download-artifact@v6
with:
name: artifact
- name: Run Ensures Script

View File

@@ -21,6 +21,7 @@ jobs:
with:
java-version: 11
distribution: 'temurin'
cache: gradle
- name: Cache maven dependencies
uses: actions/cache@v4
env:
@@ -41,7 +42,7 @@ jobs:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
- run: ls -la modules/openapi-generator-cli/target
- name: Upload openapi-generator-cli.jar artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: openapi-generator-cli.jar
path: modules/openapi-generator-cli/target/openapi-generator-cli.jar
@@ -59,6 +60,7 @@ jobs:
with:
java-version: 11
distribution: 'temurin'
cache: gradle
- name: Cache maven dependencies
uses: actions/cache@v4
env:
@@ -79,7 +81,7 @@ jobs:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
- name: Publish unit test reports
if: ${{ always() }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: surefire-test-results
path: '**/surefire-reports/TEST-*.xml'
@@ -97,7 +99,7 @@ jobs:
java-version: 11
distribution: 'temurin'
- name: Download openapi-generator-cli.jar artifact
uses: actions/download-artifact@v5
uses: actions/download-artifact@v6
with:
name: openapi-generator-cli.jar
path: modules/openapi-generator-cli/target
@@ -136,7 +138,7 @@ jobs:
java-version: 11
distribution: 'temurin'
- name: Download openapi-generator-cli.jar artifact
uses: actions/download-artifact@v5
uses: actions/download-artifact@v6
with:
name: openapi-generator-cli.jar
path: modules/openapi-generator-cli/target

51
.github/workflows/samples-clojure.yaml vendored Normal file
View File

@@ -0,0 +1,51 @@
name: Samples Clojure Client
on:
push:
paths:
- samples/client/petstore/clojure/**
pull_request:
paths:
- samples/client/petstore/clojure/**
jobs:
build:
name: Build Clojure Client (JDK11)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sample:
- samples/client/petstore/clojure/
services:
petstore-api:
image: swaggerapi/petstore
ports:
- 80:8080
env:
SWAGGER_HOST: http://petstore.swagger.io
SWAGGER_BASE_PATH: /v2
steps:
- uses: actions/checkout@v5
- name: Add hosts to /etc/hosts
run: |
sudo echo "127.0.0.1 petstore.swagger.io" | sudo tee -a /etc/hosts
- uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 11
- name: Cache maven dependencies
uses: actions/cache@v4
env:
cache-name: maven-repository
with:
path: |
~/.m2
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
- name: Install Leiningen (if using Leiningen)
run: |
curl https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein > lein
chmod +x lein
sudo mv lein /usr/local/bin/
- name: Run tests (Leiningen)
working-directory: ${{ matrix.sample }}
run: lein test

View File

@@ -0,0 +1,37 @@
name: Samples C# .Net Client (Petstore)
on:
push:
paths:
- samples/client/petstore/csharp/restsharp/standard2.0/Petstore/**
pull_request:
paths:
- samples/client/petstore/csharp/restsharp/standard2.0/Petstore/**
jobs:
build:
name: Build clients
runs-on: ubuntu-latest
services:
petstore-api:
image: swaggerapi/petstore
ports:
- 80:8080
env:
SWAGGER_HOST: http://petstore.swagger.io
SWAGGER_BASE_PATH: /v2
strategy:
fail-fast: false
matrix:
sample:
- samples/client/petstore/csharp/restsharp/standard2.0/Petstore/
steps:
- uses: actions/checkout@v5
- uses: actions/setup-dotnet@v5.0.0
with:
dotnet-version: '7.0.x'
- name: Build
working-directory: ${{ matrix.sample }}
run: dotnet build Org.OpenAPITools.sln
- name: Test
working-directory: ${{ matrix.sample }}
run: dotnet test Org.OpenAPITools.sln

View File

@@ -0,0 +1,54 @@
name: Samples C# .Net 7 Client
on:
push:
paths:
# the .NET Core 3.0 runtime is no longer supported as it reached its end-of-life on March 3, 2020
#- samples/client/petstore/csharp/httpclient/standard2.0/Petstore/**
- samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/**
- samples/client/petstore/csharp/restsharp/net4.7/Petstore/**
- samples/client/petstore/csharp/restsharp/net4.8/Petstore/**
- samples/client/petstore/csharp/restsharp/net8/ParameterMappings/**
- samples/client/petstore/csharp/restsharp/net8/EnumMappings/**
- samples/client/petstore/csharp/restsharp/net8/Petstore/**
- samples/client/petstore/csharp/restsharp/net8/UseDateTimeForDate/**
- samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/**
pull_request:
paths:
#- samples/client/petstore/csharp/httpclient/standard2.0/Petstore/**
- samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/**
- samples/client/petstore/csharp/restsharp/net4.7/Petstore/**
- samples/client/petstore/csharp/restsharp/net4.8/Petstore/**
- samples/client/petstore/csharp/restsharp/net8/ParameterMappings/**
- samples/client/petstore/csharp/restsharp/net8/EnumMappings/**
- samples/client/petstore/csharp/restsharp/net8/Petstore/**
- samples/client/petstore/csharp/restsharp/net8/UseDateTimeForDate/**
- samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/**
jobs:
build:
name: Build clients
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
sample:
#- samples/client/petstore/csharp/httpclient/standard2.0/Petstore/
- samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/
- samples/client/petstore/csharp/restsharp/net4.7/Petstore/
- samples/client/petstore/csharp/restsharp/net4.8/Petstore/
- samples/client/petstore/csharp/restsharp/net8/ParameterMappings/
- samples/client/petstore/csharp/restsharp/net8/EnumMappings/
- samples/client/petstore/csharp/restsharp/net8/Petstore/
- samples/client/petstore/csharp/restsharp/net8/UseDateTimeForDate/
- samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/
steps:
- uses: actions/checkout@v5
- uses: actions/setup-dotnet@v5.0.0
with:
dotnet-version: '7.0.x'
- name: Build
working-directory: ${{ matrix.sample }}
run: dotnet build Org.OpenAPITools.sln
- name: Test
working-directory: ${{ matrix.sample }}
run: dotnet test Org.OpenAPITools.sln

View File

@@ -43,6 +43,7 @@ jobs:
- samples/client/petstore/csharp/restsharp/net9/EnumMappings
# httpclient
- samples/client/petstore/csharp/httpclient/net9/Petstore
- samples/client/petstore/csharp/httpclient/net9/Petstore-nonPublicApi
# unity
#- samples/client/petstore/csharp/unityWebRequest/net9/Petstore
steps:

View File

@@ -0,0 +1,45 @@
name: Samples Go Clients (Petstore)
on:
push:
paths:
- samples/client/petstore/go/**
- samples/openapi3/client/petstore/go/**
pull_request:
paths:
- samples/client/petstore/go/**
- samples/openapi3/client/petstore/go/**
jobs:
build:
name: Build Go
runs-on: ubuntu-latest
services:
petstore-api:
image: swaggerapi/petstore
ports:
- 80:8080
env:
SWAGGER_HOST: http://petstore.swagger.io
SWAGGER_BASE_PATH: /v2
strategy:
fail-fast: false
matrix:
sample:
- samples/client/petstore/go/
- samples/openapi3/client/petstore/go/
steps:
- uses: actions/checkout@v5
- name: Add hosts to /etc/hosts
run: |
sudo echo "127.0.0.1 petstore.swagger.io" | sudo tee -a /etc/hosts
- uses: actions/setup-go@v6
- run: go version
- name: Install Dependencies
working-directory: ${{ matrix.sample }}
run: |
go mod tidy
- name: Run test
working-directory: ${{ matrix.sample }}
run: go test -mod=mod -v

View File

@@ -6,12 +6,17 @@ on:
- 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/**'
- 'samples/openapi3/client/petstore/go-petstore-withXml/**'
- samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/**
- samples/client/others/go/allof_multiple_ref_and_discriminator/**
- samples/client/others/go/oneof-anyof-required/**
- samples/client/others/go/oneof-discriminator-lookup/**
pull_request:
paths:
- 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/**'
- 'samples/openapi3/client/petstore/go-petstore-withXml/**'
- samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/**
- samples/client/others/go/allof_multiple_ref_and_discriminator/**
- samples/client/others/go/oneof-anyof-required/**
- samples/client/others/go/oneof-discriminator-lookup/**
jobs:
build:
name: Build Go
@@ -23,6 +28,9 @@ jobs:
- 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/'
- 'samples/openapi3/client/petstore/go-petstore-withXml/'
- samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/
- samples/client/others/go/allof_multiple_ref_and_discriminator/
- samples/client/others/go/oneof-anyof-required/
- samples/client/others/go/oneof-discriminator-lookup/
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6

View File

@@ -6,13 +6,13 @@ on:
- 'samples/server/petstore/go-echo-server/**'
- 'samples/server/petstore/go-api-server/**'
- 'samples/server/petstore/go-chi-server/**'
- 'samples/server/others/go-server/no-body-path-params/**'
- 'samples/server/others/go-server/**'
pull_request:
paths:
- 'samples/server/petstore/go-echo-server/**'
- 'samples/server/petstore/go-api-server/**'
- 'samples/server/petstore/go-chi-server/**'
- 'samples/server/others/go-server/no-body-path-params/**'
- 'samples/server/others/go-server/**'
jobs:
build:
@@ -26,6 +26,7 @@ jobs:
- samples/server/petstore/go-api-server/
- samples/server/petstore/go-chi-server/
- samples/server/others/go-server/no-body-path-params/
- samples/server/others/go-server/optional-body/
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
@@ -58,4 +59,4 @@ jobs:
go mod tidy
- name: Run tests
working-directory: ${{ matrix.sample }}
run: go test ./samples_tests -v
run: go test ./samples_tests -v

View File

@@ -26,6 +26,7 @@ jobs:
with:
distribution: 'temurin'
java-version: 8
cache: gradle
- name: Cache maven dependencies
uses: actions/cache@v4
env:

View File

@@ -5,6 +5,7 @@ on:
paths:
- 'samples/client/petstore/java/**'
- samples/client/petstore/jaxrs-cxf-client/**
- samples/client/petstore/jaxrs-cxf-client-swagger2/**
- samples/client/petstore/java-micronaut-client/**
- samples/openapi3/client/petstore/java/jersey2-java8-special-characters/**
- samples/openapi3/client/petstore/java/jersey2-java8-swagger1/**
@@ -17,12 +18,17 @@ on:
- samples/client/petstore/java/webclient-useSingleRequestParameter/**
- samples/client/others/java/jersey2-oneOf-duplicates/**
- samples/client/others/java/jersey2-oneOf-Mixed/**
- samples/client/petstore/java/jersey3-oneOf/**
- samples/client/others/java/okhttp-gson-streaming/**
- samples/client/others/java/resteasy/**
- samples/client/others/java/apache-httpclient/**
- samples/client/others/java/resttemplate-list-schema-validation/**
- samples/client/petstore/java/okhttp-gson-3.1-duplicated-operationid/**
pull_request:
paths:
- 'samples/client/petstore/java/**'
- samples/client/petstore/jaxrs-cxf-client/**
- samples/client/petstore/jaxrs-cxf-client-swagger2/**
- samples/client/petstore/java-micronaut-client/**
- samples/openapi3/client/petstore/java/jersey2-java8-special-characters/**
- samples/openapi3/client/petstore/java/jersey2-java8-swagger1/**
@@ -35,6 +41,10 @@ on:
- samples/client/petstore/java/webclient-useSingleRequestParameter/**
- samples/client/others/java/jersey2-oneOf-duplicates/**
- samples/client/others/java/jersey2-oneOf-Mixed/**
- samples/client/petstore/java/jersey3-oneOf/**
- samples/client/others/java/okhttp-gson-streaming/**
- samples/client/others/java/resteasy/**
- samples/client/others/java/apache-httpclient/**
- samples/client/others/java/resttemplate-list-schema-validation/**
- samples/client/petstore/java/okhttp-gson-3.1-duplicated-operationid/**
jobs:
@@ -46,6 +56,7 @@ jobs:
matrix:
sample:
# clients
- samples/client/petstore/jaxrs-cxf-client-swagger2
- samples/client/petstore/jaxrs-cxf-client
- samples/client/petstore/java/native
- samples/client/petstore/java/native-async
@@ -97,12 +108,17 @@ jobs:
- samples/client/others/java/jersey2-oneOf-Mixed/
- samples/client/others/java/resttemplate-list-schema-validation/
- samples/client/petstore/java/okhttp-gson-3.1-duplicated-operationid/
- samples/client/petstore/java/jersey3-oneOf/
- samples/client/others/java/okhttp-gson-streaming/
- samples/client/petstore/java/resteasy/
- samples/client/petstore/java/apache-httpclient/
steps:
- uses: actions/checkout@v5
- uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 11
cache: gradle
- name: Cache maven dependencies
uses: actions/cache@v4
env:

View File

@@ -42,6 +42,7 @@ jobs:
with:
distribution: 'temurin'
java-version: 17
cache: gradle
- name: Cache maven dependencies
uses: actions/cache@v4
env:

View File

@@ -0,0 +1,65 @@
# run java client tests with petstore server
name: Samples Java Petsore Client JDK11
on:
push:
paths:
- samples/client/petstore/java/jersey2-java8/**
- samples/openapi3/client/petstore/java/jersey2-java8/**
- samples/client/petstore/java/jersey3/**
- samples/client/petstore/java/okhttp-gson/**
- samples/client/petstore/java/okhttp-gson-3.1/**
- samples/client/petstore/java/okhttp-gson-dynamicOperations/**
- samples/client/petstore/java-micronaut-client/**
pull_request:
paths:
- samples/client/petstore/java/jersey2-java8/**
- samples/openapi3/client/petstore/java/jersey2-java8/**
- samples/client/petstore/java/jersey3/**
- samples/client/petstore/java/okhttp-gson/**
- samples/client/petstore/java/okhttp-gson-3.1/**
- samples/client/petstore/java/okhttp-gson-dynamicOperations/**
- samples/client/petstore/java-micronaut-client/**
jobs:
build:
name: Build Java Client JDK11
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sample:
- samples/client/petstore/java/jersey2-java8
- samples/openapi3/client/petstore/java/jersey2-java8
- samples/client/petstore/java/jersey3
- samples/client/petstore/java/okhttp-gson
- samples/client/petstore/java/okhttp-gson-3.1
- samples/client/petstore/java/okhttp-gson-dynamicOperations
- samples/client/petstore/java-micronaut-client
services:
petstore-api:
image: swaggerapi/petstore
ports:
- 80:8080
env:
SWAGGER_HOST: http://petstore.swagger.io
SWAGGER_BASE_PATH: /v2
steps:
- uses: actions/checkout@v5
- name: Add hosts to /etc/hosts
run: |
sudo echo "127.0.0.1 petstore.swagger.io" | sudo tee -a /etc/hosts
- uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 11
- name: Cache maven dependencies
uses: actions/cache@v4
env:
cache-name: maven-repository
with:
path: |
~/.m2
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
- name: Build with Maven
working-directory: ${{ matrix.sample }}
run: mvn clean package --no-transfer-progress

38
.github/workflows/samples-java-sbt.yaml vendored Normal file
View File

@@ -0,0 +1,38 @@
name: Samples Java (sbt)
on:
push:
paths:
- 'samples/client/petstore/java/okhttp-gson/**'
pull_request:
paths:
- 'samples/client/petstore/java/okhttp-gson/**'
jobs:
build:
name: Build sbt/Java client, servers
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sample:
# clients
- samples/client/petstore/java/okhttp-gson
steps:
- uses: actions/checkout@v5
- uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 11
- name: Setup sbt launcher
uses: sbt/setup-sbt@v1
- name: Cache maven dependencies
uses: actions/cache@v4
env:
cache-name: maven-repository
with:
path: |
~/.ivy2
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/build.sbt') }}
- name: Build and test
working-directory: ${{ matrix.sample }}
run: sbt -v +test

View File

@@ -0,0 +1,51 @@
name: Samples JS clients
on:
push:
paths:
#- samples/client/petstore/javascript-flowtyped/**
- samples/client/petstore/javascript-es6/**
- samples/client/petstore/javascript-promise-es6/**
pull_request:
paths:
#- samples/client/petstore/javascript-flowtyped/**
- samples/client/petstore/javascript-es6/**
- samples/client/petstore/javascript-promise-es6/**
jobs:
build:
name: Build projects
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node:
- "18.x"
- "20.x"
sample:
# clients
- samples/client/petstore/javascript-es6/
- samples/client/petstore/javascript-promise-es6/
services:
petstore-api:
image: swaggerapi/petstore
ports:
- 80:8080
env:
SWAGGER_HOST: http://petstore.swagger.io
SWAGGER_BASE_PATH: /v2
steps:
- uses: actions/checkout@v5
- name: Add hosts to /etc/hosts
run: |
sudo echo "127.0.0.1 petstore.swagger.io" | sudo tee -a /etc/hosts
- name: Use Node.js 20.x
uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node }}
cache: 'npm' # Or 'yarn'
- name: npm install
working-directory: ${{ matrix.sample }}
run: npm install
- name: npm test
working-directory: ${{ matrix.sample }}
run: npm test

View File

@@ -20,10 +20,7 @@ jobs:
- samples/server/petstore/jaxrs/jersey2-useTags
- samples/server/petstore/jaxrs-jersey
- samples/server/petstore/jaxrs-spec
- samples/server/petstore/jaxrs-spec-interface
- samples/server/petstore/jaxrs-spec-interface-response
- samples/server/petstore/jaxrs-jersey
- samples/server/petstore/jaxrs-spec
- samples/server/petstore/jaxrs-spec-withxml
- samples/server/petstore/jaxrs-spec-interface
- samples/server/petstore/jaxrs-spec-interface-response
- samples/server/petstore/jaxrs-datelib-j8

View File

@@ -77,6 +77,7 @@ jobs:
with:
distribution: 'temurin'
java-version: 11
cache: gradle
- name: Cache maven dependencies
uses: actions/cache@v4
env:

View File

@@ -26,6 +26,7 @@ jobs:
with:
distribution: 'temurin'
java-version: 17
cache: gradle
- name: Cache maven dependencies
uses: actions/cache@v4
env:

View File

@@ -34,6 +34,7 @@ jobs:
# server
- samples/server/petstore/kotlin-server-required-and-nullable-properties
- samples/server/petstore/kotlin-springboot-3
- samples/server/petstore/kotlin-springboot-additionalproperties
- samples/server/petstore/kotlin-springboot-delegate-nodefaults
- samples/server/petstore/kotlin-springboot-request-cookie
- samples/server/petstore/kotlin-server/jaxrs-spec
@@ -51,6 +52,7 @@ jobs:
with:
distribution: 'temurin'
java-version: 17
cache: gradle
- name: Cache maven dependencies
uses: actions/cache@v4
env:
@@ -67,4 +69,4 @@ jobs:
arguments: wrapper
- name: Build
working-directory: ${{ matrix.sample }}
run: ./gradlew build -x test
run: ./gradlew build -x test

View File

@@ -32,6 +32,7 @@ jobs:
with:
distribution: 'temurin'
java-version: 21
cache: gradle
- name: Cache maven dependencies
uses: actions/cache@v4
env:

View File

@@ -59,7 +59,8 @@ jobs:
- uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 8
java-version: 11
cache: gradle
- name: Cache maven dependencies
uses: actions/cache@v4
env:
@@ -76,4 +77,4 @@ jobs:
arguments: wrapper
- name: Build
working-directory: ${{ matrix.sample }}
run: ./gradlew build -x test
run: ./gradlew build -x test

View File

@@ -0,0 +1,40 @@
name: Samples PowerShell
on:
push:
paths:
- samples/client/petstore/powershell/**
pull_request:
paths:
- samples/client/petstore/powershell/**
jobs:
build:
runs-on: ubuntu-latest
name: Test Powershell Clients
strategy:
matrix:
sample:
- samples/client/petstore/powershell/
services:
petstore-api:
image: swaggerapi/petstore
ports:
- 80:8080
env:
SWAGGER_HOST: http://petstore.swagger.io
SWAGGER_BASE_PATH: /v2
steps:
- uses: actions/checkout@v5
- name: Build the client
working-directory: ${{ matrix.sample }}
shell: pwsh
run: |
./Build.ps1
- name: Test
working-directory: ${{ matrix.sample }}
shell: pwsh
run: |
Import-Module -Name './src/PSPetstore'
Invoke-Pester -PassThru

View File

@@ -34,6 +34,7 @@ jobs:
- "3.13"
sample:
- samples/openapi3/client/petstore/python-aiohttp
- samples/openapi3/client/petstore/python-httpx
- samples/openapi3/client/petstore/python
- samples/openapi3/client/petstore/python-lazyImports
services:

View File

@@ -0,0 +1,70 @@
name: Samples Scala/sbt client
on:
push:
paths:
- samples/client/petstore/scalaz/**
- samples/client/petstore/scala-pekko/**
- samples/client/petstore/scala-http4s/**
- samples/client/petstore/scala-sttp4-jsoniter/**
- samples/client/petstore/scala-akka/**
- samples/client/petstore/scala-sttp/**
- samples/client/petstore/scala-sttp-circe/**
- samples/client/petstore/scala-sttp4/**
pull_request:
paths:
- samples/client/petstore/scalaz/**
- samples/client/petstore/scala-pekko/**
- samples/client/petstore/scala-http4s/**
- samples/client/petstore/scala-sttp4-jsoniter/**
- samples/client/petstore/scala-akka/**
- samples/client/petstore/scala-sttp/**
- samples/client/petstore/scala-sttp-circe/**
- samples/client/petstore/scala-sttp4/**
jobs:
build:
name: Build sbt/Scala
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sample:
# clients
- samples/client/petstore/scalaz
- samples/client/petstore/scala-pekko
- samples/client/petstore/scala-http4s
- samples/client/petstore/scala-sttp4-jsoniter
- samples/client/petstore/scala-akka
- samples/client/petstore/scala-sttp
- samples/client/petstore/scala-sttp-circe
- samples/client/petstore/scala-sttp4
services:
petstore-api:
image: swaggerapi/petstore
ports:
- 80:8080
env:
SWAGGER_HOST: http://petstore.swagger.io
SWAGGER_BASE_PATH: /v2
steps:
- uses: actions/checkout@v5
- name: Add hosts to /etc/hosts
run: |
sudo echo "127.0.0.1 petstore.swagger.io" | sudo tee -a /etc/hosts
- uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 11
- name: Setup sbt launcher
uses: sbt/setup-sbt@v1
- name: Cache maven dependencies
uses: actions/cache@v4
env:
cache-name: maven-repository
with:
path: |
~/.ivy2
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/build.sbt') }}
- name: Build and test
working-directory: ${{ matrix.sample }}
run: sbt -v test

View File

@@ -1,34 +1,21 @@
name: Samples Scala/sbt
name: Samples Scala/sbt server
on:
push:
paths:
- 'samples/client/petstore/scala**'
- 'samples/server/petstore/scala**'
- 'samples/client/petstore/java/okhttp-gson/**'
pull_request:
paths:
- 'samples/client/petstore/scala**'
- 'samples/server/petstore/scala**'
- 'samples/client/petstore/java/okhttp-gson/**'
jobs:
build:
name: Build sbt/Scala client, servers
name: Build sbt/Scala
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sample:
# clients
- samples/client/petstore/java/okhttp-gson
- samples/client/petstore/scalaz
- samples/client/petstore/scala-pekko
- samples/client/petstore/scala-http4s
- samples/client/petstore/scala-sttp4-jsoniter
#- samples/client/petstore/scala-sttp
#- samples/client/petstore/scala-sttp-circe
# servers
- samples/server/petstore/scala-lagom-server
- samples/server/petstore/scala-play-server
- samples/server/petstore/scala-akka-http-server
- samples/server/petstore/scala-pekko-http-server

View File

@@ -11,6 +11,7 @@ on:
- samples/server/petstore/springboot-file-delegate-optional
- samples/server/petstore/springboot-petstore-with-api-response-examples
- samples/server/petstore/spring-boot-oneof-sealed
- samples/openapi3/server/petstore/spring-boot-oneof-interface
pull_request:
paths:
- samples/openapi3/client/petstore/spring-cloud-3-with-optional
@@ -21,6 +22,7 @@ on:
- samples/server/petstore/springboot-file-delegate-optional
- samples/server/petstore/springboot-petstore-with-api-response-examples
- samples/server/petstore/spring-boot-oneof-sealed
- samples/openapi3/server/petstore/spring-boot-oneof-interface
jobs:
build:
name: Build Java Spring (JDK17)
@@ -39,6 +41,7 @@ jobs:
- samples/server/petstore/springboot-file-delegate-optional
- samples/server/petstore/springboot-petstore-with-api-response-examples
- samples/server/petstore/spring-boot-oneof-sealed
- samples/openapi3/server/petstore/spring-boot-oneof-interface
steps:
- uses: actions/checkout@v5
- uses: actions/setup-java@v5

View File

@@ -60,6 +60,7 @@ jobs:
- samples/server/petstore/springboot-spring-provide-args
- samples/server/petstore/springboot-useoptional
- samples/server/petstore/springboot-virtualan
- samples/openapi3/server/petstore/spring-boot-oneof-interface
steps:
- uses: actions/checkout@v5
- uses: actions/setup-java@v5

View File

@@ -0,0 +1,142 @@
name: Samples TS clients
on:
push:
paths:
- samples/client/others/typescript-angular/**
# comment out angular released before Nov 2023
#- samples/client/petstore/typescript-angular-v12-provided-in-root/**
#- samples/client/petstore/typescript-angular-v13-provided-in-root/**
#- samples/client/petstore/typescript-angular-v14-provided-in-root/**
#- samples/client/petstore/typescript-angular-v15-provided-in-root/**
- samples/client/petstore/typescript-angular-v16-provided-in-root/**
- samples/client/petstore/typescript-angular-v17-provided-in-root/**
- samples/client/petstore/typescript-angular-v18-provided-in-root/**
- samples/client/petstore/typescript-angular-v19-provided-in-root/**
- samples/client/petstore/typescript-angular-v20-provided-in-root/**
- samples/openapi3/client/petstore/typescript/builds/default/**
# comment out due to build failure
#- samples/openapi3/client/petstore/typescript/tests/default/**
- samples/openapi3/client/petstore/typescript/builds/jquery/**
# comment out due to build failure
#- samples/openapi3/client/petstore/typescript/tests/jquery/**
- samples/openapi3/client/petstore/typescript/builds/object_params/**
# comment out due to build failure
#- samples/openapi3/client/petstore/typescript/tests/object_params/**
#- samples/openapi3/client/petstore/typescript/builds/inversify/**
#- samples/openapi3/client/petstore/typescript/tests/inversify/**
#- samples/openapi3/client/petstore/typescript/tests/deno/**
- samples/openapi3/client/petstore/typescript/builds/browser/**
# comment out due to build failure
#- samples/openapi3/client/petstore/typescript/tests/browser/**
#- samples/openapi3/client/petstore/typescript/builds/nullable-enum/**
- samples/client/petstore/typescript-fetch/builds/default/**
- samples/client/petstore/typescript-fetch/builds/es6-target/**
- samples/client/petstore/typescript-fetch/builds/with-npm-version/**
- samples/client/petstore/typescript-fetch/tests/default/**
# comment out due to build failure
#- samples/client/petstore/typescript-node/npm/**
- samples/client/petstore/typescript-rxjs/builds/with-npm-version/**
- samples/client/petstore/typescript-axios/builds/with-npm-version/**
# comment out due to build failure
#- samples/client/petstore/typescript-axios/tests/default/**
pull_request:
paths:
- samples/client/others/typescript-angular/**
#- samples/client/petstore/typescript-angular-v12-provided-in-root/**
#- samples/client/petstore/typescript-angular-v13-provided-in-root/**
#- samples/client/petstore/typescript-angular-v14-provided-in-root/**
#- samples/client/petstore/typescript-angular-v15-provided-in-root/**
- samples/client/petstore/typescript-angular-v16-provided-in-root/**
- samples/client/petstore/typescript-angular-v17-provided-in-root/**
- samples/client/petstore/typescript-angular-v18-provided-in-root/**
- samples/client/petstore/typescript-angular-v19-provided-in-root/**
- samples/client/petstore/typescript-angular-v20-provided-in-root/**
- samples/openapi3/client/petstore/typescript/builds/default/**
#- samples/openapi3/client/petstore/typescript/tests/default/**
- samples/openapi3/client/petstore/typescript/builds/jquery/**
#- samples/openapi3/client/petstore/typescript/tests/jquery/**
- samples/openapi3/client/petstore/typescript/builds/object_params/**
#- samples/openapi3/client/petstore/typescript/tests/object_params/**
#- samples/openapi3/client/petstore/typescript/builds/inversify/**
#- samples/openapi3/client/petstore/typescript/tests/inversify/**
#- samples/openapi3/client/petstore/typescript/tests/deno/**
- samples/openapi3/client/petstore/typescript/builds/browser/**
#- samples/openapi3/client/petstore/typescript/tests/browser/**
#- samples/openapi3/client/petstore/typescript/builds/nullable-enum/**
- samples/client/petstore/typescript-fetch/builds/default/**
- samples/client/petstore/typescript-fetch/builds/es6-target/**
- samples/client/petstore/typescript-fetch/builds/with-npm-version/**
- samples/client/petstore/typescript-fetch/tests/default/**
#- samples/client/petstore/typescript-node/npm/**
- samples/client/petstore/typescript-rxjs/builds/with-npm-version/**
- samples/client/petstore/typescript-axios/builds/with-npm-version/**
#- samples/client/petstore/typescript-axios/tests/default/**
jobs:
build:
name: Build projects
runs-on: ubuntu-latest
services:
petstore-api:
image: swaggerapi/petstore
ports:
- 80:8080
env:
SWAGGER_HOST: http://petstore.swagger.io
SWAGGER_BASE_PATH: /v2
strategy:
fail-fast: false
matrix:
node:
#- "18.x"
- "20.x"
sample:
- samples/client/others/typescript-angular/
#- samples/client/petstore/typescript-angular-v12-provided-in-root/
#- samples/client/petstore/typescript-angular-v13-provided-in-root/
#- samples/client/petstore/typescript-angular-v14-provided-in-root/
#- samples/client/petstore/typescript-angular-v15-provided-in-root/
- samples/client/petstore/typescript-angular-v16-provided-in-root/
- samples/client/petstore/typescript-angular-v17-provided-in-root/
- samples/client/petstore/typescript-angular-v18-provided-in-root/
- samples/client/petstore/typescript-angular-v19-provided-in-root/
- samples/client/petstore/typescript-angular-v20-provided-in-root/
- samples/openapi3/client/petstore/typescript/builds/default/
#- samples/openapi3/client/petstore/typescript/tests/default/
- samples/openapi3/client/petstore/typescript/builds/jquery/
#- samples/openapi3/client/petstore/typescript/tests/jquery/
- samples/openapi3/client/petstore/typescript/builds/object_params/
#- samples/openapi3/client/petstore/typescript/tests/object_params/
#- samples/openapi3/client/petstore/typescript/builds/inversify/
#- samples/openapi3/client/petstore/typescript/tests/inversify/
#- samples/openapi3/client/petstore/typescript/tests/deno/
- samples/openapi3/client/petstore/typescript/builds/browser/
#- samples/openapi3/client/petstore/typescript/tests/browser/
#- samples/openapi3/client/petstore/typescript/builds/nullable-enum/
- samples/client/petstore/typescript-fetch/builds/default/
- samples/client/petstore/typescript-fetch/builds/es6-target/
- samples/client/petstore/typescript-fetch/builds/with-npm-version/
- samples/client/petstore/typescript-fetch/tests/default/
#- samples/client/petstore/typescript-node/npm/
- samples/client/petstore/typescript-rxjs/builds/with-npm-version/
- samples/client/petstore/typescript-axios/builds/with-npm-version/
#- samples/client/petstore/typescript-axios/tests/default/
steps:
- uses: actions/checkout@v5
- name: Add hosts to /etc/hosts
run: |
sudo echo "127.0.0.1 petstore.swagger.io" | sudo tee -a /etc/hosts
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '17' # Specify your desired Java version
distribution: 'temurin' # Or 'adopt', 'oracle', etc.
cache: maven # Cache Maven dependencies for faster builds
- name: Use Node.js
uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node }}
cache: 'npm' # Or 'yarn'
- name: mvn integration-test
working-directory: ${{ matrix.sample }}
run: mvn integration-test

View File

@@ -0,0 +1,34 @@
name: Samples TS servers
on:
push:
paths:
- samples/server/petstore/typescript-nestjs-server/**
pull_request:
paths:
- samples/server/petstore/typescript-nestjs-server/**
jobs:
build:
name: Build projects
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node:
- "18.x"
- "20.x"
sample:
- samples/server/petstore/typescript-nestjs-server/
steps:
- uses: actions/checkout@v5
- name: Use Node.js 20.x
uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node }}
cache: 'npm' # Or 'yarn'
- name: npm install
working-directory: ${{ matrix.sample }}
run: npm install
- name: npm test
working-directory: ${{ matrix.sample }}
run: npm test

View File

@@ -24,6 +24,7 @@ jobs:
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: gradle
- name: Cache maven dependencies
uses: actions/cache@v4
env:
@@ -39,7 +40,7 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
- name: Setup Maven
uses: s4u/setup-maven-action@v1.18.0
uses: s4u/setup-maven-action@v1.19.0
with:
java-version: ${{ matrix.java }}
maven-version: 3.8.8

2
.gitignore vendored
View File

@@ -49,6 +49,8 @@ nb-configuration.xml
*.xml~
*.t~
**/.angular
/target
/generated-files
test-output/

View File

@@ -1,37 +0,0 @@
sudo: required
language: java
jdk:
- openjdk8
cache:
directories:
- $HOME/.m2
- $HOME/.ivy2
services:
- docker
addons:
hosts:
- petstore.swagger.io
before_install:
# to run petstore server locally via docker
- docker pull swaggerapi/petstore
- docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
- docker ps -a
# Add bats test framework and cURL for Bash script integration tests
- sudo add-apt-repository ppa:duggan/bats --yes
- sudo apt-get update -qq
- sudo apt-get install -qq bats
- sudo apt-get install -qq curl
# show host table to confirm petstore.swagger.io is mapped to localhost
- cat /etc/hosts
script:
# fail fast
- set -e
# run integration tests defined in maven pom.xml
- cp pom.xml.bash pom.xml
- mvn --no-snapshot-updates --batch-mode verify -Psamples

View File

@@ -11,43 +11,15 @@ export NODE_ENV=test
if [ "$NODE_INDEX" = "1" ]; then
echo "Running node $NODE_INDEX ..."
java -version
sudo apt-get -y install cpanminus
# install rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
echo "Testing perl"
(cd samples/client/petstore/perl && /bin/bash ./test.bash)
echo "Testing ruby"
(cd samples/client/petstore/ruby && mvn integration-test)
(cd samples/client/petstore/ruby-faraday && mvn integration-test)
(cd samples/client/petstore/ruby-httpx && mvn integration-test)
(cd samples/client/petstore/ruby-autoload && mvn integration-test)
echo "Testing rust"
(cd samples/server/petstore/rust-axum && mvn integration-test)
elif [ "$NODE_INDEX" = "2" ]; then
echo "Running node $NODE_INDEX to test Go"
# install haskell
#curl -sSLk https://get.haskellstack.org/ | sh
#stack upgrade
#stack --version
# install curl
#sudo apt-get -y build-dep libcurl4-gnutls-dev
#sudo apt-get -y install libcurl4-gnutls-dev
# Install golang version 1.18
go version
sudo mkdir /usr/local/go1.18
wget -c https://dl.google.com/go/go1.18.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local/go1.18
export PATH="/usr/local/go1.18/go/bin:$PATH"
go version
echo "Running node $NODE_INDEX to test cpp-restsdk"
# install cpprestsdk
sudo apt-get install libcpprest-dev
@@ -56,87 +28,21 @@ elif [ "$NODE_INDEX" = "2" ]; then
sudo ./setup-cpp-x64-linux --compiler llvm --cmake true --ninja true
source ~/.cpprc # activate cpp environment variables
# run go integration tests
(cd samples/client/petstore/go && mvn integration-test)
(cd samples/openapi3/client/petstore/go && mvn integration-test)
(cd samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false && mvn integration-test)
(cd samples/client/others/go/allof_multiple_ref_and_discriminator && mvn integration-test)
(cd samples/client/petstore/cpp-restsdk/client && mvn integration-test)
elif [ "$NODE_INDEX" = "3" ]; then
echo "Running node $NODE_INDEX ... "
# Install node@stable (for angular 6)
set +e
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
export NVM_DIR="/opt/circleci/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
#nvm install stable
# install v16 instead of the latest stable version
nvm install 18
nvm alias default 18
node --version
# Each step uses the same `$BASH_ENV`, so need to modify it
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
echo "[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"" >> $BASH_ENV
(cd samples/client/others/typescript-angular && mvn integration-test)
(cd samples/client/petstore/typescript-angular-v12-provided-in-root && mvn integration-test)
(cd samples/client/petstore/typescript-angular-v13-provided-in-root && mvn integration-test)
(cd samples/client/petstore/typescript-angular-v14-provided-in-root && mvn integration-test)
(cd samples/client/petstore/typescript-angular-v15-provided-in-root && mvn integration-test)
(cd samples/client/petstore/typescript-angular-v16-provided-in-root && mvn integration-test)
(cd samples/client/petstore/typescript-angular-v17-provided-in-root && mvn integration-test)
(cd samples/client/petstore/typescript-angular-v18-provided-in-root && mvn integration-test)
(cd samples/client/petstore/typescript-angular-v19-provided-in-root && mvn integration-test)
(cd samples/openapi3/client/petstore/typescript/builds/default && mvn integration-test)
(cd samples/openapi3/client/petstore/typescript/tests/default && mvn integration-test)
(cd samples/openapi3/client/petstore/typescript/builds/jquery && mvn integration-test)
(cd samples/openapi3/client/petstore/typescript/tests/jquery && mvn integration-test)
(cd samples/openapi3/client/petstore/typescript/builds/object_params && mvn integration-test)
(cd samples/openapi3/client/petstore/typescript/tests/object_params && mvn integration-test)
(cd samples/openapi3/client/petstore/typescript/builds/inversify && mvn integration-test)
(cd samples/openapi3/client/petstore/typescript/tests/inversify && mvn integration-test)
#(cd samples/openapi3/client/petstore/typescript/tests/deno && mvn integration-test)
(cd samples/openapi3/client/petstore/typescript/builds/browser && mvn integration-test)
(cd samples/openapi3/client/petstore/typescript/tests/browser && mvn integration-test)
(cd samples/openapi3/client/petstore/typescript/builds/nullable-enum && mvn integration-test)
(cd samples/client/petstore/typescript-fetch/builds/default && mvn integration-test)
(cd samples/client/petstore/typescript-fetch/builds/es6-target && mvn integration-test)
(cd samples/client/petstore/typescript-fetch/builds/with-npm-version && mvn integration-test)
(cd samples/client/petstore/typescript-fetch/tests/default && mvn integration-test)
(cd samples/client/petstore/typescript-node/npm && mvn integration-test)
(cd samples/client/petstore/typescript-rxjs/builds/with-npm-version && mvn integration-test)
(cd samples/client/petstore/typescript-axios/builds/with-npm-version && mvn integration-test)
(cd samples/client/petstore/typescript-axios/tests/default && mvn integration-test)
(cd samples/client/petstore/typescript-axios/tests/with-complex-headers && mvn integration-test)
(cd samples/client/petstore/javascript-flowtyped && mvn integration-test)
(cd samples/client/petstore/javascript-es6 && mvn integration-test)
(cd samples/client/petstore/javascript-promise-es6 && mvn integration-test)
(cd samples/server/petstore/typescript-nestjs-server && mvn integration-test)
echo "Testing ruby"
(cd samples/client/petstore/ruby && mvn integration-test)
(cd samples/client/petstore/ruby-faraday && mvn integration-test)
(cd samples/client/petstore/ruby-httpx && mvn integration-test)
(cd samples/client/petstore/ruby-autoload && mvn integration-test)
else
echo "Running node $NODE_INDEX ..."
java -version
(cd samples/client/petstore/scala-akka && mvn integration-test)
(cd samples/client/petstore/scala-sttp && mvn integration-test)
(cd samples/client/petstore/scala-sttp-circe && mvn integration-test)
(cd samples/client/petstore/scala-sttp4 && mvn integration-test)
(cd samples/client/petstore/clojure && mvn integration-test)
(cd samples/client/petstore/java/jersey2-java8 && mvn integration-test)
(cd samples/openapi3/client/petstore/java/jersey2-java8 && mvn integration-test)
(cd samples/client/petstore/java/jersey3 && mvn integration-test)
(cd samples/client/petstore/java/jersey3-oneOf && mvn integration-test)
(cd samples/client/others/java/okhttp-gson-streaming && mvn integration-test)
(cd samples/client/petstore/java/okhttp-gson && mvn integration-test)
(cd samples/client/petstore/java/okhttp-gson-3.1 && mvn integration-test)
(cd samples/client/petstore/java/okhttp-gson-dynamicOperations && mvn integration-test)
(cd samples/client/petstore/java/resteasy && mvn integration-test)
(cd samples/client/petstore/java-micronaut-client && mvn integration-test)
(cd samples/client/petstore/java/apache-httpclient && mvn integration-test)
(cd samples/client/petstore/java/resttemplate-jakarta && mvn integration-test)
./mvnw clean install
fi

View File

@@ -15,10 +15,8 @@
<div align="center">
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.16.0`):
[![Build Status](https://api.travis-ci.com/OpenAPITools/openapi-generator.svg?branch=master&status=passed)](https://app.travis-ci.com/github/OpenAPITools/openapi-generator/builds)
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.17.0`):
[![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator)
[![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator)
[![Bitrise](https://img.shields.io/bitrise/4a2b10a819d12b67/master?label=bitrise%3A%20Swift+4,5&token=859FMDR8QHwabCzwvZK6vQ)](https://app.bitrise.io/app/4a2b10a819d12b67)
</div>
@@ -150,8 +148,8 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
| OpenAPI Generator Version | Release Date | Notes |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- |
| 7.16.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.16.0-SNAPSHOT/) | 22.09.2025 | Minor release with breaking changes (with fallback) |
| [7.15.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.15.0) (latest stable release) | 22.08.2025 | Minor release with breaking changes (with fallback) |
| 7.17.0 (upcoming minor release) [SNAPSHOT](https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-to-test-with-the-latest-master-of-openapi-generator) | 24.10.2025 | Minor release with breaking changes (with fallback) |
| [7.16.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.16.0) (latest stable release) | 28.09.2025 | 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) |
@@ -214,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.15.0/openapi-generator-cli-7.15.0.jar`
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.16.0/openapi-generator-cli-7.16.0.jar`
For **Mac/Linux** users:
```sh
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.15.0/openapi-generator-cli-7.15.0.jar -O openapi-generator-cli.jar
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.16.0/openapi-generator-cli-7.16.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.15.0/openapi-generator-cli-7.15.0.jar
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.16.0/openapi-generator-cli-7.16.0.jar
```
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
@@ -458,7 +456,7 @@ openapi-generator-cli version
To use a specific version of "openapi-generator-cli"
```sh
openapi-generator-cli version-manager set 7.15.0
openapi-generator-cli version-manager set 7.16.0
```
Or install it as dev-dependency:
@@ -482,7 +480,7 @@ pip install openapi-generator-cli
To install a specific version
```
pip install openapi-generator-cli==7.15.0
pip install openapi-generator-cli==7.16.0
```
You can also install with [jdk4py](https://github.com/activeviam/jdk4py) instead of java binary. (python>=3.10 is required)
@@ -508,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.15.0/openapi-generator-cli-7.15.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.16.0/openapi-generator-cli-7.16.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

@@ -1,119 +0,0 @@
version: '{branch}-{build}'
image: Visual Studio 2022
hosts:
petstore.swagger.io: 127.0.0.1
install:
- cmd: SET PATH=C:\maven\apache-maven-3.8.3\bin;C:\gradle\gradle-7.6\bin;%JAVA_HOME%\bin;%PATH%
- cmd: SET MAVEN_OPTS=-Xmx4g
- cmd: SET JAVA_OPTS=-Xmx4g
- cmd: SET M2_HOME=C:\maven\apache-maven-3.8.3
- cmd: java -version
- cmd: dir/w
- cmd: docker pull swaggerapi/petstore
- cmd: docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
- ps: Start-Sleep -s 120
- ps: $PSVersionTable.PSVersion
- ps: Install-Module -Name Pester -Force -Scope CurrentUser -SkipPublisherCheck
build_script:
- dotnet --info
# build C# aspnetcore 5.0 server
#- dotnet build samples\server\petstore\aspnetcore-5.0\Org.OpenAPITools.sln
## build C# aspnetcore 3.1 server
#- dotnet build samples\server\petstore\aspnetcore-3.1\Org.OpenAPITools.sln
## build C# aspnetcore 3.0 server
#- dotnet build samples\server\petstore\aspnetcore-3.0\Org.OpenAPITools.sln
## build C# aspnetcore 2.2 server
#- dotnet build samples\server\petstore\aspnetcore\Org.OpenAPITools.sln
## build C# API client (multiple frameworks)
#- dotnet build samples\client\petstore\csharp\OpenAPIClientCoreAndNet47\Org.OpenAPITools.sln
## build C# API client (httpclient)
#- dotnet build samples\client\petstore\csharp\OpenAPIClient-httpclient\Org.OpenAPITools.sln
## build C# API client (generichost)
#- dotnet build samples\client\petstore\csharp\OpenAPIClient-generichost-netstandard2.0\Org.OpenAPITools.sln
## build C# API client (netcore)
#- dotnet build samples\client\petstore\csharp\OpenAPIClient\Org.OpenAPITools.sln
#- dotnet build samples\client\petstore\csharp\OpenAPIClientCore\Org.OpenAPITools.sln
## build C# API client (.net framework 4.7)
#- dotnet build samples\client\petstore\csharp\OpenAPIClient-net47\Org.OpenAPITools.sln
## build C# API client (.net framework 4.8)
#- dotnet build samples\client\petstore\csharp\OpenAPIClient-net48\Org.OpenAPITools.sln
## build C# API client (.net 5.0)
#- dotnet build samples\client\petstore\csharp\OpenAPIClient-net5.0\Org.OpenAPITools.sln
## build C# API client (.net 5.0 with ConditionalSerialization)
#- dotnet build samples\client\petstore\csharp\OpenAPIClient-ConditionalSerialization\Org.OpenAPITools.sln
test_script:
- dotnet test samples\client\petstore\csharp\generichost\latest\ComposedEnum\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\latest\InlineEnumAnyOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\latest\Tags\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\latest\HelloWorld\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\latest\OneOfList\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net9\AllOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net9\AnyOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net9\AnyOfNoCompare\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net9\FormModels\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
# - dotnet test samples\client\petstore\csharp\generichost\net9\ManualSourceGenerationTests\ManualTests.Latest.UseSourceGeneration\ManualTests.Latest.UseSourceGeneration.csproj
# - dotnet test samples\client\petstore\csharp\generichost\net9\ManualPetstoreTests\OpenAPIClient-generichost-manual-tests\OpenAPIClient-generichost-manual-tests.csproj
- dotnet test samples\client\petstore\csharp\generichost\net9\NullReferenceTypes\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net9\OneOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net9\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net9\SourceGeneration\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net9\UseDateTimeForDate\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net8\AllOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net8\AnyOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net8\AnyOfNoCompare\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net8\FormModels\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net8\ManualSourceGenerationTests\ManualTests.Latest.UseSourceGeneration\ManualTests.Latest.UseSourceGeneration.csproj
- dotnet test samples\client\petstore\csharp\generichost\net8\ManualPetstoreTests\OpenAPIClient-generichost-manual-tests\OpenAPIClient-generichost-manual-tests.csproj
- dotnet test samples\client\petstore\csharp\generichost\net8\NullReferenceTypes\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net8\OneOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net8\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net8\SourceGeneration\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net8\UseDateTimeForDate\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\standard2.0\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net4.8\AllOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net4.8\AnyOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net4.8\AnyOfNoCompare\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net4.8\FormModels\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net4.8\OneOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net4.8\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net4.8\UseDateTimeForDate\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net4.7\AllOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net4.7\AnyOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net4.7\AnyOfNoCompare\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net4.7\FormModels\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net4.7\OneOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net4.7\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\generichost\net4.7\UseDateTimeForDate\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\httpclient\standard2.0\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\restsharp\net4.7\MultipleFrameworks\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\restsharp\net4.7\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\restsharp\net4.8\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\restsharp\net8\ParameterMappings\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\restsharp\net8\EnumMappings\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\restsharp\net8\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\restsharp\net8\UseDateTimeForDate\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\restsharp\standard2.0\ConditionalSerialization\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp\restsharp\standard2.0\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
### TODO: Execute all generators via powershell or other
# generate all petstore clients
# - .\bin\windows\run-all-petstore.cmd
# generate all petstore clients (openapi3)
# - .\bin\openapi3\windows\run-all-petstore.cmd
# test ps petstore
- ps: |
cd samples\client\petstore\powershell\
.\CIRunTest.ps1
cache:
- C:\maven\
- C:\gradle\
- C:\Users\appveyor\.m2

View File

@@ -0,0 +1,14 @@
# for .net standard httpclient
generatorName: csharp
outputDir: samples/client/petstore/csharp/httpclient/net9/Petstore-nonPublicApi
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-addpet-only.yaml
templateDir: modules/openapi-generator/src/main/resources/csharp
library: httpclient
additionalProperties:
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
useCompareNetObjects: true
disallowAdditionalPropertiesIfNotPresent: false
useOneOfDiscriminatorLookup: true
targetFramework: net9.0
equatable: true
nonPublicApi: true

View File

@@ -2,7 +2,7 @@
generatorName: csharp
library: restsharp
outputDir: samples/client/petstore/csharp/restsharp/standard2.0/Petstore
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature-oneof-primitive-types.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature-oneof-primitive-types-localhost.yaml
templateDir: modules/openapi-generator/src/main/resources/csharp
additionalProperties:
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'

View File

@@ -1,6 +1,6 @@
generatorName: go
outputDir: samples/client/petstore/go/go-petstore
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing-localhost.yaml
templateDir: modules/openapi-generator/src/main/resources/go
additionalProperties:
packageName: petstore

View File

@@ -0,0 +1,8 @@
generatorName: go-server
outputDir: samples/server/others/go-server/optional-body
inputSpec: modules/openapi-generator/src/test/resources/3_0/optional_body.yaml
templateDir: modules/openapi-generator/src/main/resources/go-server
additionalProperties:
hideGenerationTimestamp: "true"
packageName: petstoreserver
addResponseHeaders: true

View File

@@ -0,0 +1,8 @@
generatorName: jaxrs-cxf-client
outputDir: samples/client/petstore/jaxrs-cxf-client-swagger2
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/cxf
additionalProperties:
artifactId: jaxrs-cxf-petstore-swagger2
documentationProvider: swagger2
annotationLibrary: swagger2

View File

@@ -0,0 +1,10 @@
generatorName: jaxrs-spec
outputDir: samples/server/petstore/jaxrs-spec-withxml/
inputSpec: modules/openapi-generator/src/test/resources/3_0/jaxrs-spec/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/spec
additionalProperties:
artifactId: jaxrs-spec-withxml-petstore-server
serializableModel: "true"
hideGenerationTimestamp: "true"
generateBuilders: "true"
withXml: true

View File

@@ -0,0 +1,14 @@
generatorName: kotlin-spring
outputDir: samples/server/petstore/kotlin-springboot-additionalproperties
library: spring-boot
inputSpec: samples/server/petstore/kotlin-springboot-additionalproperties/src/main/resources/openapi.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-spring
additionalProperties:
documentationProvider: none
annotationLibrary: none
useSwaggerUI: "false"
serviceImplementation: "true"
serializableModel: "true"
beanValidations: "true"
useSpringBoot3: "true"
requestMappingMode: api_interface

View File

@@ -0,0 +1,15 @@
generatorName: python
outputDir: samples/openapi3/client/petstore/python-httpx
inputSpec: modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/python
library: httpx
additionalProperties:
packageName: petstore_api
mapNumberTo: float
poetry1: true
nameMappings:
_type: underscore_type
type_: type_with_underscore
modelNameMappings:
# The OpenAPI spec ApiResponse conflicts with the internal ApiResponse
ApiResponse: ModelApiResponse

View File

@@ -1,7 +1,7 @@
generatorName: ruby
outputDir: samples/client/petstore/ruby-faraday
library: faraday
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/ruby/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/ruby-client
additionalProperties:
gemVersion: 1.0.0

View File

@@ -0,0 +1,12 @@
generatorName: spring
outputDir: samples/openapi3/server/petstore/spring-boot-oneof-interface
inputSpec: modules/openapi-generator/src/test/resources/3_0/oneof_polymorphism_and_inheritance.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
documentationProvider: springdoc
artifactId: springboot-oneof
snapshotVersion: "true"
hideGenerationTimestamp: "true"
useOneOfInterfaces: "true"
useDeductionForOneOfInterfaces: "true"

View File

@@ -0,0 +1,9 @@
generatorName: typescript-angular
outputDir: samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/typescript-angular
additionalProperties:
ngVersion: 19.0.0
supportsES6: true
enumNameMappings:
delivered: SHIPPED

View File

@@ -0,0 +1,9 @@
generatorName: typescript-angular
outputDir: samples/client/petstore/typescript-angular-v20-provided-in-root/builds/default
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/typescript-angular
additionalProperties:
ngVersion: 20.0.0
supportsES6: true
enumNameMappings:
delivered: SHIPPED

View File

@@ -0,0 +1,7 @@
generatorName: typescript-fetch
outputDir: samples/client/others/typescript-fetch/infinite-recursion-issue
inputSpec: modules/openapi-generator/src/test/resources/3_0/typescript-fetch/infinite-recursion-issue.yaml
templateDir: modules/openapi-generator/src/main/resources/typescript-fetch
additionalProperties:
enumPropertyNaming: "original"
enumUnknownDefaultCase: true

View File

@@ -1,6 +0,0 @@
systemProperties:
skipFormModel: "true"
generatorName: scala-lagom-server
outputDir: samples/server/petstore/scala-lagom-server
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/scala-lagom-server

View File

@@ -5,11 +5,11 @@ Running `./save_dart_keywords.sh` from this directory will generate `dart-keywor
## When should the keywords be generated?
`save_dart_keywords.sh` should be run when a new version of Dart is release to update the keywords file.
`save_dart_keywords.sh` should be run when a new version of Dart is released to update the keywords file.
The last Dart version that was used to generate the keywords can be found in `dart-version.txt`.
## What does the shellscript do?
## What does the shell script do?
1. run the dart app
- `dart run save-dart-keywords.dart`

View File

@@ -59,6 +59,6 @@
sha256: 45cdaba3d2adc212cd4f0184ad475419a95e2326254c2ef84175e210c922b2f3
# rust axum test files
- filename: "samples/server/petstore/rust-axum/output/rust-axum-oneof/tests/oneof_with_discriminator.rs"
sha256: 2d4f5a069fdcb3057bb078d5e75b3de63cd477b97725e457079df24bd2c30600
sha256: b2093528aac971193f2863a70f46eea45cf8bda79120b133a614599e80d8b46d
- filename: "samples/server/petstore/rust-axum/output/openapi-v3/tests/oneof_untagged.rs"
sha256: e72fbf81a9849dc7abb7e2169f2fc355c8b1cf991c0e2ffc083126abd9e966e7
sha256: 1d3fb01f65e98290b1d3eece28014c7d3e3f2fdf18e7110249d3c591cc4642ab

View File

@@ -538,6 +538,7 @@ OpenAPI Normalizer transforms the input OpenAPI doc/spec (which may not perfectl
- SIMPLIFY_ONEOF_ANYOF
- SIMPLIFY_BOOLEAN_ENUM
- REFACTOR_ALLOF_WITH_PROPERTIES_ONLY
(One can use `DISABLE_ALL=true` to disable all the rules)
@@ -643,9 +644,16 @@ Example:
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/required-properties.yaml -o /tmp/java-okhttp/ --openapi-normalizer NORMALIZER_CLASS=org.openapitools.codegen.OpenAPINormalizerTest$RemoveRequiredNormalizer
```
- `REMOVE_PROPERTIES_FROM_TYPE_OTHER_THAN_OBJECT`: When set to true, remove the "properties" of a schema with type other than "object".
Example:
```
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/required-properties.yaml -o /tmp/java-okhttp/ --openapi-normalizer REMOVE_PROPERTIES_FROM_TYPE_OTHER_THAN_OBJECT=true
```
- `FILTER`
The `FILTER` parameter allows selective inclusion of API operations based on specific criteria. It applies the `x-internal: true` property to operations that do **not** match the specified values, preventing them from being generated.
The `FILTER` parameter allows selective inclusion of API operations based on specific criteria. It applies the `x-internal: true` property to operations that do **not** match the specified values, preventing them from being generated. Multiple filters can be separated by a semicolon.
### Available Filters
@@ -658,6 +666,9 @@ The `FILTER` parameter allows selective inclusion of API operations based on spe
- **`tag`**
When set to `tag:person|basic`, operations **not** tagged with `person` or `basic` will be marked as internal (`x-internal: true`), and will not be generated.
- **`path`**
When set to `path:/v1|/v2`, operations on paths **not** starting with `/v1` or with `/v2` will be marked as internal (`x-internal: true`), and will not be generated.
### Example Usage
```sh
@@ -665,7 +676,7 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat
-g java \
-i modules/openapi-generator/src/test/resources/3_0/petstore.yaml \
-o /tmp/java-okhttp/ \
--openapi-normalizer FILTER="operationId:addPet|getPetById"
--openapi-normalizer FILTER="operationId:addPet|getPetById ; tag:store"
```
- `SET_CONTAINER_TO_NULLABLE`: When set to `array|set|map` (or just `array`) for example, it will set `nullable` in array, set and map to true.

View File

@@ -5,7 +5,7 @@ title: Debugging
## Generation
As a user there may be times when generated outputs don't match your expectations it's unclear why. The CLI supports a `--dry-run` option which may be used to inspect the anticipated file operations without making changes to the file system.
As a user there may be times when generated outputs don't match your expectations and it's unclear why. The CLI supports a `--dry-run` option which may be used to inspect the anticipated file operations without making changes to the file system.
Suppose you generate using the `--minimal-update` option, and you notice on subsequent generations of a client that no files have changed. This is by design.

View File

@@ -3,6 +3,7 @@ id: generators
title: Generators List
---
[main] INFO o.o.c.l.PythonFastAPIServerCodegen - Skipping sorting of path operations, order matters, let the developer decide via their specification file.
The following generators are available:
## CLIENT generators
@@ -151,7 +152,7 @@ The following generators are available:
* [scala-cask](generators/scala-cask.md)
* [scala-finch](generators/scala-finch.md)
* [scala-http4s-server](generators/scala-http4s-server.md)
* [scala-lagom-server](generators/scala-lagom-server.md)
* [scala-lagom-server-deprecated (deprecated)](generators/scala-lagom-server-deprecated.md)
* [scala-play-server](generators/scala-play-server.md)
* [scalatra](generators/scalatra.md)
* [spring](generators/spring.md)

View File

@@ -95,10 +95,12 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|sourceFolder|source folder for generated code| |src/main/java|
|springApiVersion|Value for 'version' attribute in @RequestMapping (for Spring 7 and above).| |null|
|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi|
|title|server title name or client service name| |OpenAPI Spring|
|unhandledException|Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring `@ControllerAdvice` directives).| |false|
|useBeanValidation|Use BeanValidation API annotations| |true|
|useDeductionForOneOfInterfaces|whether to use deduction for generated oneOf interfaces| |false|
|useEnumCaseInsensitive|Use `equalsIgnoreCase` when String for enum comparison| |false|
|useFeignClientContextId|Whether to generate Feign client with contextId parameter.| |true|
|useFeignClientUrl|Whether to generate Feign client with url parameter.| |true|
@@ -131,6 +133,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|x-spring-paginated|Add `org.springframework.data.domain.Pageable` to controller method. Can be used to handle `page`, `size` and `sort` query parameters. If these query parameters are also specified in the operation spec, they will be removed from the controller method as their values can be obtained from the `Pageable` object.|OPERATION|false
|x-version-param|Marker property that tells that this parameter would be used for endpoint versioning. Applicable for headers & query params. true/false|OPERATION_PARAMETER|null
|x-pattern-message|Add this property whenever you need to customize the invalidation error message for the regex pattern of a variable|FIELD, OPERATION_PARAMETER|null
|x-size-message|Add this property whenever you need to customize the invalidation error message for the size or length of a variable|FIELD, OPERATION_PARAMETER|null
|x-minimum-message|Add this property whenever you need to customize the invalidation error message for the minimum value of a variable|FIELD, OPERATION_PARAMETER|null
|x-maximum-message|Add this property whenever you need to customize the invalidation error message for the maximum value of a variable|FIELD, OPERATION_PARAMETER|null
|x-spring-api-version|Value for 'version' attribute in @RequestMapping (for Spring 7 and above).|OPERATION|null
## IMPORT MAPPING

View File

@@ -22,6 +22,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null|
|additionalOneOfTypeAnnotations|Additional annotations for oneOf interfaces(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|annotationLibrary|Select the complementary documentation annotation library.|<dl><dt>**none**</dt><dd>Do not annotate Model and Api with complementary annotations.</dd><dt>**swagger1**</dt><dd>Annotate Model and Api using the Swagger Annotations 1.x library.</dd><dt>**swagger2**</dt><dd>Annotate Model and Api using the Swagger Annotations 2.x library.</dd></dl>|swagger1|
|apiPackage|package for generated api classes| |org.openapitools.api|
|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-jaxrs-client|
@@ -39,6 +40,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|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|
|documentationProvider|Select the OpenAPI documentation provider.|<dl><dt>**none**</dt><dd>Do not publish an OpenAPI specification.</dd><dt>**swagger1**</dt><dd>Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using Swagger-Core 1.x.</dd><dt>**swagger2**</dt><dd>Generate an OpenAPI 3 specification using Swagger-Core 2.x.</dd></dl>|swagger1|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE', 'legacy' and 'original'| |MACRO_CASE|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|

View File

@@ -23,6 +23,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null|
|additionalOneOfTypeAnnotations|Additional annotations for oneOf interfaces(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|annotationLibrary|Select the complementary documentation annotation library.|<dl><dt>**none**</dt><dd>Do not annotate Model and Api with complementary annotations.</dd><dt>**swagger1**</dt><dd>Annotate Model and Api using the Swagger Annotations 1.x library.</dd><dt>**swagger2**</dt><dd>Annotate Model and Api using the Swagger Annotations 2.x library.</dd></dl>|swagger1|
|apiPackage|package for generated api classes| |org.openapitools.api|
|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-cxf-server|
@@ -40,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|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|
|documentationProvider|Select the OpenAPI documentation provider.|<dl><dt>**none**</dt><dd>Do not publish an OpenAPI specification.</dd><dt>**swagger1**</dt><dd>Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using Swagger-Core 1.x.</dd><dt>**swagger2**</dt><dd>Generate an OpenAPI 3 specification using Swagger-Core 2.x.</dd></dl>|swagger1|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE', 'legacy' and 'original'| |MACRO_CASE|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|

View File

@@ -23,6 +23,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null|
|additionalOneOfTypeAnnotations|Additional annotations for oneOf interfaces(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|annotationLibrary|Select the complementary documentation annotation library.|<dl><dt>**none**</dt><dd>Do not annotate Model and Api with complementary annotations.</dd><dt>**swagger1**</dt><dd>Annotate Model and Api using the Swagger Annotations 1.x library.</dd><dt>**swagger2**</dt><dd>Annotate Model and Api using the Swagger Annotations 2.x library.</dd></dl>|swagger1|
|apiPackage|package for generated api classes| |org.openapitools.api|
|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-cxf-server|
@@ -40,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|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|
|documentationProvider|Select the OpenAPI documentation provider.|<dl><dt>**none**</dt><dd>Do not publish an OpenAPI specification.</dd><dt>**swagger1**</dt><dd>Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using Swagger-Core 1.x.</dd><dt>**swagger2**</dt><dd>Generate an OpenAPI 3 specification using Swagger-Core 2.x.</dd></dl>|swagger1|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE', 'legacy' and 'original'| |MACRO_CASE|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|

View File

@@ -67,6 +67,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL|
|x-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null
|x-pattern-message|Add this property whenever you need to customize the invalidation error message for the regex pattern of a variable|FIELD, OPERATION_PARAMETER|null
|x-size-message|Add this property whenever you need to customize the invalidation error message for the size or length of a variable|FIELD, OPERATION_PARAMETER|null
|x-minimum-message|Add this property whenever you need to customize the invalidation error message for the minimum value of a variable|FIELD, OPERATION_PARAMETER|null
|x-maximum-message|Add this property whenever you need to customize the invalidation error message for the maximum value of a variable|FIELD, OPERATION_PARAMETER|null
|x-kotlin-implements|Ability to specify interfaces that model must implement|MODEL|empty array
|x-kotlin-implements-fields|Specify attributes that are implemented by the interface(s) added via `x-kotlin-implements`|MODEL|empty array

View File

@@ -1,167 +0,0 @@
---
title: Documentation for the postman Generator
---
## METADATA
| Property | Value | Notes |
| -------- | ----- | ----- |
| generator name | postman | pass this to the generate command after -g |
| generator stability | BETA | |
| generator type | DOCUMENTATION | |
| generator default templating engine | mustache | |
| helpTxt | Generates a postman JSON file | |
## CONFIG OPTIONS
These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.
| Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- |
|folderStrategy|whether to create folders according to the spec&rsquo;s paths or tags| |null|
|pathParamsAsVariables|whether to create Postman variables for path parameters| |false|
|postmanGuid|whether to convert placeholders (i.e. {{UNIQUE_REFERENCE}}) into Postman formula {{$guid}}| |null|
|postmanGuidPlaceholderName|name of the placeholder (i.e. {{UNIQUE_REFERENCE}}) to replace with Postman formula {{$guid}}| |null|
|postmanIsoTimestamp|whether to convert placeholders (i.e. {{ISO_TIMESTAMP}}) into Postman formula {{$isoTimestamp}}| |null|
|postmanIsoTimestampPlaceholderName|name of the placeholder (i.e. {{ISO_TIMESTAMP}}) to replace with Postman formula {{$isoTimestamp}}| |null|
|postmanVariables|whether to convert placeholders (i.e. {{VAR_1}}) into Postman variables| |null|
|requestParameterGeneration|whether to generate the request parameters based on the schema or the examples| |null|
## IMPORT MAPPING
| Type/Alias | Imports |
| ---------- | ------- |
## INSTANTIATION TYPES
| Type/Alias | Instantiated By |
| ---------- | --------------- |
## LANGUAGE PRIMITIVES
<ul class="column-ul">
</ul>
## RESERVED WORDS
<ul class="column-ul">
</ul>
## FEATURE SET
### Client Modification Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|BasePath|✗|ToolingExtension
|Authorizations|✗|ToolingExtension
|UserAgent|✗|ToolingExtension
|MockServer|✗|ToolingExtension
### Data Type Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Custom|✗|OAS2,OAS3
|Int32|✓|OAS2,OAS3
|Int64|✓|OAS2,OAS3
|Float|✓|OAS2,OAS3
|Double|✓|OAS2,OAS3
|Decimal|✓|ToolingExtension
|String|✓|OAS2,OAS3
|Byte|✓|OAS2,OAS3
|Binary|✓|OAS2,OAS3
|Boolean|✓|OAS2,OAS3
|Date|✓|OAS2,OAS3
|DateTime|✓|OAS2,OAS3
|Password|✓|OAS2,OAS3
|File|✓|OAS2
|Uuid|✗|
|Array|✓|OAS2,OAS3
|Null|✗|OAS3
|AnyType|✗|OAS2,OAS3
|Object|✓|OAS2,OAS3
|Maps|✓|ToolingExtension
|CollectionFormat|✓|OAS2
|CollectionFormatMulti|✓|OAS2
|Enum|✓|OAS2,OAS3
|ArrayOfEnum|✓|ToolingExtension
|ArrayOfModel|✓|ToolingExtension
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
|ArrayOfCollectionOfModel|✓|ToolingExtension
|ArrayOfCollectionOfEnum|✓|ToolingExtension
|MapOfEnum|✓|ToolingExtension
|MapOfModel|✓|ToolingExtension
|MapOfCollectionOfPrimitives|✓|ToolingExtension
|MapOfCollectionOfModel|✓|ToolingExtension
|MapOfCollectionOfEnum|✓|ToolingExtension
### Documentation Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Readme|✗|ToolingExtension
|Model|✓|ToolingExtension
|Api|✓|ToolingExtension
### Global Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Host|✓|OAS2,OAS3
|BasePath|✓|OAS2,OAS3
|Info|✓|OAS2,OAS3
|Schemes|✗|OAS2,OAS3
|PartialSchemes|✓|OAS2,OAS3
|Consumes|✓|OAS2
|Produces|✓|OAS2
|ExternalDocumentation|✓|OAS2,OAS3
|Examples|✓|OAS2,OAS3
|XMLStructureDefinitions|✗|OAS2,OAS3
|MultiServer|✗|OAS3
|ParameterizedServer|✗|OAS3
|ParameterStyling|✗|OAS3
|Callbacks|✓|OAS3
|LinkObjects|✗|OAS3
### Parameter Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Path|✓|OAS2,OAS3
|Query|✓|OAS2,OAS3
|Header|✓|OAS2,OAS3
|Body|✓|OAS2
|FormUnencoded|✓|OAS2
|FormMultipart|✓|OAS2
|Cookie|✓|OAS3
### Schema Support Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Simple|✓|OAS2,OAS3
|Composite|✓|OAS2,OAS3
|Polymorphism|✓|OAS2,OAS3
|Union|✗|OAS3
|allOf|✗|OAS2,OAS3
|anyOf|✗|OAS3
|oneOf|✗|OAS3
|not|✗|OAS3
### Security Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|BasicAuth|✓|OAS2,OAS3
|ApiKey|✓|OAS2,OAS3
|OpenIDConnect|✗|OAS3
|BearerToken|✓|OAS3
|OAuth2_Implicit|✓|OAS2,OAS3
|OAuth2_Password|✓|OAS2,OAS3
|OAuth2_ClientCredentials|✓|OAS2,OAS3
|OAuth2_AuthorizationCode|✓|OAS2,OAS3
|SignatureAuth|✗|OAS3
### Wire Format Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|JSON|✓|OAS2,OAS3
|XML|✓|OAS2,OAS3
|PROTOBUF|✗|ToolingExtension
|Custom|✗|OAS2,OAS3

View File

@@ -25,7 +25,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|generateSourceCodeOnly|Specifies that only a library source code is to be generated.| |false|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|lazyImports|Enable lazy imports.| |false|
|library|library template (sub-template) to use: asyncio, tornado (deprecated), urllib3| |urllib3|
|library|library template (sub-template) to use: asyncio, tornado (deprecated), urllib3, httpx| |urllib3|
|mapNumberTo|Map number to Union[StrictFloat, StrictInt], StrictStr or float.| |Union[StrictFloat, StrictInt]|
|packageName|python package name (convention: snake_case).| |openapi_client|
|packageUrl|python package URL.| |null|

View File

@@ -77,6 +77,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>dyn</li>
<li>else</li>
<li>enum</li>
<li>errors</li>
<li>extern</li>
<li>false</li>
<li>final</li>
@@ -207,8 +208,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|Composite|✓|OAS2,OAS3
|Polymorphism|✗|OAS2,OAS3
|Union|✗|OAS3
|allOf||OAS2,OAS3
|anyOf||OAS3
|allOf||OAS2,OAS3
|anyOf||OAS3
|oneOf|✓|OAS3
|not|✗|OAS3

View File

@@ -27,6 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|packageName|Rust package name (convention: lowercase).| |openapi|
|packageVersion|Rust package version.| |1.0.0|
|preferUnsignedInt|Prefer unsigned integers where minimum value is &gt;= 0| |false|
|reqwestDefaultFeatures|Default features for the reqwest dependency (comma-separated). Use empty for no defaults. This option is for 'reqwest' and 'reqwest-trait' library only.| |native-tls|
|supportAsync|If set, generate async function call instead. This option is for 'reqwest' library only| |true|
|supportMiddleware|If set, add support for reqwest-middleware. This option is for 'reqwest' and 'reqwest-trait' library only| |false|
|supportMultipleResponses|If set, return type wraps an enum of all possible 2xx schemas. This option is for 'reqwest' and 'reqwest-trait' library only| |false|

View File

@@ -1,17 +1,17 @@
---
title: Documentation for the scala-lagom-server Generator
title: Documentation for the scala-lagom-server-deprecated Generator
---
## METADATA
| Property | Value | Notes |
| -------- | ----- | ----- |
| generator name | scala-lagom-server | pass this to the generate command after -g |
| generator stability | STABLE | |
| generator name | scala-lagom-server-deprecated | pass this to the generate command after -g |
| generator stability | DEPRECATED | |
| generator type | SERVER | |
| generator language | Scala | |
| generator default templating engine | mustache | |
| helpTxt | Generates a Lagom API server (Beta) in scala | |
| helpTxt | Generates a Lagom API server (Beta) in scala. IMPORTANT: this generator has been deprecated | |
## CONFIG OPTIONS
These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.

View File

@@ -88,10 +88,12 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|sourceFolder|source folder for generated code| |src/main/java|
|springApiVersion|Value for 'version' attribute in @RequestMapping (for Spring 7 and above).| |null|
|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi|
|title|server title name or client service name| |OpenAPI Spring|
|unhandledException|Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring `@ControllerAdvice` directives).| |false|
|useBeanValidation|Use BeanValidation API annotations| |true|
|useDeductionForOneOfInterfaces|whether to use deduction for generated oneOf interfaces| |false|
|useEnumCaseInsensitive|Use `equalsIgnoreCase` when String for enum comparison| |false|
|useFeignClientContextId|Whether to generate Feign client with contextId parameter.| |true|
|useFeignClientUrl|Whether to generate Feign client with url parameter.| |true|
@@ -124,6 +126,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|x-spring-paginated|Add `org.springframework.data.domain.Pageable` to controller method. Can be used to handle `page`, `size` and `sort` query parameters. If these query parameters are also specified in the operation spec, they will be removed from the controller method as their values can be obtained from the `Pageable` object.|OPERATION|false
|x-version-param|Marker property that tells that this parameter would be used for endpoint versioning. Applicable for headers & query params. true/false|OPERATION_PARAMETER|null
|x-pattern-message|Add this property whenever you need to customize the invalidation error message for the regex pattern of a variable|FIELD, OPERATION_PARAMETER|null
|x-size-message|Add this property whenever you need to customize the invalidation error message for the size or length of a variable|FIELD, OPERATION_PARAMETER|null
|x-minimum-message|Add this property whenever you need to customize the invalidation error message for the minimum value of a variable|FIELD, OPERATION_PARAMETER|null
|x-maximum-message|Add this property whenever you need to customize the invalidation error message for the maximum value of a variable|FIELD, OPERATION_PARAMETER|null
|x-spring-api-version|Value for 'version' attribute in @RequestMapping (for Spring 7 and above).|OPERATION|null
## IMPORT MAPPING

View File

@@ -44,6 +44,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|supportsES6|Generate code that conforms to ES6.| |false|
|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.| |false|
|useSquareBracketsInArrayNames|Setting this property to true will add brackets to array attribute names, e.g. my_values[].| |false|
|withAWSV4Signature|whether to include AWS v4 signature support| |false|
|withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false|
|withNodeImports|Setting this property to true adds imports for NodeJS| |false|
|withSeparateModelsAndApi|Put the model and api in separate folders and in separate classes. This requires in addition a value for 'apiPackage' and 'modelPackage'| |false|
@@ -291,7 +292,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|OAuth2_ClientCredentials|✗|OAS2,OAS3
|OAuth2_AuthorizationCode|✗|OAS2,OAS3
|SignatureAuth|✗|OAS3
|AWSV4Signature||ToolingExtension
|AWSV4Signature||ToolingExtension
### Wire Format Feature
| Name | Supported | Defined By |

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.15.0
openapi-generator-cli version-manager set 7.16.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.15.0/openapi-generator-cli-7.15.0.jar`
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.16.0/openapi-generator-cli-7.16.0.jar`
For **Mac/Linux** users:
```bash
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.15.0/openapi-generator-cli-7.15.0.jar -O openapi-generator-cli.jar
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.16.0/openapi-generator-cli-7.16.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.15.0/openapi-generator-cli-7.15.0.jar
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.16.0/openapi-generator-cli-7.16.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.15.0</version>
<version>7.16.0</version>
<executions>
<execution>
<goals>

View File

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

View File

@@ -29,6 +29,7 @@ import io.airlift.airline.Arguments;
import io.airlift.airline.Command;
import io.airlift.airline.Option;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.Strings;
import org.apache.commons.lang3.StringUtils;
import org.openapitools.codegen.ClientOptInput;
import org.openapitools.codegen.CodegenConfig;
@@ -248,7 +249,7 @@ public class GenerateBatch extends OpenApiGeneratorCommand {
Path filesMeta = Paths.get(outDir.toAbsolutePath().toString(), ".openapi-generator", "FILES");
if (filesMeta.toFile().exists()) {
FileUtils.readLines(filesMeta.toFile(), StandardCharsets.UTF_8).forEach(relativePath -> {
if (!StringUtils.startsWith(relativePath, ".")) {
if (!Strings.CS.startsWith(relativePath, ".")) {
Path file = outDir.resolve(relativePath).toAbsolutePath();
// hack: disallow directory traversal outside of output directory. we don't want to delete wrong files.
if (file.toString().startsWith(outDir.toAbsolutePath().toString())) {

View File

@@ -6,7 +6,7 @@
<artifactId>openapi-generator-project</artifactId>
<groupId>org.openapitools</groupId>
<!-- RELEASE_VERSION -->
<version>7.16.0-SNAPSHOT</version>
<version>7.17.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.15.0"
id "org.openapi.generator" version "7.16.0"
}
----
@@ -113,7 +113,7 @@ buildscript {
// url "https://plugins.gradle.org/m2/"
}
dependencies {
classpath "org.openapitools:openapi-generator-gradle-plugin:7.15.0"
classpath "org.openapitools:openapi-generator-gradle-plugin:7.16.0"
}
}
@@ -759,7 +759,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath('org.openapitools:openapi-generator-gradle-plugin:7.15.0') {
classpath('org.openapitools:openapi-generator-gradle-plugin:7.16.0') {
exclude group: 'com.google.guava'
}
}

View File

@@ -1,5 +1,5 @@
# RELEASE_VERSION
openApiGeneratorVersion=7.16.0-SNAPSHOT
openApiGeneratorVersion=7.17.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.16.0-SNAPSHOT</version>
<version>7.17.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@@ -19,5 +19,5 @@ gradle generateGoWithInvalidSpec # expected outcome: BUILD FAILED
The samples can be tested against other versions of the plugin using the `openApiGeneratorVersion` property. For example:
```bash
gradle -PopenApiGeneratorVersion=7.15.0 openApiValidate
gradle -PopenApiGeneratorVersion=7.16.0 openApiValidate
```

View File

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

View File

@@ -81,12 +81,12 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
/**
* The template directory holding a custom template.
*/
val templateDir = project.objects.property<String?>()
val templateDir = project.objects.property<String>()
/**
* The template location (which may be a directory or a classpath location) holding custom templates.
*/
val templateResourcePath = project.objects.property<String?>()
val templateResourcePath = project.objects.property<String>()
/**
* Adds authorization headers when fetching the OpenAPI definitions remotely.
@@ -109,7 +109,7 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
/**
* Specifies if the existing files should be overwritten during the generation.
*/
val skipOverwrite = project.objects.property<Boolean?>()
val skipOverwrite = project.objects.property<Boolean>()
/**
* Package for generated classes (where supported)
@@ -244,32 +244,32 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
/**
* Reference the library template (sub-template) of a generator.
*/
val library = project.objects.property<String?>()
val library = project.objects.property<String>()
/**
* Git host, e.g. gitlab.com.
*/
val gitHost = project.objects.property<String?>()
val gitHost = project.objects.property<String>()
/**
* Git user ID, e.g. openapitools.
*/
val gitUserId = project.objects.property<String?>()
val gitUserId = project.objects.property<String>()
/**
* Git repo ID, e.g. openapi-generator.
*/
val gitRepoId = project.objects.property<String?>()
val gitRepoId = project.objects.property<String>()
/**
* Release note, default to 'Minor update'.
*/
val releaseNote = project.objects.property<String?>()
val releaseNote = project.objects.property<String>()
/**
* HTTP user agent, e.g. codegen_csharp_api_client, default to 'OpenAPI-Generator/{packageVersion}/{language}'
*/
val httpUserAgent = project.objects.property<String?>()
val httpUserAgent = project.objects.property<String>()
/**
* Specifies how a reserved name should be escaped to. Otherwise, the default _<name> is used.
@@ -279,17 +279,17 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
/**
* Specifies an override location for the .openapi-generator-ignore file. Most useful on initial generation.
*/
val ignoreFileOverride = project.objects.property<String?>()
val ignoreFileOverride = project.objects.property<String>()
/**
* Remove prefix of operationId, e.g. config_getId => getId
*/
val removeOperationIdPrefix = project.objects.property<Boolean?>()
val removeOperationIdPrefix = project.objects.property<Boolean>()
/**
* Skip examples defined in the operation
*/
val skipOperationExample = project.objects.property<Boolean?>()
val skipOperationExample = project.objects.property<Boolean>()
/**
* Defines which API-related files should be generated. This allows you to create a subset of generated files (or none at all).
@@ -394,7 +394,7 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
/**
* Templating engine: "mustache" (default) or "handlebars" (beta)
*/
val engine = project.objects.property<String?>()
val engine = project.objects.property<String>()
/**
* Defines whether the output dir should be cleaned up before generating the output.

View File

@@ -55,7 +55,6 @@ import org.openapitools.codegen.config.MergedSpecBuilder
*
* @author Jim Schubert
*/
@Suppress("UnstableApiUsage")
@CacheableTask
open class GenerateTask @Inject constructor(private val objectFactory: ObjectFactory) : DefaultTask() {
@@ -154,14 +153,14 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
@get:Optional
@get:InputDirectory
@get:PathSensitive(PathSensitivity.RELATIVE)
val templateDir = project.objects.property<String?>()
val templateDir = project.objects.property<String>()
/**
* Resource path containing template files.
*/
@get:Optional
@get:Input
val templateResourcePath = project.objects.property<String?>()
val templateResourcePath = project.objects.property<String>()
/**
* Adds authorization headers when fetching the OpenAPI definitions remotely.
@@ -193,7 +192,7 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
*/
@get:Optional
@get:Input
val skipOverwrite = project.objects.property<Boolean?>()
val skipOverwrite = project.objects.property<Boolean>()
/**
* Package for generated classes (where supported)
@@ -384,42 +383,42 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
*/
@get:Optional
@get:Input
val library = project.objects.property<String?>()
val library = project.objects.property<String>()
/**
* Git host, e.g. gitlab.com.
*/
@get:Optional
@get:Input
val gitHost = project.objects.property<String?>()
val gitHost = project.objects.property<String>()
/**
* Git user ID, e.g. openapitools.
*/
@get:Optional
@get:Input
val gitUserId = project.objects.property<String?>()
val gitUserId = project.objects.property<String>()
/**
* Git repo ID, e.g. openapi-generator.
*/
@get:Optional
@get:Input
val gitRepoId = project.objects.property<String?>()
val gitRepoId = project.objects.property<String>()
/**
* Release note, default to 'Minor update'.
*/
@get:Optional
@get:Input
val releaseNote = project.objects.property<String?>()
val releaseNote = project.objects.property<String>()
/**
* HTTP user agent, e.g. codegen_csharp_api_client, default to 'OpenAPI-Generator/{packageVersion}/{language}'
*/
@get:Optional
@get:Input
val httpUserAgent = project.objects.property<String?>()
val httpUserAgent = project.objects.property<String>()
/**
* Specifies how a reserved name should be escaped to.
@@ -434,21 +433,21 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
@get:Optional
@get:InputFile
@get:PathSensitive(PathSensitivity.RELATIVE)
val ignoreFileOverride = project.objects.property<String?>()
val ignoreFileOverride = project.objects.property<String>()
/**
* Remove prefix of operationId, e.g. config_getId => getId
*/
@get:Optional
@get:Input
val removeOperationIdPrefix = project.objects.property<Boolean?>()
val removeOperationIdPrefix = project.objects.property<Boolean>()
/**
* Remove examples defined in the operation
*/
@get:Optional
@get:Input
val skipOperationExample = project.objects.property<Boolean?>()
val skipOperationExample = project.objects.property<Boolean>()
/**
* Defines which API-related files should be generated. This allows you to create a subset of generated files (or none at all).
@@ -581,7 +580,7 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
*/
@get:Optional
@get:Input
val engine = project.objects.property<String?>()
val engine = project.objects.property<String>()
/**
* Defines whether the output dir should be cleaned up before generating the output.
@@ -598,19 +597,11 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
@get:Input
val dryRun = project.objects.property<Boolean>()
private fun <T : Any?> Property<T>.ifNotEmpty(block: Property<T>.(T) -> Unit) {
private fun <T> Property<T>.ifNotEmpty(block: Property<T>.(T) -> Unit) {
if (isPresent) {
val item: T? = get()
if (item != null) {
when (get()) {
is String -> if ((get() as String).isNotEmpty()) {
block(get())
}
is String? -> if (true == (get() as String?)?.isNotEmpty()) {
block(get())
}
else -> block(get())
}
when (val value = get()) {
is String -> if (value.isNotEmpty()) block(value)
else -> block(value)
}
}
}
@@ -725,7 +716,7 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
}
skipOverwrite.ifNotEmpty { value ->
configurator.setSkipOverwrite(value ?: false)
configurator.setSkipOverwrite(value)
}
generatorName.ifNotEmpty { value ->
@@ -820,11 +811,11 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
}
removeOperationIdPrefix.ifNotEmpty { value ->
configurator.setRemoveOperationIdPrefix(value!!)
configurator.setRemoveOperationIdPrefix(value)
}
skipOperationExample.ifNotEmpty { value ->
configurator.setSkipOperationExample(value!!)
configurator.setSkipOperationExample(value)
}
logToStderr.ifNotEmpty { value ->

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.15.0</version>
<version>7.16.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.16.0-SNAPSHOT</version>
<version>7.17.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>
@@ -217,9 +217,9 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<swagger-annotations-version>2.2.16</swagger-annotations-version>
<jersey-version>2.35</jersey-version>
<jackson-version>2.17.1</jackson-version>
<jackson-databind-version>2.17.1</jackson-databind-version>
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
<jackson-version>2.19.2</jackson-version>
<jackson-databind-version>2.19.2</jackson-databind-version>
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<junit-version>4.13.2</junit-version>
<scribejava-apis-version>8.3.3</scribejava-apis-version>

View File

@@ -15,7 +15,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.16.0-SNAPSHOT</version>
<version>7.17.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>
@@ -232,8 +232,8 @@
<properties>
<swagger-annotations-version>1.5.8</swagger-annotations-version>
<jersey-version>2.27</jersey-version>
<jackson-version>2.15.2</jackson-version>
<jackson-databind-nullable-version>0.2.0</jackson-databind-nullable-version>
<jackson-version>2.19.2</jackson-version>
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jodatime-version>2.7</jodatime-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
<junit-version>4.13.2</junit-version>

View File

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

View File

@@ -15,8 +15,8 @@
<properties>
<swagger-annotations-version>1.5.8</swagger-annotations-version>
<jersey-version>2.35</jersey-version>
<jackson-version>2.17.1</jackson-version>
<jackson-databind-nullable-version>0.2.1</jackson-databind-nullable-version>
<jackson-version>2.19.2</jackson-version>
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jodatime-version>2.7</jodatime-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
<junit-version>5.10.2</junit-version>

View File

@@ -13,7 +13,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.16.0-SNAPSHOT</version>
<version>7.17.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.16.0-SNAPSHOT</version>
<version>7.17.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.16.0-SNAPSHOT</version>
<version>7.17.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>
@@ -111,7 +111,7 @@
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
<version>0.2.6</version>
<version>0.2.7</version>
</dependency>
<!-- Bean Validation API support -->
<dependency>

View File

@@ -5,7 +5,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<!-- RELEASE_VERSION -->
<version>7.16.0-SNAPSHOT</version>
<version>7.17.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.16.0-SNAPSHOT</version>
<version>7.17.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.16.0-SNAPSHOT</version>
<version>7.17.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@@ -456,4 +456,31 @@ public class CodegenConstants {
public static final String USE_DEFAULT_VALUES_FOR_REQUIRED_VARS = "useDefaultValuesForRequiredVars";
public static final String DEFAULT_TO_EMPTY_CONTAINER = "defaultToEmptyContainer";
// Vendor extensions
public static final String X_INTERNAL = "x-internal";
public static final String X_PARENT = "x-parent";
public static final String X_COMPOSED_DATA_TYPE = "x-composed-data-type";
public static final String X_BASE_NAME = "x-base-name";
public static final String X_IS_VALUE_TYPE = "x-is-value-type";
public static final String X_IS_REFERENCE_TYPE = "x-is-reference-type";
public static final String X_IS_NULLABLE_TYPE = "x-is-nullable-type";
public static final String X_IS_BASE_OR_NEW_DISCRIMINATOR = "x-is-base-or-new-discriminator";
public static final String X_ENUM_BYTE = "x-enum-byte";
public static final String X_HTTP_STATUS = "x-http-status";
public static final String X_HTTP_STATUSES_WITH_RETURN = "x-http-statuses-with-return";
public static final String X_SET_COOKIE = "x-set-cookie";
public static final String X_DUPLICATES = "x-duplicates";
public static final String X_HTTP_STATUS_IS_DEFAULT = "x-http-status-is-default";
public static final String X_ONLY_DEFAULT = "x-only-default";
public static final String X_HTTP_STATUS_RANGE = "x-http-status-range";
public static final String X_NOT_NULLABLE_REFERENCE_TYPES = "x-not-nullable-reference-types";
public static final String X_HAS_NOT_NULLABLE_REFERENCE_TYPES = "x-has-not-nullable-reference-types";
public static final String X_NULLABLE_VALUE_TYPE = "x-nullable-value-type";
public static final String X_NULLABLE_TYPE = "x-nullable-type";
public static final String X_CSHARP_VALUE_TYPE = "x-csharp-value-type";
public static final String X_REGEX = "x-regex";
public static final String X_MODIFIERS = "x-modifiers";
public static final String X_MODIFIER_PREFIX = "x-modifier-";
public static final String X_MODEL_IS_MUTABLE = "x-model-is-mutable";
}

View File

@@ -115,6 +115,15 @@ public class CodegenOperation {
return nonEmpty(bodyParams);
}
/**
* Check if there's at least one optional body parameter
*
* @return true if optional body parameter exists, false otherwise
*/
public boolean getHasOptionalBodyParam() {
return nonEmpty(bodyParams) && nonEmpty(optionalParams) && bodyParams.stream().anyMatch(optionalParams::contains);
}
/**
* Check if there's at least one query parameter
*

View File

@@ -88,8 +88,7 @@ import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static org.openapitools.codegen.CodegenConstants.DEFAULT_TO_EMPTY_CONTAINER;
import static org.openapitools.codegen.CodegenConstants.UNSUPPORTED_V310_SPEC_MSG;
import static org.openapitools.codegen.CodegenConstants.*;
import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER;
import static org.openapitools.codegen.utils.OnceLogger.once;
import static org.openapitools.codegen.utils.StringUtils.*;
@@ -5197,7 +5196,7 @@ public class DefaultCodegen implements CodegenConfig {
String method = p.getKey();
Operation op = p.getValue();
if (op.getExtensions() != null && Boolean.TRUE.equals(op.getExtensions().get("x-internal"))) {
if (op.getExtensions() != null && Boolean.TRUE.equals(op.getExtensions().get(X_INTERNAL))) {
// skip operation if x-internal sets to true
LOGGER.info("Operation ({} {} - {}) not generated since x-internal is set to true",
method, expression, op.getOperationId());
@@ -5735,7 +5734,7 @@ public class DefaultCodegen implements CodegenConfig {
cs.name = key;
cs.description = securityScheme.getDescription();
cs.type = securityScheme.getType().toString();
cs.isCode = cs.isPassword = cs.isApplication = cs.isImplicit = cs.isOpenId = false;
cs.isCode = cs.isPassword = cs.isApplication = cs.isImplicit = cs.isOpenId = cs.isOAuth = false;
cs.isHttpSignature = false;
cs.isBasicBasic = cs.isBasicBearer = false;
cs.scheme = securityScheme.getScheme();

View File

@@ -61,6 +61,7 @@ import java.util.function.Supplier;
import java.util.stream.Collectors;
import static org.apache.commons.lang3.StringUtils.removeStart;
import static org.openapitools.codegen.CodegenConstants.X_INTERNAL;
import static org.openapitools.codegen.utils.OnceLogger.once;
@SuppressWarnings("rawtypes")
@@ -486,7 +487,7 @@ public class DefaultGenerator implements Generator {
Schema schema = ModelUtils.getSchemas(this.openAPI).get(name);
if (schema.getExtensions() != null && Boolean.TRUE.equals(schema.getExtensions().get("x-internal"))) {
if (schema.getExtensions() != null && Boolean.TRUE.equals(schema.getExtensions().get(X_INTERNAL))) {
LOGGER.info("Model {} not generated since x-internal is set to true", name);
continue;
} else if (ModelUtils.isFreeFormObject(schema, openAPI)) { // check to see if it's a free-form object
@@ -1564,7 +1565,7 @@ public class DefaultGenerator implements Generator {
final List<SecurityRequirement> globalSecurities = openAPI.getSecurity();
for (Tag tag : tags) {
try {
if (operation.getExtensions() != null && Boolean.TRUE.equals(operation.getExtensions().get("x-internal"))) {
if (operation.getExtensions() != null && Boolean.TRUE.equals(operation.getExtensions().get(X_INTERNAL))) {
// skip operation if x-internal sets to true
LOGGER.info("Operation ({} {} - {}) not generated since x-internal is set to true",
httpMethod, resourcePath, operation.getOperationId());

View File

@@ -356,7 +356,9 @@ public class InlineModelResolver {
} else if (schema.getProperties() != null) {
// If non-object type is specified but also properties
LOGGER.error("Illegal schema found with non-object type combined with properties," +
" no properties should be defined:\n " + schema.toString());
" no properties should be defined:" +
" consider using --openapi-normalizer REMOVE_PROPERTIES_FROM_TYPE_OTHER_THAN_OBJECT=true\n " +
schema.toString());
return;
} else if (schema.getAdditionalProperties() != null) {
// If non-object type is specified but also additionalProperties

View File

@@ -37,6 +37,8 @@ import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import static org.openapitools.codegen.CodegenConstants.X_INTERNAL;
import static org.openapitools.codegen.CodegenConstants.X_PARENT;
import static org.openapitools.codegen.utils.ModelUtils.simplifyOneOfAnyOfWithOnlyOneNonNullSubSchema;
import static org.openapitools.codegen.utils.StringUtils.getUniqueString;
@@ -47,7 +49,7 @@ public class OpenAPINormalizer {
private TreeSet<String> anyTypeTreeSet = new TreeSet<>();
protected final Logger LOGGER = LoggerFactory.getLogger(OpenAPINormalizer.class);
protected static final Logger LOGGER = LoggerFactory.getLogger(OpenAPINormalizer.class);
Set<String> ruleNames = new TreeSet<>();
Set<String> rulesDefaultToTrue = new TreeSet<>();
@@ -122,20 +124,18 @@ public class OpenAPINormalizer {
// the allOf contains a new schema containing the properties in the top level
final String REFACTOR_ALLOF_WITH_PROPERTIES_ONLY = "REFACTOR_ALLOF_WITH_PROPERTIES_ONLY";
// when set to true, remove the "properties" of a schema with type other than "object"
final String REMOVE_PROPERTIES_FROM_TYPE_OTHER_THAN_OBJECT = "REMOVE_PROPERTIES_FROM_TYPE_OTHER_THAN_OBJECT";
// when set to true, normalize OpenAPI 3.1 spec to make it work with the generator
final String NORMALIZE_31SPEC = "NORMALIZE_31SPEC";
// when set to true, remove x-internal: true from models, operations
final String REMOVE_X_INTERNAL = "REMOVE_X_INTERNAL";
final String X_INTERNAL = "x-internal";
boolean removeXInternal;
// when set (e.g. operationId:getPetById|addPet), filter out (or remove) everything else
final String FILTER = "FILTER";
HashSet<String> operationIdFilters = new HashSet<>();
HashSet<String> methodFilters = new HashSet<>();
HashSet<String> tagFilters = new HashSet<>();
// when set (e.g. operationId:getPetById|addPet), filter out (or remove) everything else
final String SET_CONTAINER_TO_NULLABLE = "SET_CONTAINER_TO_NULLABLE";
@@ -209,11 +209,13 @@ public class OpenAPINormalizer {
ruleNames.add(SET_CONTAINER_TO_NULLABLE);
ruleNames.add(SET_PRIMITIVE_TYPES_TO_NULLABLE);
ruleNames.add(SIMPLIFY_ONEOF_ANYOF_ENUM);
ruleNames.add(REMOVE_PROPERTIES_FROM_TYPE_OTHER_THAN_OBJECT);
// rules that are default to true
rules.put(SIMPLIFY_ONEOF_ANYOF, true);
rules.put(SIMPLIFY_BOOLEAN_ENUM, true);
rules.put(SIMPLIFY_ONEOF_ANYOF_ENUM, true);
rules.put(REFACTOR_ALLOF_WITH_PROPERTIES_ONLY, true);
processRules(inputRules);
@@ -274,30 +276,7 @@ public class OpenAPINormalizer {
if (inputRules.get(FILTER) != null) {
rules.put(FILTER, true);
String[] filterStrs = inputRules.get(FILTER).split(":");
if (filterStrs.length != 2) { // only support operationId with : at the moment
LOGGER.error("FILTER rule must be in the form of `operationId:name1|name2|name3` or `method:get|post|put` or `tag:tag1|tag2|tag3`: {}", inputRules.get(FILTER));
} else {
if ("operationId".equals(filterStrs[0])) {
operationIdFilters = Arrays.stream(filterStrs[1].split("[|]"))
.filter(Objects::nonNull)
.map(String::trim)
.collect(Collectors.toCollection(HashSet::new));
} else if ("method".equals(filterStrs[0])) {
methodFilters = Arrays.stream(filterStrs[1].split("[|]"))
.filter(Objects::nonNull)
.map(String::trim)
.collect(Collectors.toCollection(HashSet::new));
} else if ("tag".equals(filterStrs[0])) {
tagFilters = Arrays.stream(filterStrs[1].split("[|]"))
.filter(Objects::nonNull)
.map(String::trim)
.collect(Collectors.toCollection(HashSet::new));
} else {
LOGGER.error("FILTER rule must be in the form of `operationId:name1|name2|name3` or `method:get|post|put` or `tag:tag1|tag2|tag3`: {}", inputRules.get(FILTER));
}
}
// actual parsing is delayed to allow customization of the Filter processing
}
if (inputRules.get(SET_CONTAINER_TO_NULLABLE) != null) {
@@ -343,6 +322,19 @@ public class OpenAPINormalizer {
}
}
/**
* Create the filter to process the FILTER normalizer.
* Override this to create a custom filter normalizer.
*
* @param openApi Contract used in the filtering (could be used for customization).
* @param filters full FILTER value
*
* @return a Filter containing the parsed filters.
*/
protected Filter createFilter(OpenAPI openApi, String filters) {
return new Filter(filters);
}
/**
* Normalizes the OpenAPI input, which may not perfectly conform to
* the specification.
@@ -404,15 +396,15 @@ public class OpenAPINormalizer {
"trace", PathItem::getTrace
);
// Iterates over each HTTP method in methodMap, retrieves the corresponding Operation from the PathItem,
// and marks it as internal (`x-internal`) if the method is not in methodFilters.
methodMap.forEach((method, getter) -> {
Operation operation = getter.apply(path);
if (operation != null && !methodFilters.isEmpty()) {
LOGGER.info("operation `{}` marked internal only (x-internal: `{}`) by the method FILTER", operation.getOperationId(), !methodFilters.contains(method));
operation.addExtension("x-internal", !methodFilters.contains(method));
if (Boolean.TRUE.equals(getRule(FILTER))) {
String filters = inputRules.get(FILTER);
Filter filter = createFilter(this.openAPI, filters);
if (filter.parse()) {
// Iterates over each HTTP method in methodMap, retrieves the corresponding Operations from the PathItem,
// and marks it as internal (`x-internal=true`) if the method/operationId/tag/path is not in the filters.
filter.apply(pathsEntry.getKey(), path, methodMap);
}
});
}
// Include callback operation as well
for (Operation operation : path.readOperations()) {
@@ -429,22 +421,6 @@ public class OpenAPINormalizer {
normalizeParameters(path.getParameters());
for (Operation operation : operations) {
if (operationIdFilters.size() > 0) {
if (operationIdFilters.contains(operation.getOperationId())) {
operation.addExtension("x-internal", false);
} else {
LOGGER.info("operation `{}` marked as internal only (x-internal: true) by the operationId FILTER", operation.getOperationId());
operation.addExtension("x-internal", true);
}
} else if (!tagFilters.isEmpty()) {
if (operation.getTags().stream().anyMatch(tagFilters::contains)) {
operation.addExtension("x-internal", false);
} else {
LOGGER.info("operation `{}` marked as internal only (x-internal: true) by the tag FILTER", operation.getOperationId());
operation.addExtension("x-internal", true);
}
}
normalizeOperation(operation);
normalizeRequestBody(operation);
normalizeParameters(operation.getParameters());
@@ -723,15 +699,19 @@ public class OpenAPINormalizer {
if (skipNormalization(schema, visitedSchemas)) {
return schema;
}
if (ModelUtils.isNullTypeSchema(openAPI, schema)) {
return schema;
}
markSchemaAsVisited(schema, visitedSchemas);
processNormalizeOtherThanObjectWithProperties(schema);
if (ModelUtils.isArraySchema(schema)) { // array
Schema result = normalizeArraySchema(schema);
normalizeSchema(result.getItems(), visitedSchemas);
return result;
} else if (schema.getAdditionalProperties() instanceof Schema) { // map
normalizeMapSchema(schema);
normalizeSchema((Schema) schema.getAdditionalProperties(), visitedSchemas);
} else if (ModelUtils.isOneOf(schema)) { // oneOf
return normalizeOneOf(schema, visitedSchemas);
} else if (ModelUtils.isAnyOf(schema)) { // anyOf
@@ -768,6 +748,9 @@ public class OpenAPINormalizer {
return schema;
} else if (schema.getProperties() != null && !schema.getProperties().isEmpty()) {
normalizeProperties(schema.getProperties(), visitedSchemas);
} else if (schema.getAdditionalProperties() instanceof Schema) { // map
normalizeMapSchema(schema);
normalizeSchema((Schema) schema.getAdditionalProperties(), visitedSchemas);
} else if (schema instanceof BooleanSchema) {
normalizeBooleanSchema(schema, visitedSchemas);
} else if (schema instanceof IntegerSchema) {
@@ -849,6 +832,20 @@ public class OpenAPINormalizer {
}
for (Map.Entry<String, Schema> propertiesEntry : properties.entrySet()) {
Schema property = propertiesEntry.getValue();
// remove x-internal if needed (same logic as normalizeComponentsSchemas)
if (property.getExtensions() != null && getRule(REMOVE_X_INTERNAL)) {
Object xInternalValue = property.getExtensions().get(X_INTERNAL);
boolean isInternal = false;
if (xInternalValue instanceof Boolean) {
isInternal = (Boolean) xInternalValue;
} else if (xInternalValue instanceof String) {
isInternal = Boolean.parseBoolean((String) xInternalValue);
}
if (isInternal) {
property.getExtensions().remove(X_INTERNAL);
}
}
Schema newProperty = normalizeSchema(property, new HashSet<>());
propertiesEntry.setValue(newProperty);
}
@@ -1011,6 +1008,7 @@ public class OpenAPINormalizer {
if (schema.getAnyOf() == null) {
return schema;
}
for (int i = 0; i < schema.getAnyOf().size(); i++) {
// normalize anyOf sub schemas one by one
Object item = schema.getAnyOf().get(i);
@@ -1083,10 +1081,10 @@ public class OpenAPINormalizer {
refSchema.setExtensions(new HashMap<>());
}
if (refSchema.getExtensions().containsKey("x-parent")) {
if (refSchema.getExtensions().containsKey(X_PARENT)) {
// doing nothing as x-parent already exists
} else {
refSchema.getExtensions().put("x-parent", true);
refSchema.getExtensions().put(X_PARENT, true);
}
LOGGER.debug("processUseAllOfRefAsParent added `x-parent: true` to {}", refSchema);
@@ -1108,7 +1106,7 @@ public class OpenAPINormalizer {
return;
}
if (Boolean.parseBoolean(String.valueOf(operation.getExtensions().get("x-internal")))) {
if (Boolean.parseBoolean(String.valueOf(operation.getExtensions().get(X_INTERNAL)))) {
operation.getExtensions().remove(X_INTERNAL);
}
}
@@ -1342,7 +1340,7 @@ public class OpenAPINormalizer {
*
* @param schema Schema to modify
* @param subSchemas List of sub-schemas to check
* @param schemaType Type of composed schema ("oneOf" or "anyOf")
* @param composedType Type of composed schema ("oneOf" or "anyOf")
* @return Simplified schema
*/
protected Schema simplifyComposedSchemaWithEnums(Schema schema, List<Object> subSchemas, String composedType) {
@@ -1811,4 +1809,181 @@ public class OpenAPINormalizer {
}
// ===================== end of rules =====================
protected static class Filter {
public static final String OPERATION_ID = "operationId";
public static final String METHOD = "method";
public static final String TAG = "tag";
public static final String PATH = "path";
private final String filters;
protected Set<String> operationIdFilters = Collections.emptySet();
protected Set<String> methodFilters = Collections.emptySet();
protected Set<String> tagFilters = Collections.emptySet();
protected Set<String> pathStartingWithFilters = Collections.emptySet();
private boolean hasFilter;
protected Filter(String filters) {
this.filters = filters.trim();
}
/**
* Perform the parsing of the filter string.
*
* @return true if filters need to be processed
*/
public boolean parse() {
if (StringUtils.isEmpty(filters)) {
return false;
}
try {
doParse();
return hasFilter();
} catch (RuntimeException e) {
String message = String.format(Locale.ROOT, "FILTER rule [%s] must be in the form of `%s:name1|name2|name3` or `%s:get|post|put` or `%s:tag1|tag2|tag3` or `%s:/v1|/v2`. Error: %s",
filters, Filter.OPERATION_ID, Filter.METHOD, Filter.TAG, Filter.PATH, e.getMessage());
// throw an exception. This is a breaking change compared to pre 7.16.0
// Workaround: fix the syntax!
throw new IllegalArgumentException(message);
}
}
private void doParse() {
for (String filter : filters.split(";")) {
filter = filter.trim();
String[] filterStrs = filter.split(":");
if (filterStrs.length != 2) { // only support filter with : at the moment
throw new IllegalArgumentException("filter with no value not supported :[" + filter + "]");
} else {
String filterKey = filterStrs[0].trim();
String filterValue = filterStrs[1];
Set<String> parsedFilters = splitByPipe(filterValue);
hasFilter = true;
if (OPERATION_ID.equals(filterKey)) {
operationIdFilters = parsedFilters;
} else if (METHOD.equals(filterKey)) {
methodFilters = parsedFilters;
} else if (TAG.equals(filterKey)) {
tagFilters = parsedFilters;
} else if (PATH.equals(filterKey)) {
pathStartingWithFilters = parsedFilters;
} else {
parse(filterKey, filterValue);
}
}
}
}
/**
* Split the filterValue by pipe.
*
* @return the split values.
*/
protected Set<String> splitByPipe(String filterValue) {
return Arrays.stream(filterValue.split("[|]"))
.filter(Objects::nonNull)
.map(String::trim)
.collect(Collectors.toCollection(HashSet::new));
}
/**
* Parse non default filters.
*
* Override this method to add custom parsing logic.
*
* By default throws IllegalArgumentException.
*
* @param filterName name of the filter
* @param filterValue value of the filter
*/
protected void parse(String filterName, String filterValue) {
parseFails(filterName, filterValue);
}
protected void parseFails(String filterName, String filterValue) {
throw new IllegalArgumentException("filter not supported :[" + filterName + ":" + filterValue + "]");
}
/**
* Test if the OpenAPI contract match an extra filter.
*
* Override this method to add custom logic.
*
* @param operation Openapi Operation
* @param path Path of the operation
*
* @return true if the operation of path match the filter
*/
protected boolean hasCustomFilterMatch(String path, Operation operation) {
return false;
}
public boolean hasFilter() {
return hasFilter;
}
public void apply(String path, PathItem pathItem, Map<String, Function<PathItem, Operation>> methodMap) {
methodMap.forEach((method, getter) -> {
Operation operation = getter.apply(pathItem);
if (operation != null) {
boolean found = false;
found |= logIfMatch(PATH, operation, hasPathStarting(path));
found |= logIfMatch(TAG, operation, hasTag(operation));
found |= logIfMatch(OPERATION_ID, operation, hasOperationId(operation));
found |= logIfMatch(METHOD, operation, hasMethod(method));
found |= hasCustomFilterMatch(path, operation);
operation.addExtension(X_INTERNAL, !found);
}
});
}
protected boolean logIfMatch(String filterName, Operation operation, boolean filterMatched) {
if (filterMatched) {
logMatch(filterName, operation);
}
return filterMatched;
}
protected void logMatch(String filterName, Operation operation) {
getLogger().info("operation `{}` marked as internal only (x-internal: true) by the {} FILTER", operation.getOperationId(), filterName);
}
protected Logger getLogger() {
return OpenAPINormalizer.LOGGER;
}
private boolean hasPathStarting(String path) {
return pathStartingWithFilters.stream().anyMatch(filter -> path.startsWith(filter));
}
private boolean hasTag( Operation operation) {
return operation.getTags() != null && operation.getTags().stream().anyMatch(tagFilters::contains);
}
private boolean hasOperationId(Operation operation) {
return operationIdFilters.contains(operation.getOperationId());
}
private boolean hasMethod(String method) {
return methodFilters.contains(method);
}
}
/**
* When set to true, remove "properties" attribute on schema other than "object"
* since it should be ignored and may result in odd generated code
*
* @param schema Schema
* @return Schema
*/
protected void processNormalizeOtherThanObjectWithProperties(Schema schema) {
if (getRule(REMOVE_PROPERTIES_FROM_TYPE_OTHER_THAN_OBJECT)) {
// Check object models / any type models / composed models for properties,
// if the schema has a type defined that is not "object" it should not define
// any properties
if (schema.getType() != null && !"object".equals(schema.getType())) {
schema.setProperties(null);
}
}
}
}

View File

@@ -13,6 +13,7 @@ public enum VendorExtension {
X_KOTLIN_IMPLEMENTS("x-kotlin-implements", ExtensionLevel.MODEL, "Ability to specify interfaces that model must implement", "empty array"),
X_KOTLIN_IMPLEMENTS_FIELDS("x-kotlin-implements-fields", ExtensionLevel.MODEL, "Specify attributes that are implemented by the interface(s) added via `x-kotlin-implements`", "empty array"),
X_SPRING_PAGINATED("x-spring-paginated", ExtensionLevel.OPERATION, "Add `org.springframework.data.domain.Pageable` to controller method. Can be used to handle `page`, `size` and `sort` query parameters. If these query parameters are also specified in the operation spec, they will be removed from the controller method as their values can be obtained from the `Pageable` object.", "false"),
X_SPRING_API_VERSION("x-spring-api-version", ExtensionLevel.OPERATION, "Value for 'version' attribute in @RequestMapping (for Spring 7 and above).", null),
X_SPRING_PROVIDE_ARGS("x-spring-provide-args", ExtensionLevel.OPERATION, "Allows adding additional hidden parameters in the API specification to allow access to content such as header values or properties", "empty array"),
X_DISCRIMINATOR_VALUE("x-discriminator-value", ExtensionLevel.MODEL, "Used with model inheritance to specify value for discriminator that identifies current model", ""),
X_SETTER_EXTRA_ANNOTATION("x-setter-extra-annotation", ExtensionLevel.FIELD, "Custom annotation that can be specified over java setter for specific field", "When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value"),
@@ -26,8 +27,10 @@ public enum VendorExtension {
X_OPERATION_EXTRA_ANNOTATION("x-operation-extra-annotation", ExtensionLevel.OPERATION, "List of custom annotations to be added to operation", null),
X_VERSION_PARAM("x-version-param", ExtensionLevel.OPERATION_PARAMETER, "Marker property that tells that this parameter would be used for endpoint versioning. Applicable for headers & query params. true/false", null),
X_PATTERN_MESSAGE("x-pattern-message", Arrays.asList(ExtensionLevel.FIELD, ExtensionLevel.OPERATION_PARAMETER), "Add this property whenever you need to customize the invalidation error message for the regex pattern of a variable", null),
X_ZERO_BASED_ENUM("x-zero-based-enum", ExtensionLevel.MODEL, "When used on an enum, the index will not be generated and the default numbering will be used, zero-based", "false"),
;
X_SIZE_MESSAGE("x-size-message", Arrays.asList(ExtensionLevel.FIELD, ExtensionLevel.OPERATION_PARAMETER), "Add this property whenever you need to customize the invalidation error message for the size or length of a variable", null),
X_MINIMUM_MESSAGE("x-minimum-message", Arrays.asList(ExtensionLevel.FIELD, ExtensionLevel.OPERATION_PARAMETER), "Add this property whenever you need to customize the invalidation error message for the minimum value of a variable", null),
X_MAXIMUM_MESSAGE("x-maximum-message", Arrays.asList(ExtensionLevel.FIELD, ExtensionLevel.OPERATION_PARAMETER), "Add this property whenever you need to customize the invalidation error message for the maximum value of a variable", null),
X_ZERO_BASED_ENUM("x-zero-based-enum", ExtensionLevel.MODEL, "When used on an enum, the index will not be generated and the default numbering will be used, zero-based", "false");
private final String name;
private final List<ExtensionLevel> levels;

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