13408 Commits

Author SHA1 Message Date
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
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
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
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
Miklós Márton
81b96fd606
Prevent enum item names being reserved keywords (#17804) 2024-02-23 16:02:22 +08:00
Miklós Márton
9c72b25bf4
[cpp-qt-client]Allow nullable parameters (#17805)
* [cpp-qt-client]Allow nullable parameters

Fixes #17756

* Update samples
2024-02-23 16:01:13 +08:00
Miklós Márton
c4f90d058b
Add NULL as reserved keyword cpp (#17803)
* [cpp]Do not lowercase the reserved keywords for C++

(Will be necessary for adding NULL as a reserved keyword)

* [cpp]Add NULL as reserved keyword
2024-02-23 16:00:23 +08:00
Jean-François Côté
a6771adf53
Add nullable to model fields (#17934) 2024-02-23 15:55:19 +08:00
Kira Resari
fe919b2203
Updated jQuery to latest version (#17930)
The old version (3.1.0) had known security issues
2024-02-23 00:34:04 +08:00
Tyler Mairose
8d73c82417
Add additional mustache lambda for kebab case (#17858)
* Add new kebabcase mustache lambda

* Add tests for new kebabcase lambda

* Update toLowerCase to use Locale.ROOT
2024-02-23 00:30:01 +08:00
William Cheng
f191904297
Add auto-generated test files for kotlin client (#17916)
* add auto-generated test files for kotlin client

* undo changes to doc

* add auto-generated model test files in kotlin clients

* update tests
2024-02-21 18:29:23 +08:00
Bastien Jansen
3af7363e76
Fix ClassCastException in OpenAPINormalizer on composed schemas in 3.1 (#17912) 2024-02-21 15:22:46 +08:00
mikkka
6c86c2d3cf
Remove postprocess printing (#17880) 2024-02-20 18:19:38 +08:00
ふぁ
c99a5cfeb6
[python] update model_config from dict to ConfigDict (#17900)
* [python] rewrite dict as ConfigDict

* [python] update sample

* [python] undo unwanted changes

* [python] update sample
2024-02-20 17:53:13 +08:00
Mehmet Fatih Ercik
48565ae5be
Generate API files as interfaces for go-gin server (#17784)
* add feature to generate only interface files

* generate sample

* add workflow file foe go gin service

* add workflow file foe go gin service

* add workflow file foe go gin service

* update samples
2024-02-20 15:37:44 +08:00
Stefan
95377cded4
Fix typos 'the the'. (#17897) 2024-02-20 13:00:55 +08:00
William Cheng
ad84355288
fix: Runtime error that occurs when Retrofit2 query parameter is an enum list (#17901)
* fix: Runtime error occurs when Retrofit2 query parameter is an enum list (9481)

* chore: Removes EOL

* remove EOL

---------

Co-authored-by: Ivan Vasheka <87310984+ivanvasheka-intellias@users.noreply.github.com>
2024-02-20 12:56:28 +08:00
ふぁ
ad08581f16
[python] Fix Circular imports on inherited discriminators. (#17886)
* [python] add inheritance discriminators test #16808

* [python] update samples

* [python] fix assert in test

* [python] fix inheritance discriminators circular import

* [python] update samples

* [python] undo type changes related to discriminator

* [python] remove extraneous processing

* [python-pydantic-v1] fix inheritance discriminators circular import

* [python] remove type ignore comment

* [python] update samples

* [python] fix avoid the empty line break

* [python] update samples
2024-02-20 12:17:32 +08:00
Nathan Shaaban
76d743b63b
fix(rust): simplify new function optional logic (#17865)
* fix(rust): simplify None logic

Used to be a code path (where isFreeFormObject and something else) where we could end up with two `: None` `: None`'s

This does add the None for the !required && !isArray && !isMap && !isNullable case (where nothing would have been printed before.

Above for the type on the individual vars inside the struct definition the logic is simply if not required then it's optional.
If it's optional we want a None when creating a new struct.

* ci: add tests for failure
2024-02-19 22:26:29 +08:00
Noor Dawod
e025ef947a
Use exists() to check for properties (#17798)
* Use `exists()` to check for existing properties.

* Generate Petstore code.

* Fix use of `null` instead of `undefined`.

* Enhance function code.

* Regenerate Petstore code.

* Use `exists()` in generated API clients.

* Use `exists()` in generated API clients.

* Refer to properties differently.
2024-02-19 11:12:46 +08:00
Felix König
6350d1d191
make title available to templates for ref properties (#17881)
Even though `title` is technically for the title of the API itself,
it's possible to set it for properties as well.
Right now, the `title` property is available in templates for regular properties,
but for ref-properties it gets lost right here.
This seemed rather surprising to me, so I think it's better to fix.
2024-02-19 11:06:26 +08:00
William Cheng
7d539bcb78
Remove deprecated library (jvm-okhttp3) in kotlin client generator (#17884)
* remove deprecated library in kotlin client generator

* update workflow
2024-02-18 17:16:23 +08:00
William Cheng
436a3e0744
fix multi line description in allOf (#17879) 2024-02-16 15:26:15 +08:00
William Cheng
5a0f6b8eb2
use unescaped media type (#17878) 2024-02-16 10:55:01 +08:00
William Cheng
809c90aa24
Use unescaped media type in java native client (#17872)
* use unescaped media type in java native client

* add tests
2024-02-16 10:17:08 +08:00
Dipesh Chauhan (Twilio Work Account)
cedf170454
Adds Collapse Spec Options to Maven Plugin (#17714)
* Adds Collapse Spec Optionss to Maven Plugin

* Adds a collapsedSpec option to the maven plugin that produces a single-file representation of the spec in the output directory.
* Adds a includeCollapsedSpecInArtifacts option to the maven plugin that adds the collapsed spec file to the maven artifacts.

* Address Feedback Round 1

* Adds the new options to the maven plugin README.md.

* Fixes Unit Tests

* Corrects the casing of one of the schema files that was causing the tests to fail.
2024-02-15 17:02:25 +08:00