Compare commits

...

45 Commits

Author SHA1 Message Date
William Cheng
51228436e0 7.18.0 release (#22567) 2025-12-22 17:32:30 +08:00
William Cheng
ec0a63dcf3 update dotnet 9 versin in workflow (#22566)
* update dotnet 9 versin in workflow

* revert
2025-12-22 17:23:32 +08:00
devhl-labs
9779468cdc [csharp] Add .net10 support (#22562)
* added .net10

* delete samples

* delete samples

* build samples again

* build samples again again

* fix pr gate

* update pr gate names

* dont build solution with no project file

* move samples

* move samples
2025-12-22 16:09:33 +08:00
dabdirb
fb2878cb23 fix #22492 [BUG][JAVA][MAVEN] Lombok @Getter disables validation and #19743 #18794 #17793 #17606 (#22544)
* fix #22492 [BUG][JAVA][MAVEN] Lombok @Getter disables validation and #19743 #18794  #17793 #17606

* fix #22492 [BUG][JAVA][MAVEN] Lombok @Getter disables validation and #19743 #18794  #17793 #17606

* fix #22492 [BUG][JAVA][MAVEN] Lombok @Getter disables validation and #19743 #18794  #17793 #17606

* fix #22492 [BUG][JAVA][MAVEN] Lombok @Getter disables validation and #19743 #18794  #17793 #17606

* fix #22492 [BUG][JAVA][MAVEN] Lombok @Getter disables validation and #19743 #18794  #17793 #17606

* fix #22492 [BUG][JAVA][MAVEN] Lombok @Getter disables validation and #19743 #18794  #17793 #17606
2025-12-19 13:19:35 +08:00
Albert Waninge
a3d03bad09 [kotlin] fix query parameter encoding (#22512)
* #22339 fix query parameter encoding

* #22339 fix query parameter encoding

* #22339 ran generate-samples with some local adaptations

---------

Co-authored-by: AlbertWaninge <albert.waninge@edsn.nl>
2025-12-18 17:31:27 +08:00
William Cheng
6abe6ff1c4 fix(cpp-qt): Fix enum query parameter serialization for both inline and referenced enums (#22559)
* fix(cpp-qt): Fix enum query parameter serialization for both inline and referenced enums

For enum query parameters, the template was incorrectly using asJsonObject()
which returns {"value": "enumValue"} and then iterating over keys, using
"value" as the parameter name instead of the actual parameter name.

This fix adds special handling for both inline enums (isEnum) and referenced
enums (isEnumRef) to use asJson() directly, which returns the correct enum
string value for URL serialization.

Fixes enum query parameters like ?scope=property instead of ?value=property.

Completes the fix started in PR #21211 which added the asJsonObject() method
to make enum code compile, but the template logic was still incorrect for URL
query parameter serialization.

Note: The petstore samples don't contain enum query parameter tests to
demonstrate this fix (they use string arrays). Future contributors may want
to add enum query parameter examples to better showcase this functionality.

* add tests for enum inline, ref for query parameters

* update cmake version to 3.5

---------

Co-authored-by: Sohaib Athar <sohaibathar@gmail.com>
2025-12-18 16:52:50 +08:00
Tim Grohmann
a529769bf3 feat: #22267 Use type formatting logic while applying non-container exploded query parameter (#22268) 2025-12-18 16:18:14 +08:00
Dennis Melzer
1722f5591b feat: prevent variable resolution when prefixed with $ in server URL templates (#22550)
* feat: no url replacement  for $ variables

* fix test
2025-12-18 15:45:18 +08:00
William Cheng
20136f4b9a [REQ-22001][FIX] Add MCP server support to apiService.mustache (#22558)
Co-authored-by: RL6172 <thibaut.rety@external.engie.com>
2025-12-18 13:52:48 +08:00
dsteeley
f484aeac2c feat: Add serde_validate support. (#22553)
In addition to existing rust-server validation support.
2025-12-18 00:12:01 +08:00
thibautrety
833d1d3d38 [REQ-22001] Add MCP server support to apiService.mustache (#22197)
* Add MCP server support to apiService.mustache

Refactor apiService.mustache to include MCP server support and enhance operation methods.

* Update samples

* update samples in wsl

* remove useless import when mcp is disabled

---------

Co-authored-by: RL6172 <thibaut.rety@external.engie.com>
2025-12-17 16:42:55 +08:00
Nicolas Rodriguez
8e7fd3cfb9 fix(generator): fix java.lang.NullPointerException: Cannot read field "name" because "codegenModel" is null (#22545) 2025-12-17 16:39:49 +08:00
Christopher Molin
149fdcb61f [Java] Use Fully Qualified Name for java.util.Locale in Generated Classes (#22342)
* Remove Imports of `Locale` from all `model.mustache`-files

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Remove Imports of `Locale` from all `modelEnum.mustache`-files

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Remove Imports of `Locale` from all `oneof_model.mustache`-files

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Remove Imports of `Locale` from all `api.mustache`-files

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Remove Imports of `Locale` from all `anyof_model.mustache`-files

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Remove Imports of `Locale` from all `pojo.mustache`-files

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Remove Imports of `Locale` from all `ApiClient.mustache`-files

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Remove Imports of `Locale` from all `ApiKeyAuth.mustache`-files

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Remove Imports of `Locale` from all `JSON.mustache`-files

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Remove Imports of `Locale` from all `HttpSignatureAuth.mustache`-files

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Remove Imports of `Locale` from all `Play24CallFactory.mustache`-files

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Remove Imports of `Locale` from all `Play25CallFactory.mustache`-files

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Remove Imports of `Locale` from all `Play26CallFactory.mustache`-files

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Remove Imports of `Locale` from all `apiException.mustache`-files

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Remove Imports of `Locale` from all `clientConfiguration.mustache`-files

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Remove Imports of `Locale` from all `RequestFactory.mustache`-files

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Remove Imports of `Locale` from all `httpLoggingFilter.mustache`-files

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Remove Imports of `Locale` from all `securityApiUtils.mustache`-files

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Remove Imports of `Locale` from all `validatorUtils.mustache`-files

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Use `Locale`-class Via Fully Qualified Name

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Update Generated 'sample'-files

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Revert Changes

* Inline `Locale` Imports

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Update Generated 'source' Files

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Update `kotlin-spring/model.mustache`

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Update Generated 'sample' Files

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Update Generated 'sample' Files

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Update Generated 'java-feign-hc5' Sample Files

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Update Generated Sample Files

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

* Update Generated Kotlin Sample Files

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>

---------

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>
2025-12-17 15:15:32 +08:00
ricardogrande-masmovil
e1edb9e645 fix: missing imports for array of files and date-time parameters (#1) (#22390) 2025-12-17 15:13:45 +08:00
Jurrie Overgoor
e4a26ce307 [Java] Support JsonNullable in JaxRS-spec (issue #9018) (#22412)
* Support JsonNullable in JaxRS-spec

* Add sample files that are now modified (new import)

* Fix build issue with jaxrs-spec-microprofile-openapi-annotations sample
2025-12-17 15:04:37 +08:00
essapp
1d79f3671a fix: Correct the jsonb according to the logic of jackjson, and solve the problems caused by the changes in v4 style. (#22488)
Co-authored-by: rainmenzhao <43979071+rainmenzhao@users.noreply.github.com>
2025-12-17 15:03:52 +08:00
Mattias Sehlstedt
09a5800771 Centralize the definition of vendor extensions tied to the discriminator (#22542) 2025-12-17 14:59:18 +08:00
Ondra Karmazín
a9f439f1c6 [kotlin-client] ALL: Stop html-escaping default enum parameters (#22506)
The enum constants may be backtick-escaped reserved words (e.g. "DocumentDisposition.`inline`"). Mustache html-escapes the backticks, leading to invalid code such as "DocumentDisposition.&#x60;inline&#x60;".

This change adjusts all Kotlin client Mustache templates to pass the values through as raw values.
2025-12-14 13:03:38 +08:00
Ondra Karmazín
c5ebcda902 [kotlin-client] Vert.x: Fix enum class name template for default operation parameters (#22504)
This change brings the class name construction in line with the other Kotlin client generators.

Fixes #22503
2025-12-13 23:45:29 +08:00
Ramon Onis
b06fdb5781 fix(kotlin): add JsonCreator/JsonValue to Jackson enums (#22535)
* fix(kotlin): add JsonCreator/JsonValue for numeric enums

* Regenerate samples

* Update title in numeric enum YAML file

* rename test
2025-12-13 18:54:45 +08:00
Mateusz Piękos
5f28987b17 Adapted scala-sttp4-jsoniter to use orFail instead of getRight when using separateErrorChannel=false (#22536) 2025-12-13 18:53:14 +08:00
dependabot[bot]
0b296bf50f Bump actions/download-artifact from 6 to 7 (#22539)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 6 to 7.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '7'
  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-12-13 11:31:11 +08:00
dependabot[bot]
39da542b99 Bump actions/upload-artifact from 5 to 6 (#22538)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/upload-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-12-13 11:31:00 +08:00
dependabot[bot]
6d7e8c69a0 Bump actions/cache from 4 to 5 (#22531)
Bumps [actions/cache](https://github.com/actions/cache) from 4 to 5.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4...v5)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-12 17:16:38 +08:00
Kevin Lin
7ccd039a7b [java][okhttp-gson] fix: JSON deserialization fallback for String return types (#22498)
* Use String-based JSON deserialize method with fallback for String return types

* Regenerate samples
2025-12-11 14:47:48 +08:00
Thiago Arrais
8f8001ea1a fix(go): do not generate unused imports (#22524)
Fixes #20599
2025-12-10 19:54:42 +08:00
dsteeley
5c28ab4db2 fix: Update rust-server Cargo.toml to fix client feature compile (#22511) 2025-12-09 15:54:36 +08:00
dependabot[bot]
104c57319f Bump urllib3 from 2.2.3 to 2.6.0 in /samples/client/echo_api/python (#22496)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.2.3 to 2.6.0.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/2.2.3...2.6.0)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-version: 2.6.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-09 15:30:14 +08:00
Jeremy Audet
cfcacf3074 Make python code compatible with urllib3 v2.6.0+ (#22520)
openapi-generator still uses methods that have been removed from urllib3
v2.6.0. The solution is as described in urllib3's changelog:

> Removed the HTTPResponse.getheaders() method in favor of
> HTTPResponse.headers. Removed the HTTPResponse.getheader(name,
> default) method in favor of HTTPResponse.headers.get(name, default).
> (#3622)

See https://urllib3.readthedocs.io/en/latest/changelog.html

Close #22514
2025-12-09 15:29:32 +08:00
William Cheng
5a6fcd3bd5 [kotlin][client] Deprecate jvm-volley support (#22521)
* deprecate kotlin jvm volley support

* delete files
2025-12-09 15:27:21 +08:00
Yong-Han Lin
3b232f6a90 fix: five nondeterministic tests (#22513) 2025-12-09 14:50:08 +08:00
William Cheng
8ad6fff26f python-fastapi: avoid log message in constructor (#22522)
* python-fastapi: avoid log message in constructor

* update doc
2025-12-09 14:47:41 +08:00
dependabot[bot]
7cc0a7adac Bump @modelcontextprotocol/sdk and @angular/cli (#22516)
Bumps [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/typescript-sdk) to 1.24.0 and updates ancestor dependency [@angular/cli](https://github.com/angular/angular-cli). These dependencies need to be updated together.


Updates `@modelcontextprotocol/sdk` from 1.17.3 to 1.24.0
- [Release notes](https://github.com/modelcontextprotocol/typescript-sdk/releases)
- [Commits](https://github.com/modelcontextprotocol/typescript-sdk/compare/1.17.3...1.24.0)

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

---
updated-dependencies:
- dependency-name: "@modelcontextprotocol/sdk"
  dependency-version: 1.24.0
  dependency-type: indirect
- dependency-name: "@angular/cli"
  dependency-version: 20.3.13
  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-12-09 13:43:56 +08:00
dependabot[bot]
74f7351718 Bump @angular/compiler (#22517)
Bumps [@angular/compiler](https://github.com/angular/angular/tree/HEAD/packages/compiler) from 19.0.1 to 19.2.17.
- [Release notes](https://github.com/angular/angular/releases)
- [Changelog](https://github.com/angular/angular/blob/main/CHANGELOG.md)
- [Commits](https://github.com/angular/angular/commits/19.2.17/packages/compiler)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-09 13:43:41 +08:00
dependabot[bot]
d59a54a18a Bump @modelcontextprotocol/sdk and @angular/cli (#22518)
Bumps [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/typescript-sdk) to 1.24.0 and updates ancestor dependency [@angular/cli](https://github.com/angular/angular-cli). These dependencies need to be updated together.


Updates `@modelcontextprotocol/sdk` from 1.17.3 to 1.24.0
- [Release notes](https://github.com/modelcontextprotocol/typescript-sdk/releases)
- [Commits](https://github.com/modelcontextprotocol/typescript-sdk/compare/1.17.3...1.24.0)

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

---
updated-dependencies:
- dependency-name: "@modelcontextprotocol/sdk"
  dependency-version: 1.24.0
  dependency-type: indirect
- dependency-name: "@angular/cli"
  dependency-version: 20.3.13
  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-12-09 13:43:28 +08:00
Nicolas Rodriguez
c91df9edd4 [crystal] fix Model#to_h method (#22508)
* fix(crystal): fix Model#to_h method

* fix(crystal): make optional parameters truly optional

* fix(crystal): update samples

* fix(crystal): fixx model validation with nil values

* feat(crystal): improve enum validation

* fix(crystal): use litteral regex

* fix(crystal): call #to_h instead of #to_hash

* fix(crystal): update samples
2025-12-09 11:31:15 +08:00
Sergey Fetiskin
b86213bea3 [typescript-node] Fixes generation when parent contains TypeScript primitive (#22401)
* fixes parents when schema has additional properties

* exclude primitive types from parent property
2025-12-08 22:26:42 +01:00
William Cheng
ce21b9e503 update urllib3 to newer version (#22515) 2025-12-08 22:20:35 +08:00
William Cheng
38c622019e fix(kotlin-client): jvm-spring-webclient: fix compile error when kotlin detects nullable body (#22509)
* fix(kotlin-client): jvm-spring-webclient: fix compile error when kotlin detects nullable body

* update samples

---------

Co-authored-by: detomarco <idp.detoma@gmail.com>
2025-12-08 16:10:07 +08:00
William Cheng
74c551cd88 disable ts integration testws (#22501) 2025-12-07 15:46:28 +08:00
Károly Kiripolszky
8d17f662de fix(KotlinClientCodegen): store parsed bool values in additionalProperties (#22491) 2025-12-07 10:56:36 +08:00
dependabot[bot]
4f9f14a7d8 Bump express (#22483)
Bumps [express](https://github.com/expressjs/express) from 4.18.0 to 4.22.1.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/v4.22.1/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.18.0...v4.22.1)

---
updated-dependencies:
- dependency-name: express
  dependency-version: 4.22.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-02 17:57:08 +08:00
William Cheng
da778c46b0 add option to set params_encoder (#22484) 2025-12-02 17:54:44 +08:00
dependabot[bot]
abea33c32a Bump express (#22481)
Bumps [express](https://github.com/expressjs/express) from 4.18.0 to 4.22.1.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/v4.22.1/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.18.0...v4.22.1)

---
updated-dependencies:
- dependency-name: express
  dependency-version: 4.22.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-02 17:04:35 +08:00
dependabot[bot]
7a431db7ef Bump express from 4.19.2 to 4.22.1 in /website (#22479)
Bumps [express](https://github.com/expressjs/express) from 4.19.2 to 4.22.1.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/v4.22.1/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.19.2...v4.22.1)

---
updated-dependencies:
- dependency-name: express
  dependency-version: 4.22.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-02 13:31:43 +08:00
6487 changed files with 443111 additions and 15379 deletions

View File

@@ -21,7 +21,7 @@ jobs:
java-version: 11
distribution: 'zulu'
- name: Cache Maven packages
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}

View File

@@ -21,7 +21,7 @@ jobs:
distribution: 'temurin'
cache: gradle
- name: Cache maven dependencies
uses: actions/cache@v4
uses: actions/cache@v5
env:
cache-name: cache-maven-repository
with:

View File

@@ -40,14 +40,14 @@ jobs:
cache: gradle
# Cache Gradle Dependencies
- name: Setup Gradle Dependencies Cache
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts') }}
# Cache Gradle Wrapper
- name: Setup Gradle Wrapper Cache
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}

View File

@@ -29,14 +29,14 @@ jobs:
java-version: ${{ matrix.java }}
cache: gradle
- uses: actions/cache@v4
- uses: actions/cache@v5
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml', 'modules/**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- uses: actions/cache@v4
- uses: actions/cache@v5
with:
path: |
~/.gradle/caches
@@ -62,7 +62,7 @@ jobs:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
- name: Upload Maven build artifact
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
if: matrix.java == '11' && matrix.os == 'ubuntu-latest'
with:
name: artifact
@@ -98,7 +98,7 @@ jobs:
maven-version: 3.8.8
cache: gradle
- name: Download build artifact
uses: actions/download-artifact@v6
uses: actions/download-artifact@v7
with:
name: artifact
- name: Run Ensures Script

View File

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

View File

@@ -18,7 +18,7 @@ jobs:
java-version: 11
distribution: 'zulu'
- name: Cache Maven packages
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}

View File

@@ -23,7 +23,7 @@ jobs:
distribution: 'temurin'
cache: gradle
- name: Cache maven dependencies
uses: actions/cache@v4
uses: actions/cache@v5
env:
cache-name: cache-maven-repository
with:
@@ -42,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@v5
uses: actions/upload-artifact@v6
with:
name: openapi-generator-cli.jar
path: modules/openapi-generator-cli/target/openapi-generator-cli.jar
@@ -62,7 +62,7 @@ jobs:
distribution: 'temurin'
cache: gradle
- name: Cache maven dependencies
uses: actions/cache@v4
uses: actions/cache@v5
env:
cache-name: cache-maven-repository
with:
@@ -81,7 +81,7 @@ jobs:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
- name: Publish unit test reports
if: ${{ always() }}
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
with:
name: surefire-test-results
path: '**/surefire-reports/TEST-*.xml'
@@ -99,7 +99,7 @@ jobs:
java-version: 11
distribution: 'temurin'
- name: Download openapi-generator-cli.jar artifact
uses: actions/download-artifact@v6
uses: actions/download-artifact@v7
with:
name: openapi-generator-cli.jar
path: modules/openapi-generator-cli/target
@@ -138,7 +138,7 @@ jobs:
java-version: 11
distribution: 'temurin'
- name: Download openapi-generator-cli.jar artifact
uses: actions/download-artifact@v6
uses: actions/download-artifact@v7
with:
name: openapi-generator-cli.jar
path: modules/openapi-generator-cli/target

View File

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

View File

@@ -24,7 +24,7 @@ jobs:
java-version: 11
cache: maven
- name: Cache test dependencies
uses: actions/cache@v4
uses: actions/cache@v5
env:
cache-name: pub-cache
with:

View File

@@ -11,7 +11,7 @@ on:
- samples/client/petstore/csharp/generichost/net4.8/**
jobs:
build:
name: Build .Net projects
name: Build .Net Framework projects
runs-on: windows-latest
strategy:
fail-fast: false

View File

@@ -15,7 +15,7 @@ on:
- samples/client/petstore/csharp/unityWebRequest/standard2.0/**
jobs:
build:
name: Build .Net projects
name: Build .Net Standard projects
runs-on: windows-latest
strategy:
fail-fast: false

59
.github/workflows/samples-dotnet10.yaml vendored Normal file
View File

@@ -0,0 +1,59 @@
name: Samples C# .Net 10 Clients
on:
push:
paths:
- samples/client/petstore/csharp/generichost/latest/**
- samples/client/petstore/csharp/generichost/net10/**
- samples/client/petstore/csharp/httpclient/net10/**
- samples/client/petstore/csharp/restsharp/net10/**
- samples/client/petstore/csharp/unityWebRequest/net10/**
pull_request:
paths:
- samples/client/petstore/csharp/generichost/latest/**
- samples/client/petstore/csharp/generichost/net10/**
- samples/client/petstore/csharp/httpclient/net10/**
- samples/client/petstore/csharp/restsharp/net10/**
- samples/client/petstore/csharp/unityWebRequest/net10/**
jobs:
build:
name: Build .Net 10 projects
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sample:
- samples/client/petstore/csharp/generichost/latest/ComposedEnum
- samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf
- samples/client/petstore/csharp/generichost/latest/Tags
- samples/client/petstore/csharp/generichost/latest/HelloWorld
- samples/client/petstore/csharp/generichost/latest/OneOfList
- samples/client/petstore/csharp/generichost/net10/AllOf
- samples/client/petstore/csharp/generichost/net10/AnyOf
- samples/client/petstore/csharp/generichost/net10/AnyOfNoCompare
- samples/client/petstore/csharp/generichost/net10/FormModels
# - samples/client/petstore/csharp/generichost/net10/ManualPetstoreTests
# - samples/client/petstore/csharp/generichost/net10/ManualSourceGenerationTests
- samples/client/petstore/csharp/generichost/net10/NullReferenceTypes
- samples/client/petstore/csharp/generichost/net10/OneOf
- samples/client/petstore/csharp/generichost/net10/Petstore
- samples/client/petstore/csharp/generichost/net10/SourceGeneration
- samples/client/petstore/csharp/generichost/net10/UseDateTimeForDate
# restsharp
- samples/client/petstore/csharp/restsharp/net10/EnumMappings
# httpclient
- samples/client/petstore/csharp/httpclient/net10/Petstore
- samples/client/petstore/csharp/httpclient/net10/Petstore-nonPublicApi
# unity
# - samples/client/petstore/csharp/unityWebRequest/net10/Petstore
steps:
- uses: actions/checkout@v5
- uses: actions/setup-dotnet@v5.0.0
with:
dotnet-version: '10.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

@@ -15,7 +15,7 @@ on:
- samples/client/petstore/csharp/unityWebRequest/net8/**
jobs:
build:
name: Build .Net projects
name: Build .Net 8 projects
runs-on: ubuntu-latest
strategy:
fail-fast: false

View File

@@ -3,31 +3,24 @@ name: Samples C# .Net 9 Clients
on:
push:
paths:
- samples/client/petstore/csharp/generichost/latest/**
- samples/client/petstore/csharp/generichost/net9/**
- samples/client/petstore/csharp/httpclient/net9/**
- samples/client/petstore/csharp/restsharp/net9/**
- samples/client/petstore/csharp/unityWebRequest/net9/**
pull_request:
paths:
- samples/client/petstore/csharp/generichost/latest/**
- samples/client/petstore/csharp/generichost/net9/**
- samples/client/petstore/csharp/httpclient/net9/**
- samples/client/petstore/csharp/restsharp/net9/**
- samples/client/petstore/csharp/unityWebRequest/net9/**
jobs:
build:
name: Build .Net projects
name: Build .Net 9 projects
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sample:
- samples/client/petstore/csharp/generichost/latest/ComposedEnum
- samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf
- samples/client/petstore/csharp/generichost/latest/Tags
- samples/client/petstore/csharp/generichost/latest/HelloWorld
- samples/client/petstore/csharp/generichost/latest/OneOfList
- samples/client/petstore/csharp/generichost/net9/AllOf
- samples/client/petstore/csharp/generichost/net9/AnyOf
- samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare
@@ -50,7 +43,7 @@ jobs:
- uses: actions/checkout@v5
- uses: actions/setup-dotnet@v5.0.1
with:
dotnet-version: '9.0.101'
dotnet-version: '9.0.x'
- name: Build
working-directory: ${{ matrix.sample }}
run: dotnet build Org.OpenAPITools.sln

View File

@@ -28,7 +28,7 @@ jobs:
java-version: 8
cache: gradle
- name: Cache maven dependencies
uses: actions/cache@v4
uses: actions/cache@v5
env:
cache-name: maven-repository
with:

View File

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

View File

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

View File

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

View File

@@ -121,7 +121,7 @@ jobs:
java-version: 11
cache: gradle
- name: Cache maven dependencies
uses: actions/cache@v4
uses: actions/cache@v5
env:
cache-name: maven-repository
with:
@@ -133,7 +133,7 @@ jobs:
run: mvn clean package --no-transfer-progress
- name: Cache gradle dependencies
uses: actions/cache@v4
uses: actions/cache@v5
env:
cache-name: gradle-caches
with:
@@ -141,7 +141,7 @@ jobs:
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/*.gradle', '**/*.gradle.kts') }}
- name: Cache gradle wrapper
uses: actions/cache@v4
uses: actions/cache@v5
env:
cache-name: gradle-wrapper
with:

View File

@@ -44,7 +44,7 @@ jobs:
java-version: 17
cache: gradle
- name: Cache maven dependencies
uses: actions/cache@v4
uses: actions/cache@v5
env:
cache-name: maven-repository
with:
@@ -57,7 +57,7 @@ jobs:
run: mvn clean package --no-transfer-progress
- name: Cache gradle dependencies
uses: actions/cache@v4
uses: actions/cache@v5
env:
cache-name: gradle-caches
with:
@@ -65,7 +65,7 @@ jobs:
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/*.gradle', '**/*.gradle.kts') }}
- name: Cache gradle wrapper
uses: actions/cache@v4
uses: actions/cache@v5
env:
cache-name: gradle-wrapper
with:

View File

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

View File

@@ -32,7 +32,7 @@ jobs:
distribution: 'temurin'
java-version: ${{ matrix.version }}
- name: Cache maven dependencies
uses: actions/cache@v4
uses: actions/cache@v5
env:
cache-name: maven-repository
with:

View File

@@ -33,7 +33,7 @@ jobs:
distribution: 'temurin'
java-version: ${{ matrix.version }}
- name: Cache maven dependencies
uses: actions/cache@v4
uses: actions/cache@v5
env:
cache-name: maven-repository
with:

View File

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

View File

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

View File

@@ -26,7 +26,7 @@ jobs:
- name: Setup sbt launcher
uses: sbt/setup-sbt@v1
- name: Cache maven dependencies
uses: actions/cache@v4
uses: actions/cache@v5
env:
cache-name: maven-repository
with:

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -29,7 +29,6 @@ jobs:
# needs Android configured
#- samples/client/petstore/kotlin-json-request-string
- samples/client/petstore/kotlin-jvm-okhttp4-coroutines
- samples/client/petstore/kotlin-jvm-volley
- samples/client/petstore/kotlin-moshi-codegen
- samples/client/petstore/kotlin-multiplatform
- samples/client/petstore/kotlin-multiplatform-kotlinx-datetime
@@ -47,10 +46,8 @@ jobs:
- samples/client/petstore/kotlin-array-integer-enum
- samples/client/petstore/kotlin-default-values-jvm-okhttp4
- samples/client/petstore/kotlin-default-values-jvm-retrofit2
- samples/client/petstore/kotlin-default-values-jvm-volley
- samples/client/petstore/kotlin-default-values-multiplatform
- samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4
- samples/client/petstore/kotlin-array-simple-string-jvm-volley
- samples/client/petstore/kotlin-array-simple-string-multiplatform
- samples/client/petstore/kotlin-bigdecimal-default-multiplatform
- samples/client/petstore/kotlin-bigdecimal-default-okhttp4
@@ -81,7 +78,7 @@ jobs:
java-version: 11
cache: gradle
- name: Cache maven dependencies
uses: actions/cache@v4
uses: actions/cache@v5
env:
cache-name: maven-repository
with:

View File

@@ -28,7 +28,7 @@ jobs:
java-version: 17
cache: gradle
- name: Cache maven dependencies
uses: actions/cache@v4
uses: actions/cache@v5
env:
cache-name: maven-repository
with:

View File

@@ -61,7 +61,7 @@ jobs:
java-version: 17
cache: gradle
- name: Cache maven dependencies
uses: actions/cache@v4
uses: actions/cache@v5
env:
cache-name: maven-repository
with:

View File

@@ -34,7 +34,7 @@ jobs:
java-version: 21
cache: gradle
- name: Cache maven dependencies
uses: actions/cache@v4
uses: actions/cache@v5
env:
cache-name: maven-repository
with:

View File

@@ -65,7 +65,7 @@ jobs:
java-version: 11
cache: gradle
- name: Cache maven dependencies
uses: actions/cache@v4
uses: actions/cache@v5
env:
cache-name: maven-repository
with:

View File

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

View File

@@ -53,7 +53,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache
uses: actions/cache@v4
uses: actions/cache@v5
with:
key: ${{ runner.os }}-python-${{ steps.py.outputs.python-version }}-
path: |

View File

@@ -38,7 +38,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache
uses: actions/cache@v4
uses: actions/cache@v5
with:
key: ${{ runner.os }}-python-${{ steps.py.outputs.python-version }}-
path: |

View File

@@ -60,6 +60,10 @@ jobs:
cargo build --bin ${package##*/} --features cli
target/debug/${package##*/} --help
fi
# Test the validate feature if it exists
if cargo read-manifest | grep -q '"validate"'; then
cargo build --features validate --all-targets
fi
cargo fmt
cargo test
cargo clippy

View File

@@ -58,7 +58,7 @@ jobs:
- name: Setup sbt launcher
uses: sbt/setup-sbt@v1
- name: Cache maven dependencies
uses: actions/cache@v4
uses: actions/cache@v5
env:
cache-name: maven-repository
with:

View File

@@ -26,7 +26,7 @@ jobs:
- name: Setup sbt launcher
uses: sbt/setup-sbt@v1
- name: Cache maven dependencies
uses: actions/cache@v4
uses: actions/cache@v5
env:
cache-name: maven-repository
with:

View File

@@ -31,7 +31,7 @@ jobs:
- name: Setup sbt launcher
uses: sbt/setup-sbt@v1
- name: Cache maven dependencies
uses: actions/cache@v4
uses: actions/cache@v5
env:
cache-name: maven-repository
with:

View File

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

View File

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

View File

@@ -26,7 +26,7 @@ jobs:
distribution: 'temurin'
cache: gradle
- name: Cache maven dependencies
uses: actions/cache@v4
uses: actions/cache@v5
env:
cache-name: cache-maven-repository
with:

View File

@@ -6,6 +6,7 @@ additionalProperties:
shardVersion: 1.0.0
moduleName: Petstore
shardName: petstore
#paramsEncoder: Crest::EnumeratedFlatParamsEncoder
strictSpecBehavior: false
modelNameMappings:
PropertyNameMapping: AnotherPropertyNameMapping

View File

@@ -0,0 +1,14 @@
# for csharp generichost
generatorName: csharp
outputDir: samples/client/petstore/csharp/generichost/net10/AllOf
inputSpec: modules/openapi-generator/src/test/resources/3_0/allOf.yaml
templateDir: modules/openapi-generator/src/main/resources/csharp
additionalProperties:
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
useCompareNetObjects: true
disallowAdditionalPropertiesIfNotPresent: false
nullableReferenceTypes: true
equatable: true
targetFramework: net10.0
modelPropertySorting: alphabetical
operationParameterSorting: alphabetical

View File

@@ -0,0 +1,14 @@
# for csharp generichost
generatorName: csharp
outputDir: samples/client/petstore/csharp/generichost/net10/AnyOf
inputSpec: modules/openapi-generator/src/test/resources/3_0/anyOf.yaml
templateDir: modules/openapi-generator/src/main/resources/csharp
additionalProperties:
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
useCompareNetObjects: true
disallowAdditionalPropertiesIfNotPresent: false
nullableReferenceTypes: true
equatable: true
targetFramework: net10.0
modelPropertySorting: alphabetical
operationParameterSorting: alphabetical

View File

@@ -0,0 +1,14 @@
# for csharp generichost
generatorName: csharp
outputDir: samples/client/petstore/csharp/generichost/net10/AnyOfNoCompare
inputSpec: modules/openapi-generator/src/test/resources/3_0/anyOf.yaml
templateDir: modules/openapi-generator/src/main/resources/csharp
additionalProperties:
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
useCompareNetObjects: false
disallowAdditionalPropertiesIfNotPresent: false
nullableReferenceTypes: true
equatable: true
targetFramework: net10.0
modelPropertySorting: alphabetical
operationParameterSorting: alphabetical

View File

@@ -0,0 +1,17 @@
# for csharp generichost
generatorName: csharp
outputDir: samples/client/petstore/csharp/generichost/net10/FormModels
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
templateDir: modules/openapi-generator/src/main/resources/csharp
additionalProperties:
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
useCompareNetObjects: true
disallowAdditionalPropertiesIfNotPresent: false
nullableReferenceTypes: false
equatable: true
targetFramework: net10.0
skipFormModel: false
modelPropertySorting: alphabetical
operationParameterSorting: alphabetical
inlineSchemaOptions:
RESOLVE_INLINE_ENUMS: true

View File

@@ -0,0 +1,14 @@
# for csharp generichost
generatorName: csharp
outputDir: samples/client/petstore/csharp/generichost/net10/SourceGeneration
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
templateDir: modules/openapi-generator/src/main/resources/csharp
additionalProperties:
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
useCompareNetObjects: true
disallowAdditionalPropertiesIfNotPresent: false
useSourceGeneration: true
equatable: true
targetFramework: net10.0
modelPropertySorting: alphabetical
operationParameterSorting: alphabetical

View File

@@ -0,0 +1,14 @@
# for csharp generichost
generatorName: csharp
outputDir: samples/client/petstore/csharp/generichost/net10/NullReferenceTypes
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
templateDir: modules/openapi-generator/src/main/resources/csharp
additionalProperties:
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
useCompareNetObjects: true
disallowAdditionalPropertiesIfNotPresent: false
nullableReferenceTypes: true
equatable: true
targetFramework: net10.0
modelPropertySorting: alphabetical
operationParameterSorting: alphabetical

View File

@@ -0,0 +1,14 @@
# for csharp generichost
generatorName: csharp
outputDir: samples/client/petstore/csharp/generichost/net10/OneOf
inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOf.yaml
templateDir: modules/openapi-generator/src/main/resources/csharp
additionalProperties:
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
useCompareNetObjects: true
disallowAdditionalPropertiesIfNotPresent: false
nullableReferenceTypes: true
equatable: true
targetFramework: net10.0
modelPropertySorting: alphabetical
operationParameterSorting: alphabetical

View File

@@ -0,0 +1,11 @@
# for csharp generichost
generatorName: csharp
outputDir: samples/client/petstore/csharp/generichost/net10/UseDateTimeForDate
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/dates-api.yaml
templateDir: modules/openapi-generator/src/main/resources/csharp
additionalProperties:
packageGuid: '{2E60EF87-DB0B-4D01-A36E-F5E90F7EC757}'
useDateTimeForDate: true
targetFramework: net10.0
modelPropertySorting: alphabetical
operationParameterSorting: alphabetical

View File

@@ -0,0 +1,14 @@
# for csharp generichost
generatorName: csharp
outputDir: samples/client/petstore/csharp/generichost/net10/Petstore
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
templateDir: modules/openapi-generator/src/main/resources/csharp
additionalProperties:
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
useCompareNetObjects: true
disallowAdditionalPropertiesIfNotPresent: false
nullableReferenceTypes: false
equatable: true
targetFramework: net10.0
modelPropertySorting: alphabetical
operationParameterSorting: alphabetical

View File

@@ -0,0 +1,14 @@
# for .net standard httpclient
generatorName: csharp
outputDir: samples/client/petstore/csharp/httpclient/net10/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: net10.0
equatable: true
nonPublicApi: true

View File

@@ -0,0 +1,13 @@
# for .net standard httpclient
generatorName: csharp
outputDir: samples/client/petstore/csharp/httpclient/net10/Petstore
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
templateDir: modules/openapi-generator/src/main/resources/csharp
library: httpclient
additionalProperties:
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
useCompareNetObjects: true
disallowAdditionalPropertiesIfNotPresent: false
useOneOfDiscriminatorLookup: true
targetFramework: net10.0
equatable: true

View File

@@ -0,0 +1,15 @@
# for .net standard
generatorName: csharp
library: restsharp
outputDir: samples/client/petstore/csharp/restsharp/net10/EnumMappings
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature-oneof-primitive-types.yaml
templateDir: modules/openapi-generator/src/main/resources/csharp
additionalProperties:
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
useCompareNetObjects: true
disallowAdditionalPropertiesIfNotPresent: false
useOneOfDiscriminatorLookup: true
targetFramework: net10.0
equatable: true
enumNameMappings:
delivered: Shipped

View File

@@ -0,0 +1,9 @@
# for .net Unity
generatorName: csharp
outputDir: samples/client/petstore/csharp/unityWebRequest/net10/Petstore
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
templateDir: modules/openapi-generator/src/main/resources/csharp
library: unityWebRequest
additionalProperties:
targetFramework: net10.0
equatable: true

View File

@@ -1,9 +0,0 @@
generatorName: kotlin
outputDir: samples/client/petstore/kotlin-array-simple-string-jvm-volley
inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_7199_array_simple_string.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-client
additionalProperties:
artifactId: kotlin-array-simple-string-jvm-volley
library: jvm-volley
serializationLibrary: gson
generateRoomModels: false

View File

@@ -1,10 +0,0 @@
generatorName: kotlin
outputDir: samples/client/petstore/kotlin-default-values-jvm-volley
inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_10865_default_values.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-client
additionalProperties:
artifactId: kotlin-default-values-jvm-volley
library: jvm-volley
sortParamsByRequiredFlag: false
serializationLibrary: gson
generateRoomModels: true

View File

@@ -1,9 +0,0 @@
generatorName: kotlin
outputDir: samples/client/petstore/kotlin-jvm-volley
library: jvm-volley
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-client
additionalProperties:
artifactId: kotlin-petstore-jvm-volley
generateRoomModels: "true"
serializationLibrary: "gson"

View File

@@ -3,7 +3,6 @@ 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

View File

@@ -25,6 +25,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|moduleName|module name (e.g. TwitterClient| |OpenAPIClient|
|paramsEncoder|params_encoder setting (e.g. Crest::NestedParamsEncoder, Crest::EnumeratedFlatParamsEncoder, Crest::ZeroEnumeratedFlatParamsEncoder| |Crest::NestedParamsEncoder|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|shardAuthor|shard author (only one is supported).| |null|
|shardAuthorEmail|shard author email (only one is supported).| |null|

View File

@@ -46,7 +46,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|packageVersion|C# package version.| |1.0.0|
|returnICollection|Return ICollection&lt;T&gt; instead of the concrete type.| |false|
|sourceFolder|source folder for generated code| |src|
|targetFramework|The target .NET framework version. To target multiple frameworks, use `;` as the separator, e.g. `netstandard2.1;netcoreapp3.1`|<dl><dt>**netstandard1.3**</dt><dd>.NET Standard 1.3</dd><dt>**netstandard1.4**</dt><dd>.NET Standard 1.4</dd><dt>**netstandard1.5**</dt><dd>.NET Standard 1.5</dd><dt>**netstandard1.6**</dt><dd>.NET Standard 1.6</dd><dt>**netstandard2.0**</dt><dd>.NET Standard 2.0</dd><dt>**netstandard2.1**</dt><dd>.NET Standard 2.1</dd><dt>**net47**</dt><dd>.NET Framework 4.7</dd><dt>**net48**</dt><dd>.NET Framework 4.8</dd><dt>**net8.0**</dt><dd>.NET 8.0 (End of Support 10 November 2026)</dd><dt>**net9.0**</dt><dd>.NET 9.0 (End of Support 12 May 2026)</dd></dl>|net9.0|
|targetFramework|The target .NET framework version. To target multiple frameworks, use `;` as the separator, e.g. `netstandard2.1;netcoreapp3.1`|<dl><dt>**netstandard1.3**</dt><dd>.NET Standard 1.3</dd><dt>**netstandard1.4**</dt><dd>.NET Standard 1.4</dd><dt>**netstandard1.5**</dt><dd>.NET Standard 1.5</dd><dt>**netstandard1.6**</dt><dd>.NET Standard 1.6</dd><dt>**netstandard2.0**</dt><dd>.NET Standard 2.0</dd><dt>**netstandard2.1**</dt><dd>.NET Standard 2.1</dd><dt>**net47**</dt><dd>.NET Framework 4.7</dd><dt>**net48**</dt><dd>.NET Framework 4.8</dd><dt>**net8.0**</dt><dd>.NET 8.0 (End of Support 10 November 2026)</dd><dt>**net9.0**</dt><dd>.NET 9.0 (End of Support 10 November 2026)</dd><dt>**net10.0**</dt><dd>.NET 10.0 (End of Support 14 November 2028)</dd></dl>|net10.0|
|useCollection|Deserialize array types to Collection&lt;T&gt; instead of List&lt;T&gt;.| |false|
|useDateTimeForDate|Use DateTime to model date properties even if DateOnly supported. (.net 6.0+ only)| |false|
|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false|

View File

@@ -31,7 +31,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|generateRoomModels|Generate Android Room database models in addition to API models (JVM Volley library only)| |false|
|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools|
|idea|Add IntelliJ Idea plugin and mark Kotlin main and test folders as source folders.| |false|
|library|Library template (sub-template) to use|<dl><dt>**jvm-ktor**</dt><dd>Platform: Java Virtual Machine. HTTP client: Ktor 1.6.7. JSON processing: Gson, Jackson (default).</dd><dt>**jvm-okhttp4**</dt><dd>[DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.</dd><dt>**jvm-spring-webclient**</dt><dd>Platform: Java Virtual Machine. HTTP: Spring 5 (or 6 with useSpringBoot3 enabled) WebClient. JSON processing: Jackson.</dd><dt>**jvm-spring-restclient**</dt><dd>Platform: Java Virtual Machine. HTTP: Spring 6 RestClient. JSON processing: Jackson.</dd><dt>**jvm-retrofit2**</dt><dd>Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.</dd><dt>**multiplatform**</dt><dd>Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.7. JSON processing: Kotlinx Serialization: 1.2.1.</dd><dt>**jvm-volley**</dt><dd>Platform: JVM for Android. HTTP client: Volley 1.2.1. JSON processing: gson 2.8.9</dd><dt>**jvm-vertx**</dt><dd>Platform: Java Virtual Machine. HTTP client: Vert.x Web Client. JSON processing: Moshi, Gson or Jackson.</dd></dl>|jvm-okhttp4|
|library|Library template (sub-template) to use|<dl><dt>**jvm-ktor**</dt><dd>Platform: Java Virtual Machine. HTTP client: Ktor 1.6.7. JSON processing: Gson, Jackson (default).</dd><dt>**jvm-okhttp4**</dt><dd>[DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.</dd><dt>**jvm-spring-webclient**</dt><dd>Platform: Java Virtual Machine. HTTP: Spring 5 (or 6 with useSpringBoot3 enabled) WebClient. JSON processing: Jackson.</dd><dt>**jvm-spring-restclient**</dt><dd>Platform: Java Virtual Machine. HTTP: Spring 6 RestClient. JSON processing: Jackson.</dd><dt>**jvm-retrofit2**</dt><dd>Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.</dd><dt>**multiplatform**</dt><dd>Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.7. JSON processing: Kotlinx Serialization: 1.2.1.</dd><dt>**jvm-volley**</dt><dd>Platform: JVM for Android. HTTP client: Volley 1.2.1. JSON processing: gson 2.8.9 (Deprecated)</dd><dt>**jvm-vertx**</dt><dd>Platform: Java Virtual Machine. HTTP client: Vert.x Web Client. JSON processing: Moshi, Gson or Jackson.</dd></dl>|jvm-okhttp4|
|mapFileBinaryToByteArray|Map File and Binary to ByteArray (default: false)| |false|
|modelMutable|Create mutable models| |false|
|moshiCodeGen|Whether to enable codegen with the Moshi library. Refer to the [official Moshi doc](https://github.com/square/moshi#codegen) for more info.| |false|

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -13,7 +13,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.18.0-SNAPSHOT</version>
<version>7.18.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.18.0-SNAPSHOT</version>
<version>7.18.0</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>

View File

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

View File

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

View File

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

View File

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

View File

@@ -483,4 +483,9 @@ public class CodegenConstants {
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";
public static final String X_IMPLEMENTS = "x-implements";
public static final String X_IS_ONE_OF_INTERFACE = "x-is-one-of-interface";
public static final String X_DISCRIMINATOR_VALUE = "x-discriminator-value";
public static final String X_ONE_OF_NAME = "x-one-of-name";
public static final String X_NULLABLE = "x-nullable";
}

View File

@@ -527,7 +527,7 @@ public class DefaultCodegen implements CodegenConfig {
for (ModelMap mo : modelsAttrs.getModels()) {
CodegenModel cm = mo.getModel();
if (cm.oneOf.size() > 0) {
cm.vendorExtensions.put("x-is-one-of-interface", true);
cm.vendorExtensions.put(X_IS_ONE_OF_INTERFACE, true);
for (String one : cm.oneOf) {
if (!additionalDataMap.containsKey(one)) {
additionalDataMap.put(one, new OneOfImplementorAdditionalData(one));
@@ -2348,8 +2348,8 @@ public class DefaultCodegen implements CodegenConfig {
@SuppressWarnings("static-method")
public String toOneOfName(List<String> names, Schema composedSchema) {
Map<String, Object> exts = composedSchema.getExtensions();
if (exts != null && exts.containsKey("x-one-of-name")) {
return (String) exts.get("x-one-of-name");
if (exts != null && exts.containsKey(X_ONE_OF_NAME)) {
return (String) exts.get(X_ONE_OF_NAME);
}
return "oneOf<" + String.join(",", names) + ">";
}
@@ -3548,8 +3548,8 @@ public class DefaultCodegen implements CodegenConfig {
once(LOGGER).error("Failed to lookup the schema '{}' when processing oneOf/anyOf. Please check to ensure it's defined properly.", modelName);
} else {
Map<String, Object> vendorExtensions = cs.getExtensions();
if (vendorExtensions != null && !vendorExtensions.isEmpty() && vendorExtensions.containsKey("x-discriminator-value")) {
String xDiscriminatorValue = (String) vendorExtensions.get("x-discriminator-value");
if (vendorExtensions != null && !vendorExtensions.isEmpty() && vendorExtensions.containsKey(X_DISCRIMINATOR_VALUE)) {
String xDiscriminatorValue = (String) vendorExtensions.get(X_DISCRIMINATOR_VALUE);
mm = new MappedModel(xDiscriminatorValue, toModelName(modelName), true);
descendentSchemas.add(mm);
}
@@ -3605,7 +3605,7 @@ public class DefaultCodegen implements CodegenConfig {
Map<String, Object> vendorExtensions = cs.getExtensions();
String mappingName =
Optional.ofNullable(vendorExtensions)
.map(ve -> ve.get("x-discriminator-value"))
.map(ve -> ve.get(X_DISCRIMINATOR_VALUE))
.map(discriminatorValue -> (String) discriminatorValue)
.orElse(currentSchemaName);
MappedModel mm = new MappedModel(mappingName, toModelName(currentSchemaName), !mappingName.equals(currentSchemaName));
@@ -4098,8 +4098,8 @@ public class DefaultCodegen implements CodegenConfig {
if (referencedSchema.getNullable() != null) {
property.isNullable = referencedSchema.getNullable();
} else if (referencedSchema.getExtensions() != null &&
referencedSchema.getExtensions().containsKey("x-nullable")) {
property.isNullable = (Boolean) referencedSchema.getExtensions().get("x-nullable");
referencedSchema.getExtensions().containsKey(X_NULLABLE)) {
property.isNullable = (Boolean) referencedSchema.getExtensions().get(X_NULLABLE);
}
final XML referencedSchemaXml = referencedSchema.getXml();
@@ -4201,8 +4201,8 @@ public class DefaultCodegen implements CodegenConfig {
// evaluate common attributes if defined in the top level
if (p.getNullable() != null) {
property.isNullable = p.getNullable();
} else if (p.getExtensions() != null && p.getExtensions().containsKey("x-nullable")) {
property.isNullable = (Boolean) p.getExtensions().get("x-nullable");
} else if (p.getExtensions() != null && p.getExtensions().containsKey(X_NULLABLE)) {
property.isNullable = (Boolean) p.getExtensions().get(X_NULLABLE);
}
if (p.getReadOnly() != null) {
@@ -8047,8 +8047,8 @@ public class DefaultCodegen implements CodegenConfig {
// evaluate common attributes such as description if defined in the top level
if (original.getNullable() != null) {
codegenParameter.isNullable = original.getNullable();
} else if (original.getExtensions() != null && original.getExtensions().containsKey("x-nullable")) {
codegenParameter.isNullable = (Boolean) original.getExtensions().get("x-nullable");
} else if (original.getExtensions() != null && original.getExtensions().containsKey(X_NULLABLE)) {
codegenParameter.isNullable = (Boolean) original.getExtensions().get(X_NULLABLE);
}
if (original.getExtensions() != null) {
@@ -8464,7 +8464,7 @@ public class DefaultCodegen implements CodegenConfig {
*/
public void addOneOfNameExtension(Schema schema, String name) {
if (schema.getOneOf() != null && schema.getOneOf().size() > 0) {
schema.addExtension("x-one-of-name", name);
schema.addExtension(X_ONE_OF_NAME, name);
}
}
@@ -8498,7 +8498,7 @@ public class DefaultCodegen implements CodegenConfig {
}
cm.name = type;
cm.classname = type;
cm.vendorExtensions.put("x-is-one-of-interface", true);
cm.vendorExtensions.put(X_IS_ONE_OF_INTERFACE, true);
cm.interfaceModels = new ArrayList<>();
addOneOfInterfaces.add(cm);

View File

@@ -37,8 +37,7 @@ 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.CodegenConstants.*;
import static org.openapitools.codegen.utils.ModelUtils.simplifyOneOfAnyOfWithOnlyOneNonNullSubSchema;
import static org.openapitools.codegen.utils.StringUtils.getUniqueString;
@@ -1570,7 +1569,7 @@ public class OpenAPINormalizer {
}
protected Schema setNullable(Schema schema) {
if (schema.getNullable() != null || (schema.getExtensions() != null && schema.getExtensions().containsKey("x-nullable"))) {
if (schema.getNullable() != null || (schema.getExtensions() != null && schema.getExtensions().containsKey(X_NULLABLE))) {
// already set, don't overwrite
return schema;
}

View File

@@ -547,13 +547,15 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
}
for (CodegenParameter param : operation.allParams) {
// import "os" if the operation uses files
if (!addedOSImport && "*os.File".equals(param.dataType)) {
if (!addedOSImport && ("*os.File".equals(param.dataType) ||
(param.items != null && "*os.File".equals(param.items.dataType)))) {
imports.add(createMapping("import", "os"));
addedOSImport = true;
}
// import "time" if the operation has a time parameter.
if (!addedTimeImport && "time.Time".equals(param.dataType)) {
if (!addedTimeImport && ("time.Time".equals(param.dataType) ||
(param.items != null && "time.Time".equals(param.items.dataType)))) {
imports.add(createMapping("import", "time"));
addedTimeImport = true;
}
@@ -648,13 +650,15 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
}
for (CodegenParameter param : operation.allParams) {
// import "os" if the operation uses files
if (!addedOSImport && "*os.File".equals(param.dataType)) {
if (!addedOSImport && ("*os.File".equals(param.dataType) ||
(param.items != null && "*os.File".equals(param.items.dataType)))) {
imports.add(createMapping("import", "os"));
addedOSImport = true;
}
// import "time" if the operation has a time parameter.
if (!addedTimeImport && "time.Time".equals(param.dataType)) {
if (!addedTimeImport && ("time.Time".equals(param.dataType) ||
(param.items != null && "time.Time".equals(param.items.dataType)))) {
imports.add(createMapping("import", "time"));
addedTimeImport = true;
}

View File

@@ -71,6 +71,7 @@ import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import static org.openapitools.codegen.CodegenConstants.X_IMPLEMENTS;
import static org.openapitools.codegen.utils.CamelizeOption.*;
import static org.openapitools.codegen.utils.ModelUtils.getSchemaItems;
import static org.openapitools.codegen.utils.OnceLogger.once;
@@ -1997,8 +1998,8 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
for (ModelMap mo : objs.getModels()) {
CodegenModel cm = mo.getModel();
if (this.serializableModel) {
cm.getVendorExtensions().putIfAbsent("x-implements", new ArrayList<String>());
((ArrayList<String>) cm.getVendorExtensions().get("x-implements")).add("Serializable");
cm.getVendorExtensions().putIfAbsent(X_IMPLEMENTS, new ArrayList<String>());
((ArrayList<String>) cm.getVendorExtensions().get(X_IMPLEMENTS)).add("Serializable");
}
}

View File

@@ -77,6 +77,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
protected static final String NET_70_OR_LATER = "net70OrLater";
protected static final String NET_80_OR_LATER = "net80OrLater";
protected static final String NET_90_OR_LATER = "net90OrLater";
protected static final String NET_10_OR_LATER = "net10OrLater";
@SuppressWarnings("hiding")
private final Logger LOGGER = LoggerFactory.getLogger(CSharpClientCodegen.class);
@@ -90,7 +91,8 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
FrameworkStrategy.NETFRAMEWORK_4_7,
FrameworkStrategy.NETFRAMEWORK_4_8,
FrameworkStrategy.NET_8_0,
FrameworkStrategy.NET_9_0
FrameworkStrategy.NET_9_0,
FrameworkStrategy.NET_10
);
private static FrameworkStrategy latestFramework = frameworkStrategies.get(frameworkStrategies.size() - 1);
protected final Map<String, String> frameworks;
@@ -1448,8 +1450,11 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
};
static FrameworkStrategy NET_8_0 = new FrameworkStrategy("net8.0", ".NET 8.0 (End of Support 10 November 2026)", "net8.0", Boolean.FALSE) {
};
static FrameworkStrategy NET_9_0 = new FrameworkStrategy("net9.0", ".NET 9.0 (End of Support 12 May 2026)", "net9.0", Boolean.FALSE) {
static FrameworkStrategy NET_9_0 = new FrameworkStrategy("net9.0", ".NET 9.0 (End of Support 10 November 2026)", "net9.0", Boolean.FALSE) {
};
static FrameworkStrategy NET_10 = new FrameworkStrategy("net10.0", ".NET 10.0 (End of Support 14 November 2028)", "net10.0", Boolean.FALSE) {
};
protected String name;
protected String description;
protected String testTargetFramework;
@@ -1580,6 +1585,19 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
properties.put(NET_70_OR_LATER, true);
properties.put(NET_80_OR_LATER, true);
properties.put(NET_90_OR_LATER, true);
} else if (strategies.stream().anyMatch(p -> "net10.0".equals(p.name))) {
properties.put(NET_STANDARD_14_OR_LATER, true);
properties.put(NET_STANDARD_15_OR_LATER, true);
properties.put(NET_STANDARD_16_OR_LATER, true);
properties.put(NET_STANDARD_20_OR_LATER, true);
properties.put(NET_STANDARD_21_OR_LATER, true);
properties.put(NET_47_OR_LATER, true);
properties.put(NET_48_OR_LATER, true);
properties.put(NET_60_OR_LATER, true);
properties.put(NET_70_OR_LATER, true);
properties.put(NET_80_OR_LATER, true);
properties.put(NET_90_OR_LATER, true);
properties.put(NET_10_OR_LATER, true);
} else {
throw new RuntimeException("Unhandled case");
}

View File

@@ -29,6 +29,8 @@ import org.openapitools.codegen.model.ModelsMap;
import org.openapitools.codegen.model.OperationMap;
import org.openapitools.codegen.model.OperationsMap;
import org.openapitools.codegen.templating.mustache.PrefixWithHashLambda;
import org.openapitools.codegen.templating.mustache.UppercaseLambda;
import org.openapitools.codegen.templating.mustache.TitlecaseLambda;
import org.openapitools.codegen.utils.ModelUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -57,6 +59,7 @@ public class CrystalClientCodegen extends DefaultCodegen {
@Setter protected String shardDescription = "This shard maps to a REST API";
@Setter protected String shardAuthor = "";
@Setter protected String shardAuthorEmail = "";
@Setter protected String paramsEncoder = "Crest::NestedParamsEncoder";
protected String apiDocPath = "docs/";
protected String modelDocPath = "docs/";
protected List<String> primitiveTypes = new ArrayList<String>();
@@ -70,6 +73,7 @@ public class CrystalClientCodegen extends DefaultCodegen {
public static final String SHARD_DESCRIPTION = "shardDescription";
public static final String SHARD_AUTHOR = "shardAuthor";
public static final String SHARD_AUTHOR_EMAIL = "shardAuthorEmail";
public static final String PARAMS_ENCODER = "paramsEncoder";
public CrystalClientCodegen() {
super();
@@ -197,8 +201,7 @@ public class CrystalClientCodegen extends DefaultCodegen {
cliOptions.add(new CliOption(SHARD_HOMEPAGE, "shard homepage.").defaultValue("http://org.openapitools"));
cliOptions.add(
new CliOption(SHARD_DESCRIPTION, "shard description.").defaultValue("This shard maps to a REST API"));
cliOptions.add(new CliOption(SHARD_DESCRIPTION, "shard description.").defaultValue("This shard maps to a REST API"));
cliOptions.add(new CliOption(SHARD_AUTHOR, "shard author (only one is supported)."));
@@ -206,6 +209,10 @@ public class CrystalClientCodegen extends DefaultCodegen {
cliOptions.add(new CliOption(CodegenConstants.HIDE_GENERATION_TIMESTAMP,
CodegenConstants.HIDE_GENERATION_TIMESTAMP_DESC).defaultValue(Boolean.TRUE.toString()));
cliOptions.add(new CliOption(PARAMS_ENCODER,
"params_encoder setting (e.g. Crest::NestedParamsEncoder, Crest::EnumeratedFlatParamsEncoder, Crest::ZeroEnumeratedFlatParamsEncoder").
defaultValue("Crest::NestedParamsEncoder"));
}
@Override
@@ -260,6 +267,12 @@ public class CrystalClientCodegen extends DefaultCodegen {
setShardAuthorEmail((String) additionalProperties.get(SHARD_AUTHOR_EMAIL));
}
if (additionalProperties.containsKey(PARAMS_ENCODER)) {
setParamsEncoder((String) additionalProperties.get(PARAMS_ENCODER));
} else {
additionalProperties.put(PARAMS_ENCODER, paramsEncoder);
}
// make api and model doc path available in mustache template
additionalProperties.put("apiDocPath", apiDocPath);
additionalProperties.put("modelDocPath", modelDocPath);
@@ -273,6 +286,7 @@ public class CrystalClientCodegen extends DefaultCodegen {
supportingFiles.add(new SupportingFile("api_error.mustache", shardFolder, "api_error.cr"));
supportingFiles.add(new SupportingFile("configuration.mustache", shardFolder, "configuration.cr"));
supportingFiles.add(new SupportingFile("api_client.mustache", shardFolder, "api_client.cr"));
supportingFiles.add(new SupportingFile("recursive_hash.mustache", shardFolder, "recursive_hash.cr"));
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
@@ -285,6 +299,8 @@ public class CrystalClientCodegen extends DefaultCodegen {
// add lambda for mustache templates
additionalProperties.put("lambdaPrefixWithHash", new PrefixWithHashLambda());
additionalProperties.put("lambdaUppercase", new UppercaseLambda());
additionalProperties.put("lambdaTitlecase", new TitlecaseLambda());
}
@@ -747,8 +763,13 @@ public class CrystalClientCodegen extends DefaultCodegen {
return moduleName + "::" + codegenModel.classname + "::" + enumVars.get(0).get("name");
} else if (codegenModel.oneOf != null && !codegenModel.oneOf.isEmpty()) {
String subModel = (String) codegenModel.oneOf.toArray()[0];
String oneOf = constructExampleCode(modelMaps.get(subModel), modelMaps, processedModelMap);
return oneOf;
if (modelMaps.get(subModel) == null) {
LOGGER.warn("Cannot find codegen for SubModel: {} (model: {})", subModel, model);
return "";
} else {
String oneOf = constructExampleCode(modelMaps.get(subModel), modelMaps, processedModelMap);
return oneOf;
}
} else {
processedModelMap.put(model, 1);
}

View File

@@ -520,7 +520,7 @@ public class GoClientCodegen extends AbstractGoCodegen {
addedFmtImport = true;
}
if (model.hasRequired) {
if (generateUnmarshalJSON && model.hasRequired) {
if (!model.isAdditionalPropertiesTrue &&
(model.oneOf == null || model.oneOf.isEmpty()) &&
(model.anyOf == null || model.anyOf.isEmpty())) {

View File

@@ -47,6 +47,7 @@ import java.util.regex.Pattern;
import static com.google.common.base.CaseFormat.LOWER_CAMEL;
import static com.google.common.base.CaseFormat.UPPER_UNDERSCORE;
import static java.util.Collections.sort;
import static org.openapitools.codegen.CodegenConstants.X_IMPLEMENTS;
import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER;
import static org.openapitools.codegen.utils.StringUtils.camelize;
@@ -1173,7 +1174,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
for (ModelMap mo : models) {
CodegenModel cm = mo.getModel();
cm.getVendorExtensions().putIfAbsent("x-implements", new ArrayList<String>());
cm.getVendorExtensions().putIfAbsent(X_IMPLEMENTS, new ArrayList<String>());
if (isLibrary(JERSEY2) || isLibrary(JERSEY3) || isLibrary(NATIVE) || isLibrary(OKHTTP_GSON)) {
if (cm.oneOf != null && !cm.oneOf.isEmpty() && cm.oneOf.contains("ModelNull")) {
// if oneOf contains "null" type
@@ -1188,7 +1189,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
}
}
if (this.parcelableModel && !cm.isEnum) {
((ArrayList<String>) cm.getVendorExtensions().get("x-implements")).add("Parcelable");
((ArrayList<String>) cm.getVendorExtensions().get(X_IMPLEMENTS)).add("Parcelable");
}
}

View File

@@ -248,7 +248,7 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
supportedLibraries.put(JVM_SPRING_RESTCLIENT, "Platform: Java Virtual Machine. HTTP: Spring 6 RestClient. JSON processing: Jackson.");
supportedLibraries.put(JVM_RETROFIT2, "Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.");
supportedLibraries.put(MULTIPLATFORM, "Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.7. JSON processing: Kotlinx Serialization: 1.2.1.");
supportedLibraries.put(JVM_VOLLEY, "Platform: JVM for Android. HTTP client: Volley 1.2.1. JSON processing: gson 2.8.9");
supportedLibraries.put(JVM_VOLLEY, "Platform: JVM for Android. HTTP client: Volley 1.2.1. JSON processing: gson 2.8.9 (Deprecated)");
supportedLibraries.put(JVM_VERTX, "Platform: Java Virtual Machine. HTTP client: Vert.x Web Client. JSON processing: Moshi, Gson or Jackson.");
CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "Library template (sub-template) to use");
@@ -417,11 +417,14 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
if (hasConflict) {
LOGGER.warn("You specified RxJava versions 1 and 2 and 3 or Coroutines together, please choose one of them.");
} else if (hasRx3) {
this.setUseRxJava3(Boolean.parseBoolean(additionalProperties.get(USE_RX_JAVA3).toString()));
setUseRxJava3(convertPropertyToBoolean(USE_RX_JAVA3));
} else if (hasCoroutines) {
this.setUseCoroutines(Boolean.parseBoolean(additionalProperties.get(USE_COROUTINES).toString()));
setUseCoroutines(convertPropertyToBoolean(USE_COROUTINES));
}
additionalProperties.put(USE_RX_JAVA3, useRxJava3);
additionalProperties.put(USE_COROUTINES, useCoroutines);
if (!hasRx3 && !hasCoroutines) {
setDoNotUseRxAndCoroutines(true);
additionalProperties.put(DO_NOT_USE_RX_AND_COROUTINES, true);
@@ -447,7 +450,11 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
}
if (additionalProperties.containsKey(OMIT_GRADLE_WRAPPER)) {
setOmitGradleWrapper(Boolean.parseBoolean(additionalProperties.get(OMIT_GRADLE_WRAPPER).toString()));
setOmitGradleWrapper(convertPropertyToBooleanAndWriteBack(OMIT_GRADLE_WRAPPER));
}
if (additionalProperties.containsKey(USE_SPRING_BOOT3)) {
convertPropertyToBooleanAndWriteBack(USE_SPRING_BOOT3);
}
if (additionalProperties.containsKey(CodegenConstants.SERIALIZATION_LIBRARY)) {
@@ -467,11 +474,11 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
}
if (additionalProperties.containsKey(GENERATE_ONEOF_ANYOF_WRAPPERS)) {
setGenerateOneOfAnyOfWrappers(Boolean.parseBoolean(additionalProperties.get(GENERATE_ONEOF_ANYOF_WRAPPERS).toString()));
setGenerateOneOfAnyOfWrappers(convertPropertyToBooleanAndWriteBack(GENERATE_ONEOF_ANYOF_WRAPPERS));
}
if (additionalProperties.containsKey(FAIL_ON_UNKNOWN_PROPERTIES)) {
setFailOnUnknownProperties(Boolean.parseBoolean(additionalProperties.get(FAIL_ON_UNKNOWN_PROPERTIES).toString()));
setFailOnUnknownProperties(convertPropertyToBooleanAndWriteBack(FAIL_ON_UNKNOWN_PROPERTIES));
} else {
additionalProperties.put(FAIL_ON_UNKNOWN_PROPERTIES, false);
setFailOnUnknownProperties(false);

View File

@@ -90,9 +90,6 @@ public class PythonFastAPIServerCodegen extends AbstractPythonCodegen {
public PythonFastAPIServerCodegen() {
super();
// Skip sorting of operations to preserve the order found in the OpenAPI spec file. See
// https://fastapi.tiangolo.com/tutorial/path-params/?h=path#order-matters for details on why order matters.
LOGGER.info("Skipping sorting of path operations, order matters, let the developer decide via their specification file.");
setSkipSortingOperations(true);
modifyFeatureSet(features -> features.includeSecurityFeatures(
@@ -150,6 +147,11 @@ public class PythonFastAPIServerCodegen extends AbstractPythonCodegen {
public void processOpts() {
super.processOpts();
// Skip sorting of operations via setSkipSortingOperations(true) in the constructor to preserve the order
// found in the OpenAPI spec file. See
// https://fastapi.tiangolo.com/tutorial/path-params/?h=path#order-matters for details on why order matters.
LOGGER.info("Skipping sorting of path operations, order matters, let the developer decide via their specification file.");
if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) {
setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME));
}

View File

@@ -48,6 +48,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static org.openapitools.codegen.CodegenConstants.X_ONE_OF_NAME;
import static org.openapitools.codegen.utils.StringUtils.camelize;
import static org.openapitools.codegen.utils.StringUtils.underscore;
@@ -86,6 +87,9 @@ public class RustServerCodegen extends AbstractRustCodegen implements CodegenCon
private static final String problemJsonMimeType = "application/problem+json";
private static final String problemXmlMimeType = "application/problem+xml";
// Track if we have models with conflicting names (Ok/Err) that conflict with serde_valid
private boolean hasConflictingModelNames = false;
public RustServerCodegen() {
super();
@@ -941,6 +945,11 @@ public class RustServerCodegen extends AbstractRustCodegen implements CodegenCon
if (param.contentType != null && isMimetypeJson(param.contentType)) {
param.vendorExtensions.put("x-consumes-json", true);
}
// Add a vendor extension to flag if this can have validate() run on it.
if (!param.isUuid && !param.isPrimitiveType && !param.isEnum && (!param.isContainer || !languageSpecificPrimitives.contains(typeMapping.get(param.baseType)))) {
param.vendorExtensions.put("x-can-validate", true);
}
}
for (CodegenParameter param : op.formParams) {
@@ -1406,8 +1415,8 @@ public class RustServerCodegen extends AbstractRustCodegen implements CodegenCon
if (composedSchema != null) {
exts = composedSchema.getExtensions();
}
if (exts != null && exts.containsKey("x-one-of-name")) {
return (String) exts.get("x-one-of-name");
if (exts != null && exts.containsKey(X_ONE_OF_NAME)) {
return (String) exts.get(X_ONE_OF_NAME);
}
List<Schema> schemas = ModelUtils.getInterfaces(composedSchema);
@@ -1454,8 +1463,20 @@ public class RustServerCodegen extends AbstractRustCodegen implements CodegenCon
public void postProcessModelProperty(CodegenModel model, CodegenProperty property) {
super.postProcessModelProperty(model, property);
// Check for reserved field names that conflict with serde_valid macro internals
if ("ok".equalsIgnoreCase(property.name) || "err".equalsIgnoreCase(property.name)) {
model.vendorExtensions.put("x-skip-serde-valid", true);
}
// Mark properties that reference complex types (models) for nested validation
// Only add nested validation for types that reference generated models (contain "models::")
if (property.dataType != null && property.dataType.contains("models::")) {
property.vendorExtensions.put("x-needs-nested-validation", true);
}
// TODO: We should avoid reverse engineering primitive type status from the data type
if (!languageSpecificPrimitives.contains(stripNullable(property.dataType))) {
String strippedType = stripNullable(property.dataType);
if (!languageSpecificPrimitives.contains(strippedType)) {
// If we use a more qualified model name, then only camelize the actual type, not the qualifier.
if (property.dataType.contains(":")) {
int position = property.dataType.lastIndexOf(":");
@@ -1528,7 +1549,32 @@ public class RustServerCodegen extends AbstractRustCodegen implements CodegenCon
@Override
public ModelsMap postProcessModels(ModelsMap objs) {
return super.postProcessModelsEnum(objs);
ModelsMap result = super.postProcessModelsEnum(objs);
// Check for model names that conflict with serde_valid macro internals
// Once we find one, set a class-level flag that persists across all model batches
if (!hasConflictingModelNames) {
for (ModelMap modelMap : result.getModels()) {
CodegenModel model = modelMap.getModel();
if ("Ok".equalsIgnoreCase(model.classname) || "Err".equalsIgnoreCase(model.classname)) {
hasConflictingModelNames = true;
additionalProperties.put("hasConflictingModelNames", true);
break;
}
}
}
// If there are conflicting names (detected in any batch), skip serde_valid for ALL models
if (hasConflictingModelNames) {
for (ModelMap modelMap : result.getModels()) {
CodegenModel model = modelMap.getModel();
model.vendorExtensions.put("x-skip-serde-valid", true);
}
// Set the flag for this batch's template context
result.put("hasConflictingModelNames", true);
}
return result;
}
private void processParam(CodegenParameter param, CodegenOperation op) {
@@ -1613,6 +1659,11 @@ public class RustServerCodegen extends AbstractRustCodegen implements CodegenCon
String exampleString = (example != null) ? "Some(" + example + ")" : "None";
param.vendorExtensions.put("x-example", exampleString);
}
// Add a vendor extension to flag if this can have validate() run on it.
if (!param.isUuid && !param.isPrimitiveType && !param.isEnum && (!param.isContainer || !languageSpecificPrimitives.contains(typeMapping.get(param.baseType)))) {
param.vendorExtensions.put("x-can-validate", true);
}
}
@Override

View File

@@ -48,6 +48,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static org.openapitools.codegen.CodegenConstants.X_ONE_OF_NAME;
import static org.openapitools.codegen.utils.StringUtils.camelize;
import static org.openapitools.codegen.utils.StringUtils.underscore;
@@ -1386,8 +1387,8 @@ public class RustServerCodegenDeprecated extends AbstractRustCodegen implements
if (composedSchema != null) {
exts = composedSchema.getExtensions();
}
if (exts != null && exts.containsKey("x-one-of-name")) {
return (String) exts.get("x-one-of-name");
if (exts != null && exts.containsKey(X_ONE_OF_NAME)) {
return (String) exts.get(X_ONE_OF_NAME);
}
List<Schema> schemas = ModelUtils.getInterfaces(composedSchema);

View File

@@ -32,6 +32,8 @@ import java.io.File;
import java.util.*;
import java.util.stream.Collectors;
import static org.openapitools.codegen.CodegenConstants.X_IMPLEMENTS;
public class ScalaHttp4sServerCodegen extends DefaultCodegen implements CodegenConfig {
private final Logger LOGGER = LoggerFactory.getLogger(ScalaHttp4sServerCodegen.class);
protected String artifactId = "http4s-server";
@@ -374,7 +376,7 @@ public class ScalaHttp4sServerCodegen extends DefaultCodegen implements CodegenC
}
//
try {
List<String> exts = (List<String>) cModel.getVendorExtensions().get("x-implements");
List<String> exts = (List<String>) cModel.getVendorExtensions().get(X_IMPLEMENTS);
if (exts != null) {
cModel.getVendorExtensions().put("x-extends", exts.subList(0, 1));
cModel.getVendorExtensions().put("x-extendsWith", exts.subList(1, exts.size()));

View File

@@ -184,6 +184,11 @@ public class TypeScriptNodeClientCodegen extends AbstractTypeScriptClientCodegen
for (ModelMap mo : entry.getModels()) {
CodegenModel cm = mo.getModel();
// Filter out primitive types from parent property
if (cm.parent != null && isPrimitiveType(cm.parent)) {
cm.parent = null;
}
// Add additional filename information for imports
mo.put("tsImports", toTsImports(cm, cm.imports));
}
@@ -289,6 +294,26 @@ public class TypeScriptNodeClientCodegen extends AbstractTypeScriptClientCodegen
return languageSpecificPrimitives.contains(type);
}
/**
* Check if a type is a primitive TypeScript type (string, boolean, number).
* This is used to filter out primitive types from the parent property.
*
* @param type the type to check
* @return true if the type is a primitive type
*/
private boolean isPrimitiveType(String type) {
if (type == null) {
return false;
}
// Check for primitive types (case-insensitive)
String lowerType = type.toLowerCase(Locale.ROOT);
return "string".equals(lowerType) ||
"boolean".equals(lowerType) ||
"number".equals(lowerType) ||
"any".equals(lowerType) ||
"array".equals(lowerType);
}
// Determines if the given type is a generic/templated type (ie. ArrayList<String>)
private boolean isLanguageGenericType(String type) {
for (String genericType : languageGenericTypes) {
@@ -323,6 +348,15 @@ public class TypeScriptNodeClientCodegen extends AbstractTypeScriptClientCodegen
return result;
}
@Override
protected void addParentFromContainer(CodegenModel model, Schema schema) {
super.addParentFromContainer(model, schema);
// Filter out primitive types from parent property
if (model.parent != null && isPrimitiveType(model.parent)) {
model.parent = null;
}
}
@Override
protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) {
super.addAdditionPropertiesToCodeGenModel(codegenModel, schema);

View File

@@ -56,6 +56,7 @@ import java.util.*;
import java.util.Map.Entry;
import java.util.stream.Collectors;
import static org.openapitools.codegen.CodegenConstants.X_NULLABLE;
import static org.openapitools.codegen.CodegenConstants.X_PARENT;
import static org.openapitools.codegen.utils.OnceLogger.once;
@@ -1757,8 +1758,8 @@ public class ModelUtils {
return true;
}
if (schema.getExtensions() != null && schema.getExtensions().get("x-nullable") != null) {
return Boolean.parseBoolean(schema.getExtensions().get("x-nullable").toString());
if (schema.getExtensions() != null && schema.getExtensions().get(X_NULLABLE) != null) {
return Boolean.parseBoolean(schema.getExtensions().get(X_NULLABLE).toString());
}
// In OAS 3.1, the recommended way to define a nullable property or object is to use oneOf.
if (isComposedSchema(schema)) {

View File

@@ -9,6 +9,8 @@ import org.slf4j.LoggerFactory;
import java.util.*;
import static org.openapitools.codegen.CodegenConstants.X_IMPLEMENTS;
/**
* This class holds data to add to `oneOf` members. Let's consider this example:
* <p>
@@ -101,11 +103,11 @@ public class OneOfImplementorAdditionalData {
*/
@SuppressWarnings("unchecked")
public void addToImplementor(CodegenConfig cc, CodegenModel implcm, List<Map<String, String>> implImports, boolean addInterfaceImports) {
implcm.getVendorExtensions().putIfAbsent("x-implements", new ArrayList<String>());
implcm.getVendorExtensions().putIfAbsent(X_IMPLEMENTS, new ArrayList<String>());
// Add implemented interfaces
for (String intf : additionalInterfaces) {
List<String> impl = (List<String>) implcm.getVendorExtensions().get("x-implements");
List<String> impl = (List<String>) implcm.getVendorExtensions().get(X_IMPLEMENTS);
impl.add(intf);
if (addInterfaceImports) {
// Add imports for interfaces

View File

@@ -38,7 +38,7 @@ public class URLPathUtils {
private static final Logger LOGGER = LoggerFactory.getLogger(URLPathUtils.class);
public static final String LOCAL_HOST = "http://localhost";
public static final Pattern VARIABLE_PATTERN = Pattern.compile("\\{([^\\}]+)\\}");
public static final Pattern VARIABLE_PATTERN = Pattern.compile("(?<!\\$)\\{([^\\}]+)\\}");
// TODO: This should probably be moved into generator/workflow type rather than a static like this.
public static URL getServerURL(OpenAPI openAPI, Map<String, String> userDefinedVariables) {

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