Commit Graph

8602 Commits

Author SHA1 Message Date
Miklós Márton
739d1edd6b [cpp-qt-client]Fix variable redeclarations in the api-body.mustache (#22982)
* [cpp-qt-client]Fix variable redeclarations in the api-body.mustache

* [cpp-qt-client]Utilize enum for OauthMethod flow

* [cpp-qt-clien]Suffix token variables in OAuth with meaningful state names instead of numeric indexes
2026-03-12 14:29:37 +08:00
William Cheng
54cedcb0c2 [kotlin-client] Support for integer enums for multiplatform with custom serializer (#23211)
* use custom serializer for non string enums for multiplatform library

* add missing imports

* add tests for enum integers

---------

Co-authored-by: rlnt <relentless@rlnt.dev>
2026-03-12 10:17:56 +08:00
William Cheng
4603cc90bf Use Pydantic for json serialization in .to_json method (#23210)
* [Python] Use pydantic_core.to_jsonable_python to convert non-standard data types

* [Python] Add test for UUID serialization

* update python samples

---------

Co-authored-by: Espen Haugsdal <espen.haugsdal@gmail.com>
2026-03-12 09:15:50 +08:00
Benjamin Einaudi
8ef4a480cb fixes(spring) add JsonProperty on setter (#22978)
* extract jacksonAnnotation partial template
* extract xmkAccessorAnnotation partial template
* apply jacksonAnnotation partial template on both getter and setter

Fixes #22757
2026-03-11 17:24:25 +08:00
William Cheng
b3244e93bf Fix child constructor no longer has invalid access to parent field (#23205)
* Fix fix that child constructor was invalid when having readonly field in parent

* add classType field

* fix test

* update samples

---------

Co-authored-by: bdurca <rca@bankdata.dk>
2026-03-11 17:06:18 +08:00
A Tokle
3e0a9f7ace fix spring-http-interface created swagger annotations (#23073) 2026-03-11 17:00:05 +08:00
Ary Obenholzner
eaa79e29a3 [typescript-nestjs-server] #22928 improve request parameter handling (#22960)
* [typescript-nestjs-server] #22928 exclude inline union strings from generating imports

* [typescript-nestjs-server] #22928 add optional type hints

* [typescript-nestjs-server] #22928 add/improve support for various parameter types

* [typescript-nestjs-server] #22928 add docs, fix indentations and test execution

* [typescript-nestjs-server] #22928 correctly parse numeric parameters, use DefaultValuePipe for default values

* [typescript-nestjs-server] #22928 lowercase header access, check each import for unions

* [typescript-nestjs-server] #22928 allow optional parameters for number parse pipes

* [typescript-nestjs-server] #22928 updated README, additional PR feedback

* [typescript-nestjs-server] #22928 updated README
2026-03-11 09:04:53 +01:00
William Cheng
274510c6b5 [Ruby] Minor code improvement (#23196)
* minor refactoring in ruby client codegen

* add tests for minus 1 enum value
2026-03-11 03:24:38 +08:00
William Cheng
1a09c7abd3 Add option to fallback to non-pointer number, boolean types (#23197)
* add option to fallback to non-pointe number, boolean

* add new files

* fix
2026-03-11 02:35:25 +08:00
hirish
d8afb229fa fix c-libcurl generator for int and boolean values by moving to int* (#23052)
* [c] move model from int to int*

* [c] regenerate petstore and fix manual unit-tests

* [c]-useJsonUnformatted regenerate petstore samples

* [c] fix memory leaks

* [c] fix memory leaks: second round

* [c] fix memory leaks: third round
2026-03-11 01:27:51 +08:00
Noor Dawod
a2fd144758 Bring Kotlin client code up-to-speed with changes (#23188)
* Convert static constants to CAPITALS.

* Bring `responseBody` up-to-speed with regards to response nullability.

* Keep previous constants so not to break existing code.

* Generate samples code.

* Apply suggestion from @cubic-dev-ai[bot]

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* Regenerate sample code.

* Reorder statics, fix values of `ACCEPT` and `AUTHORIZATION` constants.

* Regenerate sample code.

* Add deprecation constant.

* Regenerate sample code.

* Remove unnecessary annotation.

* Regenerate samples code.

---------

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2026-03-10 12:40:11 +00:00
Yonatan Karp-Rudin
a04b9a5960 feat(kotlin-spring): add Spring Boot 4 and Jackson 3 support (#23154)
* feat(kotlin): add Jackson 3 infrastructure to AbstractKotlinCodegen

* feat(kotlin-spring): add useSpringBoot4 and useJackson3 flags

* feat(kotlin-spring): update template selection for Spring Boot 4

* feat(kotlin-spring): add SB4 templates for all libraries

* test(kotlin-spring): add tests for Spring Boot 4 and Jackson 3 support

* feat(kotlin-spring): add kotlin-springboot-4 sample with Jackson 3

* docs(kotlin-spring): document useSpringBoot4 and useJackson3 options

* fix(kotlin-spring): update Gradle templates to Kotlin 2.2 JvmTarget DSL and bump CI Gradle

- Replace deprecated kotlinOptions.jvmTarget with kotlin.compilerOptions DSL
- Upgrade Gradle wrapper to 8.14 for Kotlin 2.2 compatibility
- Add kotlin-springboot-4 sample to JDK17 CI matrix
- Regenerate sample with updated templates

* fix(kotlin-spring): register useJackson3 CLI option and use Gradle 8.14 for SB4

- Add addSwitch for useJackson3 in KotlinSpringServerCodegen so it
  appears in auto-generated docs
- Update gradle-wrapper.properties.mustache templates to use Gradle 8.14
  when useSpringBoot4 is enabled (required minimum for Spring Boot 4)

* fix(kotlin-client): fix Jackson 3 package imports and add ktor/spring-restclient support

Replace hardcoded com.fasterxml.jackson imports with {{jacksonPackage}} template
variable across all kotlin-client templates so generated code compiles correctly
when useJackson3=true. Also fix trailing space in OAuth Bearer header, enable
useJackson3 for jvm-ktor (Ktor 3.4.0) and jvm-spring-restclient (Spring Boot 4),
and add conditional Jackson 3 dependencies in build.gradle.

* Revert "fix(kotlin-client): fix Jackson 3 package imports and add ktor/spring-restclient support"

Block useJackson3 for kotlin-client with a clear error until client
template support is added in a follow-up PR.

* ci: retrigger CI checks

* fix(kotlin-spring): replace legacy oauth2 starter and add Jackson exclusivity tests

Replace deprecated spring-cloud-starter-oauth2:2.2.5.RELEASE with
spring-boot-starter-oauth2-client in SB4 templates, as the legacy
starter is pre-Jakarta and incompatible with Spring Boot 4.

Add negative assertions to Jackson dependency tests to ensure Jackson 2
and Jackson 3 artifacts are mutually exclusive.

* feat(kotlin-spring): default to Jackson 3 when Spring Boot 4 is enabled

Spring Boot 4 ships with Jackson 3 out of the box, so useJackson3 now
defaults to true when useSpringBoot4 is enabled and the user hasn't
explicitly set useJackson3.

* fix(kotlin-spring): declare springdoc version property regardless of useSwaggerUI

The springdoc-openapi.version Maven property was only declared when
useSwaggerUI=true, but the springdoc core dependency (used when
useSwaggerUI=false) also references it, causing an undefined property.

* fix(kotlin-spring): use modern OAuth2 client config for Spring Boot 4 spring-cloud library

Add useSpringBoot4 conditionals to clientConfiguration.mustache so SB4
uses OAuth2AuthorizedClientManager instead of legacy OAuth2FeignRequestInterceptor
and *ResourceDetails classes that don't exist in Spring Boot 4.

* fix(kotlin-spring): default Jackson 3 when Spring Boot 4 set via setter or additionalProperties

The Jackson 3 defaulting logic only checked additionalProperties map,
so calling setUseSpringBoot4(true) via the Java API skipped the default.
Now checks both the field value and the map.

* fix(kotlin-spring): add trailing newline to clientConfiguration template

* Trigger CI

* clean up conditions

* fix(kotlin-spring): remove SB4+Jackson2 test since SB4 unconditionally implies Jackson 3

Spring Boot 4 ships with Jackson 3 — there is no supported SB4+Jackson2
combination, so the test was asserting an invalid scenario.

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 16:56:54 +08:00
Miklós Márton
1462933d01 [cpp-qt-client] Optimize generated code (#23089)
* [cpp-qt-client]Optimize generated code
- Use const references at function parameters
- Do not perform useless initialization of QStrings
- Use qDeleteAll

* - Do not change signal arguments to const in public API as it breaks API
- Fix whitespace typo

* Regenerate tests
2026-03-10 16:51:28 +08:00
Jules Ivanic
dc4155051d [typescript-fetch] Add option to exclude RequestOpts from API interfaces (#23181)
* [typescript-fetch] Add withRequestOptsInInterface option to hide RequestOpts from API interfaces

The *RequestOpts methods are implementation details that build request
options before sending the fetch call. Most consumers using the API
interfaces don't need these methods exposed in the contract.

Add a new `withRequestOptsInInterface` boolean option (default: true
for backward compatibility) that controls whether *RequestOpts methods
appear in the generated API interface declarations. When set to false,
the methods remain as public methods on the class but are excluded from
the interface.

* Fix test: scope RequestOpts assertion to interface section

The previous test used indexOf("}") to find the interface end, which
matched the } inside @throws {RequiredError} JSDoc instead of the
actual closing brace. Use the class declaration position as the
boundary instead.

* Fix forbiddenapis violation: use explicit UTF-8 charset

Replace new String(byte[]) with new String(byte[], StandardCharsets.UTF_8)
to satisfy the forbiddenapis Maven plugin check.

* Add withRequestOptsInInterface to options test and regenerate docs
2026-03-10 12:21:42 +08:00
devhl-labs
a7eedd9df5 fix invalid implicit casts (#23192) 2026-03-10 11:04:51 +08:00
Christopher Molin
44bc527f8b [Java] Optimize All Enum fromValue Mustache Templates (#23165)
* [Java] Optimize All Enum `fromValue` Mustache Templates

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

* Fix JavaJaxRS Mustache Template

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

---------

Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>
2026-03-10 01:09:48 +08:00
William Cheng
067c9b2897 update jackson to 2.21.1 (#23187) 2026-03-09 18:18:53 +08:00
phoval
0d2ff8c69b feat(jackson3): add jackson3 support for Java Client generator - WebClient (#23031)
* feat(jackson3): add jackson3 support for Java Client generator - WebClient

* chore: generate bin/generate-samples.sh bin/configs/java-*

* fix: add back FindBugs JSR 305 dependency

* chore: generate bin/generate-samples.sh bin/configs/java-*

* chore: generate bin/generate-samples.sh bin/configs/java-*
2026-03-09 14:31:39 +08:00
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
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