960 Commits

Author SHA1 Message Date
William Cheng
0e34d39833
add tests, option for useVirtualHooks (csharp) (#20837) 2025-03-11 00:02:30 +08:00
sabra
f2bbb9e0a2
[java] generateClientAsBean for restclient and webclient (#20754)
* [java] generateClientAsBean for restclient and webclient

Added possibility to generate restclient and webclient as a @Component in the same fashion as resttemplate.

Fix #17885
Fix #19229

* - Samples
2025-03-05 17:50:24 +08:00
lucy66hw
c96d3088c5
[protobuf-schema] Use snake_case for protobuf fields, UPPER_SNAKE_CASE for enums. (#20696)
* protobuf enum prefix use upper underscore

Add json name parameters and change parameter field name to snake case

* rerun generate-samples.sh

* Add CI test

* rebase master

---------

Co-authored-by: xil <xil@uber.com>
2025-03-04 17:18:07 +08:00
William Cheng
6e9a0559a8
[csharp] Set generichost as default (#20748)
* set generichost as default

* revert a java change

* comment out a java test

---------

Co-authored-by: devhl <shawnkanyer@gmail.com>
2025-02-27 18:06:27 +08:00
William Cheng
1c3eade94d
[java][spring] Add option optionalAcceptNullable to accept null values (#20746)
* add option to rollback accept null values

* update doc

* update tests
2025-02-27 17:21:51 +08:00
Mattias Sehlstedt
60bae732d3
SingleRequestParameter setter parameter construction (#20679)
* Add so that the singleRequestParameter can be constructed one parameter at a time

* Replace the lombok EqualsAndHashcode with a mustache implementation

* Remove equals and hashcode from oneRequestParameter model

* Remove the final keyword from variables in the oneRequestParameter class
2025-02-26 17:27:30 +08:00
Alex
cd7cdb1e24
Add option to generate a fully sealed model in the JavaSpring generator (#20503)
* Generated sealed interfaces for oneOf

* Add generated data

* Add also  modifier

* Allow sealed for everything

* Fully seal model

* Disable html escaping

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

Co-authored-by: martin-mfg <2026226+martin-mfg@users.noreply.github.com>

* Update docs

* Check all oneOf scenarios

* Fix failed scenario

* Fix comments

* Remove unused import

* Adapt pom.xml also

* Add comment and remove unused function

---------

Co-authored-by: martin-mfg <2026226+martin-mfg@users.noreply.github.com>
2025-02-19 15:15:09 +08:00
Victoria Casasampere Fernandez
d5866feb2d
[Rust-Axum] Implement support for Basic and Bearer auth in Claims (#20584)
* Implement a custom error handler for unhandled or generic endpoint errors

* Pass in method, host and cookies to error handler

* Update axum to 0.8

* Make API methods take references instead of ownership

* Rebase error handler

* Rebase with updated error handler

* Update deps

* Fix capture group syntax

* Rebase rust-axum-error-handling

* Update docs

* Multipart is also part of the axum update

* Update samples

* Update docs
2025-02-19 14:48:28 +08:00
William Cheng
61ae569149 update doc 2025-02-19 14:37:12 +08:00
lucy66hw
4883de51c1
enum zero index is UNSPECIFIED suffix (#20473)
Co-authored-by: xil <xil@uber.com>
2025-02-19 14:30:53 +08:00
Gijs Blanken
65df3c22b9
Rewrite the PHP Laravel generator (#20526)
* remove legacy laravel generator

* initial setup of my vision for the laravel generator

* update the php laravel samples

* update php laravel docs

* moved api validation into controller and handle edge cases presented by sample generation

* updated samples

* added php-laravel to github workflow php8 and removed php7 workflow as it only contained old laravel

* preemptive work to support union types as soon as php serde supports them

* updated samples

* update templates in accordance to samples output

* fix pipelines and update samples

* correct serde version

* fixed phpunit execution and updated samples

* added named routes

* remove

* readd samples

---------

Co-authored-by: gijs.blanken@futureof.finance <gijs.blanken@finly.nl>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2025-02-17 21:50:13 +08:00
Carlos Chacin
a6280d9b58
[java][client] fix: Add static modifier to inner class in Java when useSingleRequestParameter=true (#20590)
* fix: Add static modifier to inner class

* Apply suggestions from code review

Co-authored-by: martin-mfg <2026226+martin-mfg@users.noreply.github.com>

* fix: Remove unintended whitespace

* fix: Add default=false for useSingleRequestParameter

---------

Co-authored-by: martin-mfg <2026226+martin-mfg@users.noreply.github.com>
2025-02-17 20:02:01 +08:00
Jimmy Praet
9a9c1087be
Add config option to disable generation of @JsonCreator constructor (#20570) 2025-02-05 16:00:03 +08:00
William Cheng
98ccf95e43
[ASPNETCORE] Add support for central package version management (#20401)
* Added useCentralPackageVersionManagement option for aspnetcore

* Removed debug code from template

* Added option to opt out of centralized version management

* Added sample for centralized version management

* Removed changes for .net9

* Updated template file for model project

* Code formatting

* Corrected sample config for aspnetcore

* Regenerated Samples

* update samples, docs

* Fixed models project mustache file

* Regenerated samples and docs

* Regenerated smaples and doc

* Changed options to enum WIP

* fix option

* [ASPNETCORE] Add support for central package version management #20192 (#20403)

* Fixed default value for usePackageVersions

* Regenerated docs

* update workflow

* add props file

---------

Co-authored-by: Urganot <ballingsimon@googlemail.com>
2025-01-18 14:52:41 +08:00
devhl-labs
479cd522e0
[csharp] Removed .net6 and .net7 (#20449)
* removed .net6 and .net7

* build docs

* build docs
2025-01-13 15:22:30 +08:00
Ruslan Khasanshin
358e8af2bf
[kotlin-spring] Adds useFlowForArrayReturnType option for reactive mode (#16130) (#20409)
* [kotlin-spring] Adds useFlowForArrayReturnType option for reactive mode (#16130)

* [kotlin-spring] Replaces manual doc change with generated one (#16130)

* [kotlin-spring] Fixes errors (#16130)

* [kotlin-spring] Adds samples (#16130)
2025-01-11 15:53:04 +08:00
John Vandenberg
eb47b9d836
Fix typos (#20442) 2025-01-11 15:44:42 +08:00
Mark Doliner
536519c0ec
Update python options in the generators README.md (#20417)
- Remove the dead link to a python-legacy client generator.
- Add a link to the python-pydantic-v1 client geneator.
- Add a link to the python-fastapi server generator.
2025-01-09 11:55:21 +08:00
William Cheng
8f4cfa3955
[swift] fix typos, minor code format enhancement (#20387)
* fix typo in swift option, minor code format enhancement

* fix uuid typo in swift codegen and template

* fix typo minium
2024-12-31 16:51:18 +08:00
William Cheng
ab8d359dc3
add option to skip setting user agent in js client (#20367) 2024-12-22 23:11:54 +08:00
devhl-labs
5ba608ff8a
[csharp] add .net9 support (#20270)
* add .net9 support

* fixed path of new sample

* comment out manual test that does not exist

* comment out manual test that does not exist

* comment out manual test that does not exist
2024-12-22 22:06:33 +08:00
Kirill Romanov
4e5a828c12
feat: add option to support non-ascii headers in kotlin client (#20331) 2024-12-15 16:46:42 +08:00
Nicklas Wiegandt
07d19baf89
feat (#19407 JAVA SPRING WEBCLIENT): Add support for useSingleRequestParameter to Spring WebClient (#19827)
* chore (JAVA SPRING WEBCLIENT): Remove comments used for debugging

* feat (JAVA SPRING WEBCLIENT): Add support for useSingleRequestParameter to Spring WebClient

* feat (JAVA SPRING WEBCLIENT): Generate samples and docs

* fix (JAVA SPRING WEBCLIENT): Fix missing return error & Fix JDK17 action webclient useSingleRequestParameter test path

* fix (JAVA SPRING WEBCLIENT): Fix code indention

* fix (JAVA SPRING WEBCLIENT): Fix code indention again

* fix (JAVA SPRING WEBCLIENT): Update samples

* feat (JAVA SPRING WEBCLIENT): Regenerate after pull rebase
2024-12-15 15:28:38 +08:00
William Cheng
24ddb33d0b add ktor2 library option to kotlin server generator 2024-12-13 01:15:03 +08:00
Daniel Åkerlund
b218e238f4
Improve handling of pekko versions in scala-akka-http-server generator (#20277)
* Fix issue 20275 Improve handling of pekko versions

* Generated docs

* Use version 1.1.0 as default version of pekko-http.

* Updated sample
2024-12-11 12:31:22 +08:00
Ingars Ribners
dc175c5335
Added PostgreSQL schema generator (BETA) (#20255)
* Initial version of PostgreSQL schema generator 'postgresql-schema' (based on 'mysql-schema' generator code)

* PostgreSQL schema generator. Initial version.

* Tested. Fixed errors. Documentation updated.

* Samples for 'postgresql-schema' updated.

* Removed current date/time from mustache templates for postgresql-schema generator.
Re-created samples.

* Re-created docs file for postgresql-schema generator.

* Removed unecessary LocalTime computing code and imports for postgresql-schema generator.

* Errors fixed for postgresql-schema generator. Samples recreated.

* Docs updated.
2024-12-07 22:52:59 +08:00
Alexander Brandon Coles
3a37ba33a7
Fix typo "bellow" (#20268)
* Fix typo in constant name: s/BELLOW/BELOW/

* Fix typo ('bellow') in docs, comments and strings
2024-12-06 16:18:08 +00:00
Thibaud Sowa
8a07557865
fix(typescript-angular): fix new angular dependency cli option usage (#20247)
Co-authored-by: Thibaud SOWA <thibaud.sowa@equasens.com>
2024-12-04 21:52:08 +01:00
Thibaud Sowa
423ba6739a
feat(typescript-angular): add support for Angular V19 (#20205)
* feat(typescript-angular): add support for Angular V19

fix #20204

* feat(typescript-angular): add options to override angular deps + refactor deps definition

add tsVersion, rxjsVersion, ngPackagrVersion and zonejsVersion options to override default config if new version of Angular is available but not yet implemented in openapi-generator
refactor Angular dependencies definition in separate readable yaml config file

fix #20204

* feat(typescript-angular): add better angular 19 exemple for ci testing

fix #20204

* feat(typescript-angular): unify tsVersion param

fix #20204

---------

Co-authored-by: Thibaud SOWA <thibaud.sowa@equasens.com>
2024-12-03 17:58:17 +01:00
Gregory Merlet
cf78f1028d
Fix dangerous destructuration in typescript-nestjs services (#20157)
* refactor: remove requestParameters destructuration

* feat: add reserved param names sample

* feat: quote params

* feat: improve with reservedWords

* feat: use vendorExtensions instead of extending CodegenParameter
2024-12-03 11:38:43 +01:00
DielN
b9f6fe6b1f
[Java] [Microprofile] Add Json-B polymorphism type info annotations (#20164)
* [Microprofile] Add Json-B polymorphism annotations

* [Microprofile] Set openApiNullable in configs to false

* [Microprofile] Bump JSON Bind version to 3.0

* [Microprofile] Only apply JSON-B polymorphism for MP 3.0

* Update samples

* [Microprofile] Update documentation/configs for openApiNullable

* Update docs
2024-12-03 12:02:54 +08:00
William Cheng
878148e66d
update kotlin option description to clarify the support (#20211) 2024-11-30 13:32:15 +08:00
William Cheng
711e53a90c
[Java] Add option to fallback to legacy enum naming (#20172)
* add option to fallback legacy enum naming (java)

* fix tests
2024-11-29 17:12:12 +08:00
Lennard Sprong
af89ed8043
[swift5] Add Identifiable conformance to supported models (#20179) 2024-11-25 17:43:51 +00:00
Lennard Sprong
4c5a57fe7b
[swift6] Add Identifiable conformance to supported models (#20166) 2024-11-24 22:35:17 +00:00
altro3
cdafa5a0cc
Deprecate micronaut openapi generator (#20107)
* Deprecate micronaut openapi generator

* update get help message

---------

Co-authored-by: William Cheng <wing328hk@gmail.com>
2024-11-24 23:26:37 +08:00
Antoine Goutenoir
959cf1c3c9
[GdScript] Templates for GdScript (Godot 4) (#19267)
* feat(gdscript): sketch implementation of gdscript target language

This does not really work yet, but it's a start.
Results are not denormalized, no support for enums nor datetimes,
and thousands of other features are missing.

I still don't know how we are going to denormalize JSON+LD
without writing a whole GDScript lib for it…

* feat: add an exhaustive list of keywords reserved in GDScript

I've also provided the small python script I used to generate the list.

* refacto(gdscript): start using partials in templates

Whilst I'm racking my brains trying to figure out integration testing…

* test(gdscript): prepare a demo and integration testing

* fix(gdscript): do not use subclasses, use plain POGO

(plain ol' godot object)

One: I don't know how they work under-the-hood.
Two: I'm very confused over-the-hood.
Tri: We do not need them.

* refacto(gdscript): move demo files to their own directory

I know I'm making a lot of commits for not much,
but now I'm opening the sample files with Godot as well,
and doing unholy things with filesystems,
so I'm not taking any chances.

It's all going to be squashed anyway.  :)

* fix(gdscript): sample as a Godot project

It works !  I can now write integration tests in GDScript.
The real work starts now.

/spend 25h

* feat(gdscript): serialize and send body params

The test suite is now past its first hurdle, the 415 HTTP status code,
and went straight into an unexpected error 500.

I suspect the server does not like me trying to set the pet id at 0,
because that's what we're trying to do right now.

Godot is crashing a lot, mostly because I don't know how to make Callable.NOOP
and my current solution hints at optional on_success and on_failure,
yet if we omit them the engine will ragequit.

* feat(gdscript): check request body for required yet missing properties

Now we'll get a nice error when we forget to set a required property.

The demo is now able to:
- connect
- create a user
- login as that user
- create a pet

* feat(gdscript): namespace core classes as well with apiPrefixName

This makes our usage of `class_name` a little more acceptable.

* feat(gdscript): support prefixes and suffixes for class names

This will crutch namespacing well enough for most uses.

* feat(gdscript): handle enums, naively

* feat(gdscript): support basic API endpoint param constraints

- minLength
- maxLength
- minItems
- maxItems
- minimum
- maximum
- pattern (no flags)

* feat(gdscript): handle header params and header customization

We also support serializing to application/x-www-form-urlencoded now.

Next up: DateTimes !

* feat(gdscript): handle Date and DateTime like Strings

There's no timezone support in Godot for DateTimes.

* feat(gdscript): support plain text responses

* feat(gdscript): support collections of models

Those are Arrays, not custom collection objects.

* feat(gdscript): configure default host from OAS

* feat(gdscript): some documentation and better config

We don't need no factories nor singletons ; config is enough.

* docs(gdscript): document usage a little

* feat(gdscript): add more reserved words, skip jsonld models and configure features

We can now generate a client for an OAS server running ApiPlatform (PHP).

* feat(gdscript): improve logging with a configurable log level

* feat(gdscript): add support for Basic Bearer and Header ApiKey

(but I can't find the `description` template handler)

* fix(gdscript)

Too late to amend >.<

* fix(gdscript)

dangsarnit

* chore(gdscript): clean up a sprint artifact

* fix: don't forget the HTTP error code when relevant

* feat: use Resource as base class for models

* fix. Default string values now with "quotes"

* temporary remove settings as godot api have changed

* kick ci

* docs: review gdscript java class

* feat: support for TLS, some refacto, some review

There's still a lot of holes, TODOs and FIXMEs.

* feat: experimental support of Request inline objects

The inline response objects are still not supported.

* feat(gdscript): support inline request and response objects

* chore(gdscript): review the templates

* fix(gdscript): unexpected nulls in default values

{{#if defaultValue}} evaluates to true for null if we call super here.

* refacto(gdscript): replace "bee" prefix by "bzz", use a constructor

Now we pass the config and the client via the constructor.
This reduces the area of the public surface a bit, for the better I think.
This commit also cleans up the class name shenanigans.

* fix(gdscript): add missing file

* test(gdscript): refactor the test project to use the generated lib as addon

Since there is no singleton in the generated client, the addon need not be enabled in the project configuration to be usable.

The --headless mode is broken for now, as things changed in Godot 4 since the beta.

* docs(gdscript): document petstore server ADR

* test(gdscript): add GUT and an integration test

We used the latest stable GUT, but a feature we're going to need was merged today, so we'll need to update it either to master or to the next release at some point.

* refacto(gdscript, breaking): use an ApiResponse object in success callbacks

/spent 6d since the beginning

* test(gdscript): update integration tests

/spend 2h

* docs(gdscript): explain the new ApiResponse

Also moving core templates to their own subdir, for clarity.

/spend 10m

* chore(gdscript): review, document, clean up

/spend 2h

* test(gdscript): test the delete operation as well

/spend 7m

* feat(gdscript): update GUT and exit with appropriate code

/spend 2h

* docs(gdscript): add Gdscript's PI

Hire me while I'm available !  :D
I'd rather code than make a CV.

* feat(gdscript): support reserved keywords

Also adding some more assertions,
and using our own OAS file now.

/spend 3h

* refacto(gdscript): use "base" instead of "bee"

/spend 1h

* feat(gdscript): improve descriptions

/spend 1h

* fix(gdscript): await before polling

Contributed by @jchu231

* docs(gdscript): review the template files

* docs(gdscript): review and generate docs

---------

Co-authored-by: Bagrat <b.saatsazov@gmail.com>
2024-11-17 10:48:19 +08:00
William Cheng
02847e9323
Update minimum supported version of python in docs to 3.8+ (#20118)
* Update minimum supported version of python in docs

* update samples, docs

---------

Co-authored-by: Hugo Posnic <hugo.posnic@protonmail.com>
2024-11-16 18:01:50 +08:00
William Cheng
b34df341a4
[csharp] Add option to fallback to int for Timeout (#20069)
* add option to fallback to int for Timeout

* update doc
2024-11-09 15:23:57 +08:00
Julien Tschäppät
7deecdc569
[csharp] Add a server generator for FastEndpoints (#19690)
* Add of a first working generator for FastEndpoints framework

Generator that support the basics of a FastEndpoints project
https://fast-endpoints.com/

* Add respose code documentation support

* Add an option to enable use of problem details

* Clean enum and model

* Add an option to generate record for requests/models

* Update sample

* Add support of nullable types

* Add option to enable authentication

* Add option to generate validators

* Clean readme.md file

* Add option to enable response caching

* update readme template

* Add missing files references

* Update generated sample

* Add link to documentation

* Add generator documentation

* correctly support packageName

supportingFiles additions moved to processOpts()

* improve useAuthentication option handling

Avoid to copy an empty file

* processOpts, move call to parent at the end

* Update generated sample

* Refactor and fix super.processOpts(); call order

* Handle the case of multi-line description

* Rename field to match naming conventions

* Add useApiVersioning option

* Update generated sample

* Add generator documentation

* Fix record when model contains optional properties

* Add configuration files for each option

* Add sample project for each configuration

* Add GitHub Action workflow for sample projects

* Add FastEndpoints BindFrom attribute on path, query and form params

* Update sample generated projects

* Fix validator template

* fix alphabetical order

* Use fully qualified name for FastEndpoints

* Add options to set GUID to be used in sln file

* update sample projects

* Update generators.md

* Fix path in github workflow

* Put readme, gitignore and solution file at the root of generated project

* update sample projects

* Remove the projectGuid option

This Guid need to be constant, it is related to project type

* update sample projects
2024-11-07 20:28:29 +08:00
Linh Tran Tuan
cded99c3fc
[Rust-Axum] Support Authentication (Cookie, API Key In Header) (#20017)
* [Rust-Axum] Support Cookie Authentication & API Key In Header

* Fix

* Fix

* Fix Header Params & Responses
2024-11-06 16:13:00 +08:00
William Cheng
b66b7af5d0
[JS] set option to true by default, update samples (#20003)
* set option to true by default, update samples

* update doc
2024-10-31 15:01:37 +08:00
Tobias Brauneis
ae4e2515dc
add parameter 'useURLSearchParams' to use JS build-in UrlSearchParams, instead of deprecated npm lib 'querystring' (#19949) 2024-10-31 14:48:45 +08:00
Pavel Sveda
acb16410c4
[Kotlin] Introduce support for Kotlin Explicit API Mode for Kotlin-Client generator (resolve #16506) (#19999)
* [Kotlin] Properly document nonPublicApi CLI option

* [Kotlin] Respect parameter name of parent KSerializer to avoid miss-behavior

* [Kotlin] Introduce support for Kotlin Explicit API Mode for Kotlin-Client generator (resolves #16506)
2024-10-30 21:57:47 +00:00
Ross
4a21dea47f
Added support for a trait based reqwest Rust client (#19788)
* Added Rust Reqwest trait based client

* Fixed Cargo imports for reqwest trait template

* Added support for mockall to Rust reqwest trait library

* Added MockApiClient when mockall and topLevelClient are enabled

* Added missing flags to Rust generator documentation

* feat: add support for single argument and bon builder

Adds support for single argument and bon building for the new
reqwest-trait generator

* Rebuilt rust samples

---------

Co-authored-by: Troy Benson <troybensonsa@gmail.com>
2024-10-30 14:21:11 +08:00
Aliaksandr SEMIANKEVICH
e9c3c63732
[REQ] resolve #17544 Add x-field-extra-annotation and x-class-extra-annotation for kotlin generator (#19899)
Co-authored-by: Aliaksandr SEMIANKEVICH <aliaksandrsemian.epam@navan.tech>
2024-10-22 18:05:38 +08:00
David Riddervold Marconis
ce09134b48
[typescript] feat: Add typescript licenseName option (#19888)
* Add licenseName option to typescript

* Update documentation

* Fix import in test

* Consolidate typescript test OptionsProviders

* Rename Typescript to TypeScript
2024-10-17 15:48:38 +02:00
Bruno Coelho
2354d402a8
[swift6] promote to beta and improve documentation (#19856)
* [swift6] promote to beta

* [swift6] format code

* [swift] authentication docs

* [swift] update docs

* [swift] update docs

* [swift] update docs

* [swift] update docs

* [swift] update docs

* [swift] update docs

* [swift] update docs

* [swift] update docs

* [swift] update docs

* [swift] update docs
2024-10-14 12:55:25 +01:00
Bruno Coelho
462f450366
[kotlin] Map file and binary to ByteArray (#19840)
* [kotlin] Map file and binary to ByteArray

* [kotlin] Map file and binary to ByteArray
2024-10-11 08:59:16 +01:00
Hui Yu
ba169342a1
[C][Client] Add gcc predefined macros to reserved keywords (#19791) 2024-10-09 01:38:12 +08:00