13645 Commits

Author SHA1 Message Date
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
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
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
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
Amin Yahyaabadi
6a3d406690
[cpp-restsdk] add support for oneOf via std::variant (#18474)
* [cpp-restsdk] add support for oneOf via std::variant

* [cpp-restsdk] detect the latest supported C++ standard in CMake

* [cpp-restsdk] add test with oneOf support for cpprest

* [cpp-restsdk] avoid warnings because of implicit this capture

* [cpp-restsdk] avoid deprecated CMake version warnings

* [cpp-restsdk] build the test into the build directory - parallel build

* [cpprest-sdk] use absolute source path for cmake + debug build

* fix: remove inheritance due to template not overriding

---------

Co-authored-by: William Cheng <wing328hk@gmail.com>
2024-06-01 17:48:02 +08:00
Marc Le Bihan
84ce2bfd14
[BUG][C++][cpp-pistache-server] An api receiving a std::optional parameter generates a org::openapitools::server::model::std::optional<...> that doesn't compile #18792 (#18793)
Solving this issue has for goal to reduce the amount of work required to resolve the [[C++] Error making the cpprestsdk generated files](https://github.com/OpenAPITools/openapi-generator/issues/6726)
   and to put the `cpp-pistache-server` generator a the "same compilation problems" level than the `cpp-restsdk` generator in font of the #6726.
2024-06-01 17:04:46 +08:00
Lars van Leeuwen
8783ad8a18
[Python] List enum members in docs (#18804)
* List enum values in docs

* Remove newline

* Remove another newline

* Generate samples
2024-06-01 17:00:11 +08:00
Philzen
e2258fb790
[kotlin-spring] Fix gradle build failure when generated with interfaceOnly=true (#18809)
* Fix kotlin-spring not building when `interfaceOnly=true`

Fixes #18803

* Regenerate fixed kotlin-spring samples

* Include sample kotlin-springboot-request-cookie in CI build check

* Apply suggestions from code review

Co-authored-by: Stefan Koppier <stefan.koppier@outlook.com>

---------

Co-authored-by: Stefan Koppier <stefan.koppier@outlook.com>
2024-06-01 16:55:25 +08:00
Philzen
66126a8ae4
Remove unused test dependencies org.reflections & maven-rewrite (#18798)
* Specify exact relative path to parent pom.xml

* Remove org.reflections from the test stack

* Remove unused parameter

* Remove unused method

* Fix raw use of parameterized variable warning

* Use Files.readString instead of converting raw bytes

* Add test coverage for TestUtils.validatePomXmlFiles(List)

* Reimplement TestUtils.validatePomXmlFiles(List) with Jackson XML mapper

* Remove maven-rewrite dependency
2024-06-01 16:42:26 +08:00
Philzen
6a6f39d6f4
Change/reintroduce junit5 (#18790)
* Revert "Revert back to junit4 (#18786)"

This reverts commit 2471ba2d2e96261941d21eb10648f3d70e969423.

* Make junit engine execute TestNG test cases

* Fix failing test and use tempDir's for test code generation

* Make test fail with helpful info in case generator throws exception

* Suppress error output from TestUtils

* Remove transitive junit4 dependency

* Sync guava-testlib version with guava version

* Add hint regarding alternative for guava-testlib's FakeTicker
2024-06-01 16:40:40 +08:00
William Cheng
353320cb04
[kotlin] better oneOf, anyOf support (#18382)
* add validteJsonElement

* add oneOf support

* various fixes, add tests

* minor fixes

* minor fixes

* update data class

* remove comments

* array support, add test

* update api client constructor

* add anyOf support

* add new files

* fix merge

* update

* update

* update

* update
2024-05-31 12:22:27 +08:00
devhl-labs
b19fc67a53
added framework support (#18776) 2024-05-29 20:58:52 +08:00
William Cheng
2471ba2d2e
Revert back to junit4 (#18786)
* revert junit5 upgrade

* revert upgrade to junit5

* fix kotlin-wiremock template folder

* fix/comment tests

* update
2024-05-29 18:58:44 +08:00
HentaiHeavenVR
edaace9323
Fix TS7053 errors in generated instanceOf* methods (#18770)
* Fix bug referenced in #18746 , introduced in #18418

* Generate examples
2024-05-28 14:18:39 +02:00
Oliver Stevns Larsen
48919ba3d2
Add model name mapping to swift5 client generator (#18780) 2024-05-28 16:48:53 +08:00
devhl-labs
56f301632e
removed warnings (#18775) 2024-05-28 16:41:30 +08:00
Brais Gabín
c1d0e7c24a
Support nonPublicApi on jvm-retrofit2 (#18769) 2024-05-27 12:22:26 +01:00
Marcel Huber
74a9509e0c
[Java][native] Fix: DateTime in deepObjects is no longer serialized correctly [fix #18742] (#18743)
* fix serialization of OffsetDateTime

* update samples

* wrap import
2024-05-27 16:32:32 +08:00