1175 Commits

Author SHA1 Message Date
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
William Cheng
1a58d31a81 update gdscript samples, docs 2024-11-17 10:55:57 +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
Bruno Coelho
293524785e
[swift][client] rename api client to api configuration (#20103)
* [swift][client] rename api client to api configuration

* [swift][client] rename api client to api configuration

* [swift][client] rename api client to api configuration

* [swift][client] rename api client to api configuration

* [swift][client] rename api client to api configuration

* [swift][client] rename api client to api configuration

* Update modules/openapi-generator/src/main/resources/swift6/api.mustache

Co-authored-by: Lennard Sprong <x-sheep@users.noreply.github.com>

* [swift][client] rename api client to api configuration

* Update modules/openapi-generator/src/main/resources/swift6/api.mustache

Co-authored-by: Lennard Sprong <x-sheep@users.noreply.github.com>

* Update modules/openapi-generator/src/main/resources/swift6/api.mustache

Co-authored-by: Lennard Sprong <x-sheep@users.noreply.github.com>

* Update modules/openapi-generator/src/main/resources/swift6/api.mustache

Co-authored-by: Lennard Sprong <x-sheep@users.noreply.github.com>

* Update modules/openapi-generator/src/main/resources/swift6/api.mustache

Co-authored-by: Lennard Sprong <x-sheep@users.noreply.github.com>

* Update modules/openapi-generator/src/main/resources/swift6/api.mustache

Co-authored-by: Lennard Sprong <x-sheep@users.noreply.github.com>

* Update modules/openapi-generator/src/main/resources/swift6/api.mustache

Co-authored-by: Lennard Sprong <x-sheep@users.noreply.github.com>

* [swift][client] rename api client to api configuration

---------

Co-authored-by: Lennard Sprong <x-sheep@users.noreply.github.com>
2024-11-15 09:35:51 +00:00
William Cheng
6bc8e0bffc
Fix duplicated operationId with new rule in normalizer (#19872)
* fix duplicated opeationId with new rule in normalizer

* update workflow

* update samples

* update samples

* update java samples
2024-11-11 18:12:46 +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
Bruno Coelho
e9ea12f25a
[swift6] improve retry interceptor (#19988)
* [swift6] improve retry interceptor

* [swift6] improve retry interceptor

* [swift6] improve retry interceptor
2024-10-30 11:31:35 +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
ca032113f2
[Swift] shorter readme (#19884)
* [Swift] shorter readme

* [Swift] update docs

* [Swift] update docs

* [Swift] format codegen

* [Swift] try to make CI pass
2024-10-16 11:55:18 +01:00
William Cheng
4ddfb6fc41
update generator faq (#19869) 2024-10-15 16:50:39 +01: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
William Cheng
e2c458b9ea
Prepare 7.10.0 (#19809)
* Revert "prepare 7.9.0 release (#19808)"

This reverts commit 4145000dfebe7a9edea4555c8515383da7602458.

* prepare 7.10.0 snapshot

* update doc

* update samples
2024-10-08 11:21:54 +08:00
Joscha Feth
899ddecdbd
feat(avro)/refactor(core): unify *_POST_PROCESS_FILE behaviour and reuse code (#19761)
* feat(avro)/refactor: unify `*_POST_PROCESS_FILE` bahviour and code

* refactor: use existing function

* test: add simple test for post processor execution

* test: restrict concurrency to 1

* docs: add explanation to method
2024-10-05 17:25:17 +08:00
William Cheng
fbebfeb774 update doc 2024-10-05 17:08:14 +08:00
Jenny G. L.
9791e6f537
[Scala][Client]Add Http4s scala3 client codegen (#19658)
* fix attemp

* use java.time.Instant

* fix client gen

* Tweeks

* header and form

* use scala 3 enum

* more tweeks

* add additional properties; add auth

* add form media type

* add modelsOnly

* add unit tests

* add petstore samples

* add doc

* add new samle to .github/workflows/samples-scala.yaml

* update build.sbt template

* simply the baseclient

* add None to optional field

* tweek auth model and format

---------

Co-authored-by: Jenny Leahy <jennyleahy@JENNYLEAHY.localdomain>
2024-10-05 17:00:19 +08:00
Bruno Coelho
8e10dd7be7
[swift6] add samples that test upload files as data (#19780)
* [swift6] upload files as data

* [swift6] upload files as data

* [swift6] upload files as data

* [swift6] upload files as data

* [swift6] upload files as data

* [swift6] upload files as data
2024-10-04 15:52:48 +01:00
Bruno Coelho
66cde8b5f4
[swift6] make async await the default response library (#19776)
* [swift6] make async await the default response library

* [swift6] make async await the default response library

* [swift6] make async await the default response library
2024-10-04 08:05:05 +01:00
Bruno Coelho
06d914dd0f
[swift6] useSPMFileStructure by default (#19772)
* [swift6] useSPMFileStructure by default

* [swift6] useSPMFileStructure by default

* [swift6] useSPMFileStructure by default
2024-10-03 16:23:43 +01:00
Bruno Coelho
c48ef148c0
[swift] remove unused lenientTypeCast option (#19764)
* [swift6] remove unused lenientTypeCast option

* [swift6] remove unused lenientTypeCast option

* [swift5] remove unused lenientTypeCast option
2024-10-03 12:11:16 +01:00
Bruno Coelho
74100e44cb
[swift6] replace AnyCodable with JSONValue (#19763) 2024-10-03 10:58:06 +01:00
Bruno Coelho
c84af35e7b Revert "[swift6] remove unused lenientTypeCast option"
This reverts commit 171b98e06ceda9881faf876da93a8803113da71a.
2024-10-03 08:45:42 +01:00
Bruno Coelho
171b98e06c [swift6] remove unused lenientTypeCast option 2024-10-03 08:42:10 +01:00
Bruno Coelho
673cd15e72
[swift6] oneOf-default-case (#19754) 2024-10-02 21:30:36 +01:00
Nikita Erokhin
f409bf1440
add oneOf-default-case option for swift5 (#19094)
Co-authored-by: erokha <dev@erokha.com>
2024-10-02 10:56:04 +01:00
nvivot
8ef3118005
[rust][client][auth] token source option (#19647)
* feat: add token source support for rust async client

* chore: fix + regen samples

* chore: doc gen

* chore: missing generated sample files
2024-10-01 15:05:39 +08:00
Bruno Coelho
7f6b1306ed
Add swift6 generator (#19621)
* [Swift6] create Swift6 generator

* [Swift6] create Swift6 generator

* Update vapor integration

* Update bitrise stack to Xcode 16

* [Swift6] tryped throws

* [Swift6] tryped throws

* [Swift6] combine deferred and api static method

* [Swift6] update readme

* [Swift6] fix some errors

* [Swift6] fix some errors

* [Swift6] fix some errors

* [Swift6] update docs

* [Swift6] update docs

* Use multiline comments for examples in csharp generator (#19079)

* multi

* gen

* Uncomment File::deleteOnExit (#19624)

* [Core/Rust Server] Check references in additionalProperties correctly when checking freeForm status (#19605)

* Check references in additionalProperties correctly

Handle references in additionalProperties correctly when determining free-form status

* Update samples

* [Rust Server] Handle arrays in forms (#19625)

* [Rust Server] Handle arrays in forms correctly

* [Rust Server] Add tests

* Update samples

* [Swift6] fix CI

* [Swift6] fix CI

* [Swift6] fix CI

* [Swift6] fix CI

---------

Co-authored-by: Liri S <reallyliri@gmail.com>
Co-authored-by: Beppe Catanese <1771700+gcatanese@users.noreply.github.com>
Co-authored-by: Richard Whitehouse <git@richardwhiuk.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2024-09-25 16:57:25 +08:00
Sergei Lebedev
7d8eacc197
[cpp-qt-client] New makeOperationsVirtual option (#19613)
* Implementation of new `makeOperationsVirtual` option

* Make new parameter `true` by default

* Fix default value set and regenerate samples
2024-09-24 01:05:07 +08:00
Joscha Feth
171804eef7
feat(avro-schema): logical type support (#19607)
* feat(avro-schema): logical type support

* style: newline at eof
2024-09-19 09:34:51 +08:00
Eric
425aa7db44
[Kotlin] Add a new additional property to configure Jackson's failOnUnknownProperties (#19506)
* [Kotlin] Add a new additional property to configure Jackson's `failOnUnknownProperties`

Default to false

* [Kotlin] Unconditionally import `com.fasterxml.jackson.databind.DeserializationFeature`

* [Kotlin] Refactor and add test
2024-09-16 17:59:17 +08:00
Joscha Feth
5c6b8f3b16
docs: add hint about how to attach VSCode to the suspended Java process (#19551) 2024-09-12 16:59:57 +08:00
William Cheng
8511a533d6
add erlang-server-deprecated for fallback after refactoring (#19547) 2024-09-07 17:18:06 +08:00
Nelson Vides
596d446f54
Erlang server overhaul (#19465)
* Upgrade erlang-server code generation and fix is_authorized crashes

* Introduce structured logging

* Improve general formatting

* Update generated files

* Enable erlang server on CI

* Add echo-server testing to CI

* Require OTP27 explicitly in the generated rebar.config file

* Rework handler and API

With this work, json validation becomes optional, fully implemented in
the `_api` module as it was before, but without being forcibly called by
the `_handler`. It is instead left as optional for the user to take
advantage of the exposed callbacks. Jesse also chooses draft-06 as a
default, but these can be chosen manually by the user too, as long as
jesse implements them.

`_handler` also becomes lighter, it now handles all mime types
transparently by forwarding to a user-given module that must implement
`accept_callback/4` and `provide_callback/4` as described in the
`_logic_handler` callbacks. These will simply be the return values of
cowboy_rest's `content_types_accepted` and `content_types_provided`
respectively, and should simply comply with their defined APIs. They
only get two parameters extending the behaviour, so that the user-given
callback can pattern-match on them: the path prefix of the logic
handler, and the operationID of the call.

* Fix return types for provide_callbacks

* Upgrade jesse to incur no dependencies

The less dependencies the built code requires the better.

* Fix dialyzer errors in the generated code

* Apply stronger dialyzer checks
2024-09-07 16:45:42 +08:00
Nicklas Wiegandt
e4112c5aca
feat (JAVA SPRING RESTCLIENT) 19406: Add single request parameter for Spring RestClient (#19430)
* feat (JAVA SPRING RESTCLIENT) 19406: Add single request parameter for Spring RestClient

Closes #19406

* chore (JAVA SPRING RESTCLIENT) 19406: Add new sample to jdk 17 tests

* fix (JAVA SPRING RESTCLIENT) 19406: Fix sample build
2024-09-04 16:17:13 +08:00