15114 Commits

Author SHA1 Message Date
William Cheng
cca5dda026 [kotlin][kotlin-spring] Add companionObject option to generate companion objects in data classes (#23176)
* [kotlin] Add companionObject option to generate companion objects in data classes

Add a new boolean CLI option `companionObject` (default: false) that generates
an empty `companion object { }` on all data class models, enabling users to add
companion extensions from outside the generated code.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* [kotlin-spring] Add companionObject option to generate companion objects in data classes

Extend the same companionObject option to the kotlin-spring server generator,
enabling companion extensions on generated Spring model classes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* update spec, add tests

---------

Co-authored-by: Jeffrey Blayney <jeffrey.blayney@missionlane.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 17:43:44 +08:00
Jorge Rodríguez Martín
6cf78e789b [java][resttemplate] Add support for Jackson 3 and Spring Boot 4 in Java resttemplate (#23144)
* feat: add support for Jackson 3 and Spring Boot 4 in Java resttemplate client generation

* chore: remove deprecated resttemplate-springBoot4 paths from YAML configuration

* feat: add serialization library support for Jackson 3 in Java client

* chore: initialize project structure and add initial files

* feat: update library template for Spring RestTemplate to support Jackson 3

* chore: add paths for resttemplate-springBoot4 in YAML configuration

* chore: remove unused test files from the project

* chore: add libs.versions.toml and update FILES for new test files

* chore: remove unused test files from the project
2026-03-08 15:52:02 +08:00
ottmar-zittlau
b13e9080af [Python] Some fixes for pydantic v1 templates for nested dicts (#23162)
* Fix to_dict method

* Fix union type hint

* Use more concise code for dict generation

* Add from dict method for array of dicts

* Fix after reviewer comments

* add check for none

* Update samples
2026-03-08 01:47:55 +08:00
William Cheng
f151c4640e Upgrade ktor to 3.4.0, kotlin to 2.3.0 (#23164)
* [REQ] Upgrade ktor to 3.4.0

* use gradle 8.11

* use gradle 8.11

* rearrange

---------

Co-authored-by: luisvt <luisbigvargas@gmail.com>
2026-03-07 23:46:51 +08:00
Robin Marechal
c0a76525c4 [java][doc] Fix Makdown examples: wrong collection type used to initialize Sets (#23160)
* Fix markdown example generation: Arrays.asList() was used to instanciate Sets without checking 'uniqueItems'

* Update generated samples
2026-03-07 22:35:56 +08:00
Mateusz "Serafin" Gajewski
2d82875882 Jackson deserializers fail when FAIL_ON_TRAILING_TOKENS is enabled due to parser.readValueAsTree() (#23147)
* Fix incorrect tree parsing with Jackson

* Regenerate Java samples
2026-03-06 22:18:45 +08:00
ottmar-zittlau
4d83cfecdf [Python] Fix python template for list and dicts of dicts (#23112)
* Fix python template for list and dicts of dicts

* Add test cases for dict of dict and list of dict

* Add generated samples
2026-03-06 22:12:51 +08:00
Martin Delille
054af0e0aa [cpp-qt-client] Remove deprecated SignalE/SignalEFull signals in API classes (#23113)
* [cpp-qt-client] Remove deprecated SignalE/SignalEFull signals in API classes

* Remove deprecated signal emissions
2026-03-06 22:10:02 +08:00
William Cheng
1778c1ba4d update jackson dependencies to newer versions (#23152) 2026-03-06 21:51:28 +08:00
William Cheng
68dc149fa1 update jackson in restclient to newer version (#23151) 2026-03-06 15:35:14 +08:00
William Cheng
c7db8cf651 update immustable to newer version in ts fetch client (#23142) 2026-03-05 21:07:12 +08:00
Alex
6d335cd96d feature(jackson3) add jackson3 support for Java Client generator - Restclient (#23023)
* Update restclient generator for spring 7

* Cleanup

* Merge pom.xml

* Merge ApiClients

* Update restclient

* Update docs

* Use the same options as server generator

* Sync samples

* Add .gitignore

* Add @JsonIgnore on no-arg constructor

* Add @JsonIgnore only for jackson3

* Remove @JsonIgnore

* Add to output folder

* Update Jackson

* Update jackson

* Update gradle build

* Fix build

* Fix gradle

* Fix build for gradle

* Add missing samples

* Update samples

* Update samples

* Fix kotlin samples

* Change order

* Change permissions for build
2026-03-05 00:00:13 +08:00
gurkodil
3972c65a2a fix(typescript-fetch): generate validationAttributes when withoutRuntimeChecks=true (#23107)
* fix(typescript-fetch): generate validationAttributes when withoutRuntimeChecks=true

Previously, setting `validationAttributes=true` had no effect when
`withoutRuntimeChecks=true` was set. This commit fixes that by adding
the validation attributes to the `modelGenericInterfaces.mustache`
template (that is used when withoutRuntimeChecks is enabled)

- Moves validationAttributes logic to a partial template and includes it
  in the modelGenericInterfaces.mustache template
- modelGeneric.mustache includes the modelGenericInterfaces.mustache
  partial and should work as before

* update samples
2026-03-04 09:56:16 +01:00
pavelstackoverflow
1283d1bf0f [kotlin-spring] fix kotlin map nullable (fix #16501) (#23074)
* [kotlin-spring] fix kotlin map nullable

* [kotlin-spring] fix kotlin map nullable add test
2026-03-04 11:03:06 +08:00
William Cheng
cbdee19f87 Update jackson dependencies in Java clients to newer versions (#23105)
* update jackson in java clients to newer versions

* revert doc

* update annotation

* update fegin

* update
2026-03-04 02:18:50 +08:00
Eugene
0869cad083 [kotlin] Support @Deprecation annotation for kotlin-spring generator (#23104)
* Add change to template with tests

* Update test

* Add required message attribute for Kotlin code

* Regenerate samples
2026-03-04 00:19:13 +08:00
Mihail Verenich
dedd2fc280 fix(swift): disable use of group separator (#23062)
* fix(swift): disable use of group separator

* update swift samples
2026-03-03 15:17:04 +00:00
Jo
d9dd07aeac [Swift6] Fix TSan race condition in Swift6 SynchronizedDictionary (#23091)
Problem

  SynchronizedDictionary is a struct held as a var property on shared singleton classes (URLSessionRequestBuilderConfiguration and AlamofireRequestBuilderConfiguration). When multiple concurrent network requests mutate credentialStore or managerStore from different
  threads, Swift's memory exclusivity rules treat each subscript mutation as a modifying access to the entire struct — causing a real ThreadSanitizer "Swift access race".

  Changes

  struct → class (SynchronizedDictionary.mustache + 13 sample files)

  Changing SynchronizedDictionary from a value type to a reference type makes mutations go through pointer indirection. Concurrent subscript writes now only touch the object's internal state (already protected by NSRecursiveLock), rather than triggering a modifying
  access on the owning class's stored property.

  var → let (URLSessionImplementations.mustache + 11 sample files, AlamofireImplementations.mustache + 2 sample files)

  Since SynchronizedDictionary is now a class, the properties credentialStore and managerStore only need to hold a stable reference — they never get reassigned. Declaring them as let makes this intent explicit and prevents any residual exclusivity issues on the property
   itself.
2026-03-03 10:09:21 +00:00
Jorge Rodríguez Martín
3deee65ee4 refactor: change isSpringCodegen method visibility to protected (#23049) 2026-03-03 16:24:24 +08:00
William Cheng
9afa74a3cb [spring] Add an option "additionalNotNullAnnotations" to include additional NotNull annotations (#23096)
* add option additionalNotNullAnnotations

* update samples, docs

* add tests for option

* fix github workflow

* fix path

* remove
2026-03-03 16:18:41 +08:00
GregDThomas
536016bcb7 Fix #16561 by marking required a requestBody as @NotNull if it is required. (#22291) 2026-03-03 13:50:17 +08:00
wturk
910caaae92 [csharp] Fix/override central package versions for csharp test projects (#23092)
* fix: override ManagePackageVersionsCentrally in test .csproj file

* chore: regenerate samples
2026-03-02 22:10:49 +08:00
Rens Groothuijsen
8515f5ed0c [typescript-angular] Include OIDC credential headers (#23065) 2026-02-27 15:34:55 +08:00
Eirik Brandtzæg
fbb99d2d15 Add support for Optional<T> in Dart generator (both dart and dart-dio) to distinguish absent, null, and present states (#22257)
* Add support for `Optional<T>` in Dart generator (both dart and dart-dio) to distinguish absent, null, and present states

* Add useOptional and patchOnly options to the Dart client configurations thing for testing (setting both options to "true" for both types)

* Add documentation for useOptional and patchOnly options

* Tune the dart mustache (pluss class mustache) to get rid of the extra whitespace

* More tuning of the dart mustache files to adjust amount of whitespace - match previously generated setup

* Tune dart mustache templates to fix whitespace stuff by tips from wing328

* Fix the logic gap where useOptional=true without patchOnly=true appears to do nothing

* Rename getString() to extractModelNameFromBodyParam()

* Add behavioral tests

  * useOptional flag wrapping non-required properties
  * patchOnly mode PATCH schema detection
  * patchOnly=true auto-enabling useOptional
  * Parameter unwrapping behavior

* Fix inconsistency (my own) in native_class.mustache

* Remove "dead code" (because of timing). postProcessModels has already executed before postProcessOperationsWithModels.

And then we don't even need the extractModelNameFromBodyParam method...

* Fix Optional<T> to properly distinguish between absend and null

Had issues in dio

* Regenerate Dart samples

* Fix extra blank lines in dart-dio json_serializable template output
2026-02-26 22:16:59 +08:00
Jehiah Czebotar
4bf4637169 fix(typescript-fetch): ResponseError prototype chain (#23010)
* fix(typescript-fetch): ResponseError prototype chain

* samples/*/typescript-fetch: re-generate runtime.ts
2026-02-26 11:34:05 +01:00
Raichu
5b89b47846 fix: core: preserve OAS 3.1 numeric exclusive validation constraints in composed schemas (#23053)
* test: add test case for `ExclusiveMinMax Test`

(#22943)

* feat: Compatibility with exclusiveMinimum in OpenAPI 3.0.0 vs. 3.1.0

(#22943)

---------

Co-authored-by: 葉宗原 TsungYuan Yeh <tsungyuan.yeh@tpisoftware.com>
2026-02-25 17:31:11 +08:00
Timon
bfe5ca84ce python(pydantic): Use validate_by_name config; populate_by_name will be deprecated (#22931)
* modules

* pydantic bump

* samples

* revert for fastapi generator and apply pydantic constrain everywhere
2026-02-25 15:51:44 +08:00
dsteeley
584bf22b3a [rust-server] Update mockall to 0.14 (#23048) 2026-02-25 11:21:45 +08:00
dsteeley
7970d4b401 fix(rust-server): implement ValidateComposited traits for complex types and add integer enum support (#23045) 2026-02-24 22:16:56 +08:00
Louis Lepper
b32faa0a24 Type safe error handling in kotlin spring server with useSealedResponseInterfaces flag (#23003)
* Add type safe returns

* Bugfixes / adding tests

* Add sealed interfaces sample to github hook
2026-02-24 17:25:22 +08:00
wakanao
22e1d6aa78 fix(kotlin): support non-discriminator oneOf/anyOf model and array types with kotlinx_serialization (#23007)
* fix(kotlin): use sealed interface for non-discriminator oneOf/anyOf in kotlinx_serialization

* add sample and CI config for non-discriminator oneOf/anyOf with kotlinx_serialization

* replace petstore with focused spec for non-discriminator oneOf/anyOf sample

* add CI path filter for kotlin-oneOf-anyOf-kotlinx-serialization sample

* add x-duplicated-data-type guard to kotlinx_serialization oneOf/anyOf templates

The Gson path already uses {{^vendorExtensions.x-duplicated-data-type}} to skip
duplicate data types, but the new kotlinx_serialization path was missing this
guard. Without it, duplicate value class names would be generated if multiple
schemas resolve to the same Kotlin dataType, causing compilation errors.

* remove invalid path pattern from push.branches in CI config

push.branches filters by branch name, not file paths. The sample directory
pattern added here had no effect. The pull_request.paths filter remains and
correctly triggers CI for this sample.

* update generateOneOfAnyOfWrappers docs to include kotlinx_serialization support
2026-02-24 17:05:17 +08:00
Troy P
4538d95025 [JS] Fix handling of oneOf when you have explicitly used a discriminator. (#23026)
* added a branch that uses the discriminator to generate the actual object and then bail early

See #23025
2026-02-24 15:42:14 +08:00
William Cheng
e01fdee81e add uuid pattern tests to python client (#23040) 2026-02-24 09:47:41 +08:00
Timon
a2b7776d20 import field_validator for UUID properties with patterns (#22947) 2026-02-24 09:19:33 +08:00
Philippe Laflamme
7b59bdd54e feat: support date-time-local in scala generators (#22990) 2026-02-24 08:38:42 +08:00
Jachym Metlicka
e5d40f4258 [java-spring] - add 'includeHttpRequestContext' additional property defaulting to "true" for reactive and "false" for blocking to include ServerWebExchange/HttpServletRequest (#22910)
* add includeHttpRequestContext additional property defaulting to "true" for reactive and "false" for blocking. Implement tests and add samples to check compilation success.

* generate sample files

* fix template

* fix template

* fix template

* update docs

* fix imports

* fix codegen

* fix codegen and update samples

* improve unit tests

* generate also delegate

* update samples

* update samples

* updated files
2026-02-24 08:19:58 +08:00
Pierre-Yves Le Borgne
e438e15b09 Move C++ virtual destructor definition to .cpp files (#21529) (#21530)
* Move C++ virtual destructor definition to .cpp files (#21529)

* Subsequent commit with codegened C++ - PR step 3 (#21529)
2026-02-24 08:18:12 +08:00
Timon
27cced51c0 feat(python): expose all config properties in constructor (#23021)
* templates

* samples

* scope to python generator

* address suggestions

* revert pydantic-v1
2026-02-24 08:12:12 +08:00
James Kent
a5e2fdf667 [PYTHON] switch from mutable bytearray to immutable bytes to avoid pydantic error (#22988)
* switch from mutable bytearray to immutable bytes

* update python samples
2026-02-24 07:54:26 +08:00
Jean-Pierre Portier
905b930144 fix #22571 (OpenAPINormalizer): Removed reset of OAS content (#22573)
* fix (OpenAPINormalizer): Removed reset of OAS content

* feat (Normalizer): Reset from Normalizer with 3.0 only. Fix tests
2026-02-24 07:45:44 +08:00
Philippe Laflamme
8fcb2e0d8b fix: OAS3.1 deprecated property for array properties (#23019)
* test: add failing test for missing @deprecated on array properties in OAS 3.1

The typescript-axios generator drops the @deprecated JSDoc annotation
for array-type properties when processing OpenAPI 3.1 specs. This test
reproduces the issue by asserting that deprecated scalar, array-of-primitives,
and array-of-refs properties all receive the annotation.

* fix: preserve deprecated, readOnly, writeOnly when normalizing OAS 3.1 array schemas

The OpenAPINormalizer.processNormalize31Spec method converts OAS 3.1
JsonSchema array types into legacy ArraySchema objects, but was not
copying the deprecated, readOnly, or writeOnly flags during conversion.
This caused @deprecated annotations to be silently dropped for array-type
properties in all generators when processing OAS 3.1 specs.
2026-02-24 07:43:43 +08:00
Dennis Ameling
5e45db9a02 openapi-generator-gradle-plugin: upgrade Gradle to v8 (#22864) 2026-02-24 07:40:28 +08:00
Eddie Rydell
17a28ebad2 [dart] Fix enum defaults, Object arrays, and nullable required assertions in native serialization (#23027)
* fix(dart): fix enum defaults, Object arrays, and nullable required assertions in native serialization

* update docs
2026-02-24 07:38:45 +08:00
Christopher Molin
8c70c33e8c [Java][WebClient] Propagate OpenAPI Deprecations to Generated ApiClient-methods (#23039)
Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>
2026-02-24 07:35:52 +08:00
Julien Debon
4f00a34df6 [OCaml][Fix] Unreferenced enum + Direct recursive types (#23005)
* [OCaml] Fix bugs around enum parsing

Problem: The OCaml client generator threw IllegalArgumentException: Unreferenced enum when encountering enums inside composed schemas
  (anyOf/allOf/oneOf).

Root Causes:
1. The enum collection logic didn't traverse into composed schemas
2. The enum hashing used order-dependent string concatenation, causing lookups to fail when enum values appeared in different orders
3. Enums directly within composed schema branches (not in properties) weren't collected

Solution:

1. Added composed schema support:
  - New `collectEnumSchemasFromComposed()` method handles `anyOf/allOf/oneOf`
  - New `collectEnumSchemasFromList()` method recursively processes composed schema branches
  - Enums directly in composed schemas (not just in properties) are now collected
2. Refactored enum hashing to use Set:
  - Changed from comma-joined strings to `TreeSet<String>` for order-independent, collision-free hashing
  - Handles edge cases like empty string enums `""`
3. Added test case:
  - Tests enums in nested composed schemas
  - Tests enum with empty string value in anyOf

* OCaml: Add support for direct recursive types

* OCaml: Fix enums in anyOf

* OCaml: fix recursive types

* Fix recursion tests

* Fix recursive types, improve tests

* [OCaml] Improve title of generated README.md
2026-02-23 21:52:19 +08:00
Eddie Rydell
3252fcf619 [dart] Preserve inner generic type for Map<String, List<T>> deserialization (#22717)
* preserve inner generic type for Map<String, List<T>> deserialization

* regenerated samples

* retrigger ci
2026-02-19 11:54:40 +08:00
William Cheng
9432aaf4a3 Prepare 7.21.0 snapshot (#22984)
* Revert "v7.20.0 release (#22983)"

This reverts commit bd7fc7f45f.

* update to v7.21.0 snapshot version

* update samples, docs

* update readme
2026-02-16 19:08:09 +08:00
William Cheng
bd7fc7f45f v7.20.0 release (#22983)
* v7.20.0 release

* update test
2026-02-16 17:39:46 +08:00
JohnBryte
67a637fe8d Support numeric exclusiveMinimum/exclusiveMaximum in OpenAPI 3.1 (#22981)
* fix: support numeric exclusiveMinimum/exclusiveMaximum in OpenAPI 3.1 (#22943)

* preserving the stricter constraint when both bounds are defined. (#22943)
2026-02-16 17:13:32 +08:00
William Cheng
561aa2e107 minor improvements to Terraform & C++ Httplib generators (#22980) 2026-02-16 01:32:51 +08:00