20229 Commits

Author SHA1 Message Date
Tobias Zink
01fec76ab1
feat(typescript-angular): add support for Angular V18 (#18916)
* feat/typescript-angular/add-v17-support

* HTTP_TRANSFER_CACHE_IN_OPTIONS for angular 17 as well

* run build scripts again because of angular 17 HTTP_TRANSFER_CACHE_IN_OPTIONS
2024-06-14 15:14:28 +02:00
Daniel Imber
f36590051f
[Enhancement] [Gradle Plugin] Allow templates from classpath (#14909)
* [Enhancement] [Gradle Plugin] Allow templates from classpath

* Adding missing argument binding.
2024-06-13 21:20:41 +08:00
Jean-Donald Roselin
ea0190324e
fixes #18853: provide support of array attributes in multipart/form-data request for axios and fetch typescript clients (#18855) 2024-06-13 14:49:55 +02:00
Max Lapshin
788fd6f725
Golang client can use pattern-based discriminator between oneOf (#18760)
* Enable reading schemas with pattern-based discriminator between oneOf for golang client #5311

* Codegen after changing to golang templates #5311
2024-06-13 16:31:36 +08:00
William Cheng
26a164e57f
[Java][Spring] enumUnknownDefaultCase true now returns correctly in fromValue (#18914)
* enumUnknownDefaultCase true added for Spring

* Resource added for test

* Updated tests

---------

Co-authored-by: Dean <dean.kane@opencastsoftware.com>
2024-06-13 16:23:56 +08:00
William Cheng
1765efc1ff
[Golang] Introduce 'lambda.type-to-name' in models_anyof.mustache (#18912)
* Update model_anyof.mustache

* add tests for anyof in go client

---------

Co-authored-by: Martin Lakov <85170913+martinlakov@users.noreply.github.com>
2024-06-13 16:01:58 +08:00
devhl-labs
3abe2512c5
[csharp][generichost] Add options for model parameter sorting (#18886)
* fixed parameter ordering

* placed changes behind a switch

* bug fix

* minor revert

* use lombok.Setter

* addressed comment

* lint

* minor refactor

* massively improve csharp templates code

improved apiclient.mustache to keep it dry, sharing a single exec with Action<> delegate.
improved api.mustache to keep it dry, used chain constructors, kept RequestOptions in a single method, set configuration with alias directive
moved fqn types to using directive for cleaner code
removed 'this' from variables/props that are redundant
fix CSharpClientDeepObjectTest code is now DRY so count must only be one

* updated test samples csharp

* removed async from ExecAsync (not needed here anymore)

* updated samples csharp

* nullable property not working on models due to not being defined in yaml schema

updated samples

* added options

* rebuild tests

* revert unintended commits

* rebuild samples

* rebuild samples

* rererebuild samples

* fix manual tests

---------

Co-authored-by: filipe <filipe_ds@live.com.pt>
2024-06-13 00:25:29 +08:00
William Cheng
fc0105e214
[Java][jaxrs-spec] enumUnknownDefaultCase true now returns correctly in fromValue (#18910)
* enumUnknownDefaultCase true added for Jaxrs-spec

* Updated tests

---------

Co-authored-by: Dean <dean.kane@opencastsoftware.com>
2024-06-12 23:43:43 +08:00
William Cheng
ef7654958e
Marketplace software zapier request middleware (#18907)
* feat: add middleware for requests

* update samples

---------

Co-authored-by: Stephen (Alex) Wallen <wallenstephen@outlook.com>
2024-06-12 16:32:08 +08:00
Dennis Melzer
7084e87140
Remove bean validation for uuid (#18900)
* Remove bean validation for uuid

* Add maxLenght to test the uuid validation
2024-06-12 11:53:14 +08:00
William Cheng
37ea82b2c7
Fix list in kotlin client templates (#18891)
* fix list in kotlin client templates

* remove java syntax in kotlin template

* fix array check
2024-06-12 11:42:44 +08:00
Filipe Silva
e8bbfe23b4
[csharp] fix system.web warning and removed unneeded fqn (#18902)
* Refactor validatable.mustache moved fqn types to using directive for cleaner code

Fix netcore_project.mustache conditional "System.Web", more details:
https://learn.microsoft.com/en-us/aspnet/core/migration/inc/adapters?view=aspnetcore-7.0

* updated csharp samples
2024-06-11 19:53:39 +08:00
Filipe Silva
7f34e11a7f
[csharp] Refactor anyOf model template (#18901)
* Refactor AnyOf model removed "this."

* Updated csharp samples
2024-06-11 18:43:27 +08:00
Klaus Mueller
8357cc313b
muenchen deeplink (#18894) 2024-06-10 22:46:06 +08:00
Nate Todd
00f2cd573c
[Elixir] Fix generation issues and compilation warnings in Elixir generator (#18788)
* Format Elixir generator

* Update Elixir reserved words

* Update Elixir generator docs

* Improve typespec generation to avoid double ".t" issues

* Fix compilation warnings by changing reserved words to use suffix instead of underscore prefix

* Include additional reserved words and handle words with leading underscores

* Update samples and docs

* Uses dataType instead of baseType for non-struct types

* Generate elixir samples

* Fixes issue with AnyType in a list

* Generate elixir samples

* Removes normalizeTypeName for arrays as they correct by getTypeDeclaration

* CodeStyle

---------

Co-authored-by: Michael Ramstein <michael@ramste.in>
2024-06-10 14:06:16 +02:00
Jason Schroeder
80bb3dde0b
build: use runtime scope for slf4j-simple log sink (#18881)
Avoid leaking this as a dependency to openapi-generator consumers.
2024-06-10 17:45:51 +08:00
Pierre B
f517bf7b98
[typescript-fetch] - Fix Nullable Types (#18887)
* fix nullable types

* fix samples

* fix samples

* fix samples

* fix samples

---------

Co-authored-by: Pierre Berube <pberube@blackpointcyber.com>
2024-06-10 11:35:20 +02:00
devhl-labs
2851838f7f
[csharp][generichost] Fixed parameter ordering (#18823)
* fixed parameter ordering

* placed changes behind a switch

* bug fix

* minor revert

* use lombok.Setter

* addressed comment

* lint

* minor refactor
2024-06-10 14:46:55 +08:00
William Cheng
0cc9644120
Add enum default value tests to python clients (#18883)
* add enum default value tests to python clients

* add new files
2024-06-08 17:34:57 +08:00
Mike Welsh
a5a99585ef
[Python] Add enum support when building default values for model properties when using $ref (#18796)
* Add enum support when building default values for model properties

* Update enum handling for Python for enum references

* Remove unused method

* Update mustaches for FastAPI, Pydantic, and Python for default values

* Address PR feedback and rebase main

* Remove old 2_0 samples
2024-06-08 16:18:03 +08:00
Philzen
5adf1ff522
Avoid UnsupportedEncodingException by design, replacing magic string "UTF-8" with StandardCharsets.UTF_8 (#18851)
* Replace magic string "UTF-8" with StandardCharsets.UTF_8

This avoids an UnsupportedEncodingException by design.

* Remove unused UnsupportedCharsetException import
2024-06-08 15:23:24 +08:00
ふぁ
dc81339ef1
[typescript-fetch] fix #18876 Type error in oneOf when legacyDiscriminatorBehavior is false (#18877) 2024-06-07 10:44:39 +02:00
William Cheng
4be5971e0f
[cpp-restsdk] add support for oneOf via std::variant (#18821)
* Revert "Revert "[cpp-restsdk] add support for oneOf via std::variant (#18474)…"

This reverts commit 8d398719c99fbcbfa6471e0bb938f9d384454f8f.

* update samples

* update pom

* set cxx 17

* Revert "set cxx 17"

This reverts commit 0cec8f725dd8017217b75e827a54da5440dd55d1.

* install clang 6.0

* Update CI/circle_parallel.sh

Co-authored-by: Amin Yahyaabadi <aminyahyaabadi74@gmail.com>

* fix include

---------

Co-authored-by: Amin Yahyaabadi <aminyahyaabadi74@gmail.com>
2024-06-07 12:24:39 +08:00
Nikita Shmakov
3aba42733b
clone Schema using AnnotationUtils.clone with WA (to clone schemas wi… (#18867)
* clone Schema using AnnotationUtils.clone with WA (to clone schemas with example field set)

* changes after scripts run
2024-06-06 20:55:51 +08:00
ふぁ
6ae8a8f4c7
[python] fix deserialize on basic str fails (#18800)
* [python] fix #18774 Deserialize on basic str fails

* [python] update sample

* [python] update test

* [python] remove type

* [python] fix test

* [python] add top level type test

* Update deserialize content_type parameter and quote

* [python] restore echo_api test

* [python] add allow empty json in Response
2024-06-06 16:15:50 +08:00
Val Packett
d1254ccfda
[dart] Apply var/param/model name mappings, handle single _ (#18663) (#18860)
Fixes #18663
2024-06-06 13:22:09 +08:00
Humle-T
36ade65993
[kotlin-spring] Fix two missing ) in kotlin-spring/pathParams.mustache (#18854) (#18861) 2024-06-05 15:51:09 +01:00
Val Packett
0621d3462d
[erlang-client] Apply var/param name mappings (#18662) (#18859)
Fixes #18662
2024-06-05 17:45:18 +08:00
William Cheng
f97706d29b update php slim samples 2024-06-05 17:44:27 +08:00
Tommy Seus
b7a4a47270
[php-slim4-server] fix php syntax error in RegisterRoutes class (missing semicolon) (#18863)
Co-authored-by: Tommy Seus <tommy.seus@tmy.email>
2024-06-05 17:37:47 +08:00
Philzen
880df7a7a4
[maven-plugin] Generate hash from actual resolved spec rather than inputSpec file (#18849)
* Ensure temp directories are deleted after test execution

* Implement test that external $ref changes are reflected in checksum

* Generate hash checksum from actual resolved spec instead of inputSpec file

Otherwise regeneration will not happen when skipIfSpecIsUnchanged is enabled,
although formally the spec content has changed.

Fixes #4512 and #16489

* Use try-with-resources to ensure stream is closed properly on exit

* Fix deprecation warning on SimpleLocalRepositoryManagerFactory no-arg constructor

* Apply minor code cleanup

- use fluent setters where possible
- remove undocumented @throws from JavaDoc
- use List.of() instead of Arrays.asList() for single-element-collection
  (more memory efficient)
- fix some grammar issues in comments and JavaDoc

* Use non-blocking java.nio API for file existence checks
2024-06-05 17:19:22 +08:00
Philzen
446e168f43
Remove deprecated MockDefaultGenerator (#18857)
* Make DryRunStatus path field final

* Add templateData capture functionality to DryRunTemplateManager

* Replace MockDefaultGenerator with DryRunTemplateManager captures

* Remove MockDefaultGenerator
2024-06-05 17:10:17 +08:00
Val Packett
2fcf825e19
[clojure] Apply model/param/var name mappings (#18665) (#18858)
Fixes #18665
2024-06-05 16:58:13 +08:00
Jean-Donald Roselin
17a08d2646
fixes #18489: provide support of array attributes in multipart/form-data request for angular typescript client (#18490) 2024-06-05 09:37:00 +02:00
Philzen
86f23e13e5
[javascript-closure-angular] Change metadata to reflect beta status and non-existing xml capability in docs (#18834)
* Fix generator metadata to reflect beta status and non-existing xml capability

* Regenerate doc page

* Regenerate docs/generators.md
2024-06-05 10:57:22 +08:00
Philzen
45bc9c9e2f
[php-laravel] Fix file database/migrations/2019_08_19_000000 being written twice (#18832)
* Implement dedicated transitional test for #18831 bugfix

* Remove duplicated database migration file from supportingFiles collection

* Activate AllGeneratorsTest.noDuplicateSupportingFiles

* Drop transitional test again

* Simplify truthy assertions
2024-06-05 04:43:52 +02:00
Philzen
aef4d75fd5
Refactoring: Use lombok for simple getters & setters (#18559)
* Add missing @Override annotation

* Fix JavaDoc unresolved symbol

* Fix JavaDoc method link

* Remove unnecessary semicolon

* Remove method identical to super implementations

* Replace repetitive getter code with Lombok @Getter

See https://projectlombok.org/features/GetterSetter

* Replace repetitive setter code with Lombok @Setter

See https://projectlombok.org/features/GetterSetter

* Generate no-args constructor with Lombok

* Generate all-args constructor with Lombok

* Fix parameter naming

* Replace stubbed abstract class implementations with Mockito mocks

* Remove unused import(s)
2024-06-05 04:43:05 +02:00
julien Lengrand-Lambert
42c78403cb
JetBrains HTTP Client - Adds support for query and header params and env file (#18844)
* Adds basic support for query params.

* Need to parameterize them
* Need to add tests
* Need to add option to skip, maybe
* Need to add support for header params too

* Parameterizes query param values

* Need to add tests
* Need to add option to skip, maybe
* Need to add support for header params too

* Remove extra empty line

* Adds support for header params

* Also fixes extra end of line bug.

* Fixing failing test

* Adding tests for query params

* Adding tests for header params

* Adding basic support for env file

* Add support for env file for path variables and custom header variables

* TODO : Add tests

* Adding tests for env generation

* Adding generated test files

* Fix namefile
2024-06-05 10:30:25 +08:00
Philzen
1c787babad
[JAVA] Fix jackson (de)serializer annotation breaking libs using gson when bigDecimalAsString=true (#18835)
* Implement regression test for bigDecimalAsString annotations

* Ensure @JsonSerialize and @JsonDeserialize is only generated when Jackson enabled

Fixes #6496
2024-06-04 13:26:07 +08:00
Philzen
a574d9e09c
Remove unused retrofit1 mustache templates (#18833)
These are not used by any generator implementation, hence there's no
point in bundling them into every release we're shipping.

In case someday it is decided that a retrofit v1 generator will be needed
again, this commit can simply be reverted.
2024-06-04 12:53:19 +08:00
Philzen
35a882076f
[python-fastapi] Fix CLI crash when calling config-help & update docs (#18816)
* Implement test for uniqueness of CliOptions across all generators

* Refactor existing test to use @DataProvider and fluent assertion

* Remove extraneous cliOption definition for disallowAdditionalPropertiesIfNotPresent

This is already defined (matching exactly in all aspects) in DefaultCodegen.

Resolves #18810

* Avoid variable declaration & assignment when only used once

* Add additional uniqueness tests for all DefaultCodegen List<> members

Test uniqueness for lists of:
- supportingFiles
- supportedLibraries
- supportedVendorExtensions

* Disable AllGeneratorsTest.noDuplicateSupportingFiles for the time being

Re-enable when #18831 is fixed

* Generate updated python-fastapi docs
2024-06-04 12:40:29 +08:00
devhl-labs
91a1931bd9
[csharp][generichost] Add support for primitive composed (#18825)
* add support for primitive composed

* build samples again

* rebuild tests

* addressed comment
2024-06-04 12:38:53 +08:00
Philzen
ed2aad6756
[JAVA: okhttp-gson, rest-assured, retrofit2] Don't generate Jackson import when serialization library is GSON (#18811)
* Partially revert "replace deprecated ISO8601Utils with StdDateFormat (#17052)"

This partially reverts commit 76560e34c9aacd9d7593ac45bd204e2edf38abd9, namely anything
related to generators and samples using GSON instead of Jackson.

Changes to Jackson-only generation and generator-online regarding RFC3339DateFormat
are not being reverted.

* Test for default serialization library fallback

* Convert repetitive tests to parameterized test

* Add regression test for #18515

* [FEIGN] Only include <jackson-databind-version> property in pom.xml when required

* [RETROFIT2] Only include jackson-databind in gradle file when actually required

* [FEIGN] Don't include jackson dep's in sbt file when GSON is selected

* [FEIGN] Don't include jackson dep's in gradle file when GSON is selected

* DRY refactor JavaClientCodegen test code, increase readability

- use fluent assertions
- use helper method newTempFolder()
- use Java 9 static factory methods for maps
- don't declare variables that are only used once
- group declarations and usages
- use non-blocking java.nio.file API wherever possible

* Regenerate samples
2024-06-02 21:42:55 +08:00
Philzen
051abb82dc
Bugfix/activate helidon versionutil tests (#18815)
* Reactivate tests

Contrary to Junit5, classes containing TestNG tests need to have
public visibility, otherwise the tests will not be discovered and run.

* Reformat tests for readability

* Rewrite tests using fluent assertions
2024-06-02 21:42:02 +08:00
William Cheng
713aa92b22
add tests for 18772 (#18828) 2024-06-02 18:10:46 +08:00
Gerwin Jansen
c08afa37e4
[BUG][Csharp][GenericHost] OpenApi 3.1: Model property of type map/additionalproperties gets generated as object (#18772)
* Fix the bug + add test case

* Add sample output

* Update version number in new sample output

---------

Co-authored-by: Gerwin Jansen <gerwinjansen@users.noreply.github.com>
2024-06-02 17:31:53 +08:00
Philzen
4ae4bc5f5d
[kotlin-spring] Generated code using Schema with discriminator mapping will not compile (#18826)
* Update springdoc-openapi-starter-* to v2.2.0 in gradle build

This brings it in sync with the maven pom. Brings swagger-annotations
version 2.2.15 as transitive dependency, implements the @Schema annotation
property `requiredMode`.

Hence fixes #14949

* Update kotlin-server samples
2024-06-02 15:18:38 +08:00
Philzen
2b9949a66b
Bump Jackson to latest v2.17.1 and sync in templates (#18799)
* Drop separate version property

Not required as all Jackson packages usually tether on a version bump.

* Update Jackson to v2.17.1

* Sync Jackson version used by Spring Boot with project version

* Sync jackson update to v2.17.1 with generator templates

* Regenerate samples with updated versions

* Adjust test to current exception msg behavior

* Add dependency mgmt to ensure matching version for transitive dependencies

* Update library descriptions with correct Jackson version number

* Update library descriptions with correct GSON and JSONB versions

* Update retrofit library description with correct version number

* Update retrofit description to include Jackson as an option

This should have been done as part of in #16853.

* Update remaining libary version descriptions with correct versions

* Generate updated doc
2024-06-02 15:17:38 +08:00
devhl-labs
f540e003f5
fixed workflow (#18824) 2024-06-02 15:07:57 +08:00
William Cheng
8d398719c9
Revert "[cpp-restsdk] add support for oneOf via std::variant (#18474)" (#18820)
This reverts commit 6a3d406690a732486af8f32a63c9dbdcdb47e8c5.
2024-06-01 19:04:03 +08:00