19782 Commits

Author SHA1 Message Date
William Cheng
2abcb4f7f0
7.4.0 release (#18067) v7.4.0 2024-03-11 10:11:15 +08:00
linxin1019
20bd649bf9
Add enum name mapping feature to typescript generators (#18064)
* feat: add enum mapping for typescript

* revert unnecessary change
2024-03-10 23:28:33 +08:00
swcm-mnestler
0bc979ebdc
[typescript-nestjs] Compatability with tsc 'strict' flag (#17672)
* [typescript-nestjs] Compatability with tsc 'strict' flag

* Update samples / docs
2024-03-09 17:16:29 +01:00
William Cheng
950028419a update samples 2024-03-10 00:03:11 +08:00
dabdirb
93aec4d89d
Fix #17831 @lombok.NonNull on all required fields when any lombok annotation is included (#17861)
* fix #17831 @lombok.NonNull on all required fields when any lombok annotation is included

* fix #17831 @lombok.NonNull on all required fields when any lombok annotation is included
2024-03-09 17:44:10 +08:00
hahny93
033993c63d
[Kotlin Spring] fix template request part and description (#17821)
* [kotlin-spring] Parameter Name and Description are now used properly in multipart form endpoints

* [kotlin-spring] Parameter Name and Description are now used properly in multipart form endpoints (generated docs and samples)

* [kotlin-spring] Parameter Name and Description are now used properly in multipart form endpoints (generated docs and samples)

---------

Co-authored-by: Kevin Hahn <kevin.hahn@partner.ionity.eu>
2024-03-09 17:43:27 +08:00
William Cheng
494fc7d182
[kotlin] Enum should match spec (#18062)
* [kotlin] Enum should match spec

Adjust the enum generation to match what is in the spec, rather than
camel-casing it.
Add tests for capitalization scenarios, including for kotlin keywords

* [kotlin] export docs generators for enum change

* [kotlin] export docs generators for enum change

* fix conflicts

---------

Co-authored-by: Tyler B. Thrailkill <tylerbthrailkill@gmail.com>
Co-authored-by: Jari Nystedt <jari.nystedt@tietoevry.com>
2024-03-09 17:42:33 +08:00
William Cheng
81e33ede6e update gitignore 2024-03-09 17:18:23 +08:00
julien Lengrand-Lambert
f1fcceb375
Major Jetbrains HTTP Client upgrade. Move to BETA (#15779)
* Add notes to requests for better readability

* Adds extra configs for jetbrains http client for testing

* Adding new sample data

* Changes

* Setting up test infrastructure

* Adds body to requests.

* Fixing some bugs in map traversal

It'd be much better to use a proper library for this though

* Adding secret file to gitignore

* Adds github spec, for complex example.

Add null check to avoid errors in example extraction

* Add support for custom variables in request body

* Add support for all basic Auth headers

* Not sure whaet happened with my api mustache file

* Add support for custom headers

* Fixes empty lines issue

* Adds support for Accept header

* Adding many tests, deleting experiment files

* Updates generator doc

* Completes README file with extra information

* Runs generate-samples and export docs

* Running sample generation

* Adding missing files to samples

* Removing forgotten stdout statements

* Ignore one test making the docker image generation fail
2024-03-09 16:56:26 +08:00
William Cheng
93d5fc646b update kotlin server tests 2024-03-09 16:51:52 +08:00
William Cheng
f61b7c2aa4 remove generator version sample test and config 2024-03-09 15:55:46 +08:00
Ross Bender
cf2435f335
Add support for controlling output of OpenAPI Generator version in generated files (#17952)
* add initial openapi config and java generated files

* add java implementation for adding generator version

* regenerate sample client files

* remove tabs

* only show generated version if build info exists

* set build info for batch generation

* update generator doc for new global flag

* use existing property for generator version

* update templates to include generator version

* update templates for better generator version syntax

* revert undesired changes

* regenerate samples for openapi client

* update templates to correct formatting/newlines

* correct description text and add to usage doc

* add generator cli option for all codegen types

* use more concise version info; update existing codegens to support new prop

* correct wrong prop reference

* add initial test coverage for new prop

* update last (scala) templates with new prop

* update samples after upstream merge

* use consistent version output

* use better sample project id/name

* revert using option for generator version in templates
2024-03-09 15:52:08 +08:00
andreas-wirth
c87ad561f1
inputSpec should not be mandatory when inputSpecRootDirectory is set (#18000)
* Fix inputSpec to not be mandatory in maven plugin

* Add unit tests
2024-03-09 15:34:13 +08:00
Tomohiko Ozawa
5d959eeae6
[typescript-fetch] Use == to check property is null or undefined (#17972)
* use `==` operator to check null or undefined

* update the sample
2024-03-09 15:28:36 +08:00
Prashant Pant
31cff44206
Autoset constants (Required fields having single valid enum value) C# Implementation of #16547 (#17954)
* Autoset constants (Required fields having single valid enum value) C# Implementation

* Update generichost/api.mustache & httpclient/api.mustache to autoset singleton enums values.
2024-03-09 15:07:26 +08:00
William Cheng
8dae7026b9 update samples 2024-03-09 14:41:22 +08:00
Oscar Reyes
7d9f9d7e81
[kotlin-spring] Fix cookie parameter code generation in API (#17959)
* + Cookie parameter generation fixed

* Added cookie parameter mustache template for generating cookie related code
* Adapted kotlin-spring api templates to include cookie parameters
* Added tests for evaluating cookie parameter code generation
* Added configuration sample for the new cookie use case

* - Unused fake cases removed

* Removed fake cases from openapi spec that were not related to cookie usage
* Cleaned sample files
2024-03-09 14:34:12 +08:00
Dan Booker
2653777ece
[C][Client] Fix default enum value being -1 (#18040) 2024-03-09 14:16:41 +08:00
Ira Chan
62d0e3abdb
[kotlin-spring] fix BigDecimal default value failed to compile (#17956) 2024-03-08 12:56:16 +00:00
Charles Treatman
34a386c5a3
[Go] Update generator docs to reflect supported features (#18044)
* [Go] Update generator docs to reflect supported features

* update feature support in code
2024-03-07 10:36:08 +08:00
Daniel Seiler
8eaeb2a1e7
fix(java): Use modelNameMappings if provided (#18025) 2024-03-06 13:57:03 +08:00
William Zhang
ae9084bfd6
fix: typo in docs (#18028) 2024-03-05 15:34:02 +08:00
martin-mfg
8f74d03290
fix KotlinServerCodegenTest and PostmanCollectionCodegenTest (#18019)
* fix KotlinServerCodegenTest and PostmanCollectionCodegenTest

* fix PostmanCollectionCodegen line endings
2024-03-04 13:08:33 +08:00
Aliaksei
92314232f8
[bugfix][18008]: fix getBeanValidation for scalar as ref (#18014) 2024-03-04 13:04:57 +08:00
gf-smtzgr
2d155105a4
Added jackson as supported serialization library for retrofit2 (#16853)
* added jackson as supported serialization library for retrofit2; resolves #7435

* Jackson support for retrofit2 library: Adjusted ApiClient to respectively include only gson or jackson specific conversion support depending on which serialization framework is selected

* Jackson support for retrofit2 library: Adjusted dependencies to respectively only include those necessary for gson or jackson depending on which serialization framework is selected

* reorder converter factory additions to have minimal change

* -: skipping gson-fire dependency when gson is not selected

* -: Jackson support for retrofit2 library: since useplayws implies jackson usage, only adding dependencies via useplayws that are specific to it

* Jackson support for retrofit2 library: fixed whitespace issue in generated api clients

* Jackson support for retrofit2 library: removed duplicated play26 dependency version property

* Jackson support for retrofit2 library: update to play26 example as that had gson dependencies but does not seem to use it and now fully relies on the jackson setting to control the respective dependencies; play version property and dependency changed place because the jackson dependencies are grouped together and the play26 ones are placed after

* Jackson support for retrofit2 library: adjusting dependencies also for gradle file

* -: moved jackson databind version out of jackson section since it is used independently of jackson support it seems

* -: update gradle dependencies to match changes in maven dependencies
2024-03-04 12:50:42 +08:00
Vladimir Svoboda
5d43c88540
[Java] [Spring] Fix reactive return type for list (#16884)
* Improve Add Async - Spring Cloud test

By testing the generated code.
This will be used to detect regressions.

* Spring: Fix reactive return type for list

Fix for #16883.

When *reactive* is enabled and response entities is *disabled*,
use `Flux<Item>` to stream the output instead of `Mono<Flux<Item>>`
With Spring Reactive, the expected return type for an array of item is
`Flux<Item>`.
Without this patch, the generated code is `Mono<Flux<Item>>`.

This is fixed by introducing specific handling for return types when
reactive is enabled.
In particular, "responseWrapper" is not used anymore in such situations.

* Fix methodBody

* Fix invalid test

* Fix SSE

* Fix methodBody when isArray and useResponseEntity

* methodBody: Flux.empty() instead of s -> {}
2024-03-02 21:19:34 +08:00
Alex B
009fda5e3d
[JAVA][apache-httpclient] Use `EntityUtils#toString instead of Scanner` (#17998)
``EntityUtils#toString`` automatically selects the correct encoding based on the received request.
Scanner currently uses the JVM default encoding, which doesn't always work.
2024-03-02 21:18:49 +08:00
Linh Tran Tuan
cdf8973999
[Rust] [Axum] Fix clippy warning: to_string_trait_impl (#17995)
* [Rust] [Axum] Fix clippy warning

* Using Display trait
2024-03-01 11:32:23 +08:00
Georgi Getsov
d3ebb0a52b
Fix 3.1 generation for composed schema's with type object (#18002) 2024-03-01 11:23:53 +08:00
William Cheng
d4e10508cd
[C#] fix anyof, oneof mixed primitive object parse error (#17986)
* Update csharp oneOf and anyOf mustache templates to accept primitive, object, and array types when deserializing

 Add bug openapi spec

Remove generated files

Add test endpoints

Generate base on spec

Remove issue spec as it is moved into sample test spec

Add back in number and int

Round trip anyOf/oneOf serialization tests

Generate classes with int/num types

Do through converter instead of object ctor

Regen models

Use convert methods

Regen models

Test data

Add enum

Remove enums

Regenned models

* update sha256

* use new spec

* skip tests

* update workflow

* fix

---------

Co-authored-by: Ruben Aguilar <ruben.aguilar@forgeglobal.com>
2024-02-29 16:05:08 +08:00
Kathryn DiPippo
c10c9146b9
[python] Update Markdown files for Models with fixed Python print() syntax (#17993)
* Update Markdown file with fixed Python example

* ./bin/generate-samples.sh ./bin/configs/*.yaml
2024-02-29 10:54:54 +08:00
William Cheng
d801bfdb84
remove poetry.lock (#17994) 2024-02-29 10:54:08 +08:00
William Cheng
8df0d98a44 fix broken link to spec 2024-02-29 10:42:59 +08:00
William Cheng
2d3670b96c update openapi normalizer doc 2024-02-29 10:34:21 +08:00
0xNF
275ed9296d
[dart2] [client] Bump test package version to >=1.21.6<1.22.0 to enable running tests on Dart3 projects. Also bumped minimum Dart version to 2.18 to accomodate this change. (#17563) (#17816) 2024-02-28 18:37:33 +08:00
Anakael
1fbf7220ec
[CS] refactor: update github actions (#17666)
* feat: DateOnly for client

* fix: generated doc for csharp

* doc: fix generators README for csharp

* add DateOnly option for aspnet

* refactor: update csharp docs

* refactor: fix typo

* finish

* finish

* finish

* regenerate

* rebuild and regenerate

* fix build error

* finish

* revert path

* regenerate

* remove exceed samples

* regenerate

* add DateOnly to nullable

* remove obsolete file from list

* update test files list

* remove obsolete sample build

* revert manual tests

* revert samples to master and regenerate

* remove new samples

* remove eol

* remove eol

* add new specs

* try fix test

* update tests

* update files

* remove eol

* revert

* remove eol

* regenerate

* add net6+ support to aspnetcore

* add jobs

* update actions

* regenerate

* delete exceed file

* remove rexeg
2024-02-28 15:56:48 +08:00
Artem Medvedev
6f01a7ad82
fix(rust): wrong path to model used as parameter of api (#17968)
* fix(rust): wrong path to mode used as parameter of api

Closes #16974

* fix: re-build samples
2024-02-28 14:56:03 +08:00
William Cheng
340a3eba54
update feign to newer version (#17983) 2024-02-28 14:11:42 +08:00
Ruokki
149246de31
fix(java): resolve feign ambiguity in ApiErrorDecoder fix(#17842) (#17843) 2024-02-28 12:06:57 +08:00
Andre Wachsmuth
8ca914d64f
[okhttp-gson] Make initializer block for GSON builder static #16860 (#16892)
* [okhttp-gson] Make initializer block for GSON builder static #16860

Make initializer block for GSON builder static, see #16860

* update sapmles

---------

Co-authored-by: Andre Wachsmuth <awa@xima.de>
2024-02-28 12:04:44 +08:00
William Cheng
df8851d627
update orjson to newer version (#17982) 2024-02-28 11:45:26 +08:00
Artem Medvedev
4b04e17751
feat(rust): support ability to disable boxed models in client (#17931)
* feat(client): support ability to disable boxed models

Add new additional property `avoidBoxedModels` which can be configured to avoid `Box<..>` of models.

It's very nice to have such config, because it doesn't make a lot of sense for really simple models.

* test: rollback config of existed test
2024-02-28 11:22:18 +08:00
Stefan Koppier
2a4e60ccbb
[Kotlin] Fix default values (#17937)
* Fixed invalid extraction of response body in kotlin-client jvm-spring-*

* Generated echo-api for kotlin-jvm-spring-3-restclient

* Specific echo-api for Kotlin without allOf/anyOf

* Specific echo-api for Kotlin without allOf/anyOf

* Generated all samples

* Added kotlin-jvm-spring-3-restclient sample to workflow

* Fixed syntax problem

* [kotlin] Fixed multiple problems with default values

* [kotlin] Removed old commented code

* [kotlin] Generated new samples after merge with master

* [kotlin] ensure-up-to-date
2024-02-28 11:20:27 +08:00
William Cheng
0b02734b93
better handling of allOf in request/response (#17964) 2024-02-28 11:19:11 +08:00
Tomohiko Ozawa
a8efb8eea8
Add hasReadOnly property to CodegenModel (#17942)
* add hasReadOnly property to CodegenModel

* add for CodegenModel subclasses
2024-02-26 16:27:33 +08:00
William Cheng
51ef501c02
fix npe by prefixItems in normalizer 3.1 spec (#17955) 2024-02-26 15:24:55 +08:00
Ross Bender
22c52d358c
Update Java templates to correctly close parenthesis (#17961)
* update java templates to correctly close parenthesis

* add closing parenthesis to missing java template
2024-02-26 15:24:31 +08:00
Chris Miller
4ba187a1a4
Provide rust-server swagger/multipart_form (#17950)
* grant rust server swagger form multipart

* run exporters
2024-02-25 17:18:15 +08:00
William Cheng
6e113842cf
[resttemplate] Update springweb to newer version (#17953)
* update springweb to newer version

* update
2024-02-24 23:43:15 +08:00
Artem Medvedev
518b29d089
fix(rust): oneOf generation for client (#17915)
* fix(rust): discriminator mapping to serde rename

Discriminator mapping has been ignored in some cases.
Even existing samples had wrong definition in some cases

This PR addresses this

* fix(rust): `oneOf` generation for client

Solves #17869 and #17896 and also includes unmerged $17898

Unfortunately it affects quite a lot of code, but we can see that only client-side models were affected by re-generation.
I tried to split this PR to several, but they're really coupled and hard to create a chain of PRs.

* fix: indentation in `impl Default`

* missing fixes

* fix: correct typeDeclaration with unaliased schema

* style: improve indentation for models

* fix: user toModelName for aliases of oneOf

* refactor: unify `getTypeDeclaration` for rust

* cover the case when `mapping` has the same `ref` for different mapping names

* test: add test for previous change

* style: remove extra qualified path to models

* add some comments

* fix(build): use method of `List` instead of specific for `LinkedList`
2024-02-24 23:41:30 +08:00