1997 Commits

Author SHA1 Message Date
Joscha Feth
7510e6bbf8
[Typescript] Generate oneOf schemas as type unions (#19494)
* Add oneOf model for Typescript generator

* Update import procces: For oneOfs only import $refs within the oneOf

* Remove new line after description

* Update samples

* Typescript: Update model.mustache

* Typescript: Remove emun from oneOf models

* Update samples

* Typescript oneOf: add discriminator and update deserialize procces

* Typescript: update tests

* Typescript oneOf: move type mapping to models

* Typescript: Update samples

* Typescript: Update type of mappig

* Typescript: Update type of mappig

* Typescript oneOf: update deserializing logic

* Typescript: Update samples

* Revert "[typescript] fix: `enum` can not receive stringified class name (#19481)"

This reverts commit 4238f17322bdb0e968f94b621669b737395a3dc9.

* [typescript] chore: update fixtures

---------

Co-authored-by: ksvirkou-hubspot <ksvirkou@hubspot.com>
2024-08-30 16:20:18 +02:00
Joscha Feth
1518237c25
[typescript] fix: deno: type exports for isolatedModules (#19484) 2024-08-29 13:56:02 +02:00
Joscha Feth
4238f17322
[typescript] fix: enum can not receive stringified class name (#19481)
* fix: `enum` can not receive stringified class name

* chore: update generated code samples
2024-08-29 13:54:57 +02:00
Eric
dfc381c22f
[Java] Add a new additional property to configure Jackson's failOnUnknownProperties (#19271)
* [Java] Add a new additional property to configure Jackson's `failOnUnknownProperties`

* Move `FAIL_ON_UNKNOWN_PROPERTIES` property to JavaClientCodegen

* Template `FAIL_ON_UNKNOWN_PROPERTIES` for other libraries beside retrofit2

* Default `failOnUnknownProperties` to false for all Java Client libraries

* Fix integration tests

Add the `failOnUnknownProperties: true` additional properties to generate the
expected mapper
2024-08-29 13:25:25 +08:00
Matthias Schwarz
4330b2f46d
[typescript-fetch] Add option to generate validation attributes of model properties (#19448) 2024-08-27 14:13:59 +02:00
aakash-dev-maersk
f13a11b53c
Add support for global token based auth for k6 script generation (#19348)
* Add global token based auth support (basic, bearer) for k6

* config files and generated code files after the changes

* Handle empty or null auth at path level

* files changed after update with master and run build
2024-08-25 23:40:38 +08:00
Martin Boos
ae069e6840
[Python] Update python-pydantic-v1 generator to respect the --git-host argument (#19404)
* Update pyproject.mustache

chore(pyproject): replace static `github.com` with variable `{{{gitHost}}}`

* chore: follow contribution guidelines
2024-08-22 15:52:36 +08:00
Tim Quinn
cd02426648
Suppress Pattern annotation on property of type byte array (#19346)
* Suppress Pattern annotation on property of type byte array

Signed-off-by: Tim Quinn <tim.quinn@oracle.com>

* Straggler files from generated samples

* Add new format test to workflows

---------

Signed-off-by: Tim Quinn <tim.quinn@oracle.com>
2024-08-15 17:09:44 +08:00
martin-mfg
05c10934ce
docs: update versions, fix links, remove broken camel.xml, update download counts (#19356)
* manually update version in documentation, remove camel.xml

... because it has the wrong generator version, it has the wrong generator name (should be "java-camel"), the generated code doesn't compile - and then I didn't check further

* improve automatic version updating

* fix one more Readme link

* update docker stats again
2024-08-15 17:02:34 +08:00
devhl-labs
5166765724
changed default sorting of samples (#19335) 2024-08-12 15:04:50 +08:00
Stefan Koppier
aea536027c
[bugfix][kotlin-wiremock] fix problems with range responses (#19309)
* [kotlin] Target correct library in jvm-spring-webclient sample

* [kotlin] Fixed warning in jvm-spring-restclient

* [kotlin-wiremock] fixed issue 7193

* [kotlin-wiremock] fixed wrong implementation of fromResponse

* [kotlin-wiremock] forbidden API

* [kotlin-wiremock] fixed wrong workflow trigger
2024-08-07 18:04:05 +08:00
William Cheng
eff3e6df53
[cpp-qt] Add option for download progress, add test (#19297)
* add option for download progress, add test

* add cmake file

* remove test

* update
2024-08-05 16:06:36 +08:00
Tim Quinn
8f1d59fb0a
Support Helidon SE 4 generation (clients and servers) (#19150)
* Save work-in-progress

* Incoming param handling generating well exc. for file upload

* Revise generated test for v3 vs v4 differences

* Leave details of multi-part handling to the user for now

* change default version to use the highest version known

* SE client changes for Helidon 4

* A few fixes; add new v4 SE samples

* Fix v3/v4 routing prep

* Improve version handling if web site is inaccessible; add test

* Reworking parameter conversion and required and validation handling

* Add generation of a return value record per response for each operation

* Improvements to the result record generation

* More changes

* Remove change in whitespace in v3 output

* More progress on parameter handling

* WIP - refactor parameter-returning methods to inner class along with return records

* Reorg of op helpers

* Use no-op for handling map in path, query, header, cookie - need to revise later

* Binary form param handling

* Clean-up and consistency check bt useAbstractClass and not

* Improve result builders

* Add new samples files

* Fix a few issues

* Update samples after rebase; add build steps for v3 and v4 uac github actions

* Remove v3 se useAbstractClass test - creates some bad code

* Generated doc updates

* Fix missing newline

* Improve Javadoc for generated Result; add convenience Result.send method

* Add bean val. for body param if needed

* Restructure generated records for declared responses; add Generated annotation selectively

* Fix typo

* In sample generation, force a stable generatorVersion value to avoid confusing builds and up-to-date samples checking

* Fix up white space in older generation

* Generate PartsUtils only with useAbstractClass = true

* Adopt some review comments; more to come

* Review comments; notably, switch to using the first path segment to group operations rather than the tags items

* Improve status handling a bit

* Add new generated sample files

* Add missing new samples files

* Quite a few updates, esp. to generated samples

* New config file for sample

* Updates samples

* Add updates to .openapi-generator/FILES contents
2024-08-04 22:06:30 +08:00
Emilien Escalle
7f551bb9a0
feat(php-nextgen-client): add support for streaming (#19192)
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
2024-07-31 17:32:10 +08:00
Vikrant Balyan
5d48d224d9
[Go] Set Default Values for Required Variables when a default is defined (#19232)
* use default values for required vars when available

* update tests to existing config file

* cleanup OAS test

* Remove setting value in Get.

* Use Pascal Case for variable naming in Getter Function

* add a CLI option

* add a CLI option

* add a CLI option
2024-07-30 18:32:54 +08:00
Peter Storch
37afe57f0f
[Kotlin][Spring] fix #19244 integer enum (#19248)
* [Kotlin][Spring] fix #19244 integer enum

* fix embedded array enum
2024-07-26 16:02:34 +01:00
Peter Storch
0e70d1f068
[Kotlin][Spring] use flag delegatePattern together with skipDefaultInterface (#19212)
* fix #19211 kotlin-spring flag delegatePattern together with skipDefaultInterface generates broken code

* add kotlin-springboot-delegate-nodefaults to the workflow

* fix Platform declaration clash

* move kotlin-springboot-delegate-nodefaults to the kotlin-server-jdk17 file

* fixed empty line
2024-07-23 18:41:14 +08:00
Kaido Iwamoto
fef84d956e
[typescript-fetch] Fix code generation for oneOf cases without discriminator (#19219)
* Add samples using `oneOf` without discriminator

* Fix typescript-fetch code gen for `oneOf` without discriminator

* Return `{}` instead of original `json`
2024-07-23 08:59:16 +02:00
Peter Storch
08e2653935
fix #18555 kotlin-spring generator flag appendRequestToHandler generates broken code when used with flag delegatePattern (#19206) 2024-07-22 08:32:31 +01:00
Dimitar Tomov
f44bc30d20
[Kotlin][Spring] Fix RequestPart handling for multipart request (#19058)
* [Kotlin][Spring] Fix RequestPart handling for multipart request

* [Kotlin][Spring] Add sample spec for kotlin multipart request model

---------

Co-authored-by: dimitar.tomov <dimitar.tomov@scalefocus.com>
2024-07-19 00:58:51 +08:00
Erik Erbar
aaf3ea2528
[FIX][typescript-fetch] Fix duplicate imports for models with a discriminator (#19195)
* add new typescript-fetch self import issue sample

* add a new typescript-fetch self import issue config

* generate sample

* regenerate sample

* Prevent duplicate typescript imports

* Update generated samples

* Filter imports instead of discriminators mapped models

* Update generated samples

---------

Co-authored-by: GeroSchaarmann <Gero.S97@web.de>
2024-07-18 16:24:21 +02:00
Liri S
0002f8c506
Support net8 in aspnetcore (#19051)
* Support net8 in aspnetcore

* gen

* typo

* more

* default swashbuckle

* gen

---------

Co-authored-by: Liri S <liri@ownid.com>
2024-07-17 00:02:41 +08:00
William Cheng
b705972cad
Upgrade rust-hyper to use hyper 1.0 (#19115)
* Upgrade to rust-hyper to use hyper 1.0

* Update rust-hyper samples for hyper 1.0 upgrade

* update cargo

* update samples

* update samples

* update doc

* Default client configuration for rust-hyper

---------

Co-authored-by: Krishna Rajendran <krishna@emptybox.org>
2024-07-14 22:11:08 +08:00
Wei Shih
42b0b20891
[k6] Add authentication variables in headers and cookies (#19060)
* Add global auth parsing including headers and cookies for k6.

* Add global auth statements.

* Generate samples.

* Revert "Generate samples."

This reverts commit b8cff8691b73f15088f68c7e6876807ed1e63307.

* Copy petstore-with-fake-endpoints-models-for-testing.yaml to a seperate k6 path as its example yaml file.

* Add global security statement in k6 example yaml instead of using the generic one.
2024-07-10 17:09:43 +08:00
DielN
a3912b7239
[Java][Microprofile] Fix #17526: enumOuterClass missing JSON-B (de)serializer (#18951)
* GH-17526/microprofile: Fix enumOuterClass missing JSON-B (de)serializer

* Add microprofile-rest-client-outer-enum to jdk17 samples workflow

* Regenerate samples
2024-07-08 18:30:22 +08:00
William Cheng
0820edee5d
Add bytestring package to dependencies of generated haskell code (#19101)
* Add bytestring package to dependencies of generated haskell code

This broke in https://github.com/OpenAPITools/openapi-generator/pull/18047
where tvh introduced an import of Data.ByteString.Lazy. The added
bytestring package was available in some but not all cases.

* update workflow to test haskell servant ping

* update samples

---------

Co-authored-by: Bastian Senst <senst@cp-med.com>
2024-07-07 22:06:20 +08:00
martin-mfg
045b6012b3
[Spring] replace MultipartFile by Resource (#18509)
* replace MultiPartFile by Resource

* fix SpringCodegenTest

* new approach: small scoped fix

* move to JDK17 workflow

* update samples

* fix formParams
2024-06-25 18:26:09 +08:00
Dennis Ameling
793aba724a
[kotlin-server][javalin6] Add Javalin 6 support (#18928)
* [kotlin-server][javalin6] Add Javalin 6 support

Javalin 5 support was added in 13edc5d. Javalin 6 has been released, with some breaking changes. Let's add a new supportedLibrary to not break existing users of Javalin 5.

https://javalin.io/migration-guide-javalin-5-to-6

* Fix Gradle config and don't include JVM 8 CI anymore (JVM 11 is the minimum for Javalin)

* Update docs

* Fix optional query parameter handling and turn into expected type
2024-06-17 11:38:17 +08:00
Peter Storch
c806ea51b3
requestMappingMode: Explicit configuration to control the location of the generated class level RequestMapping annotation (#18896)
Based on #13838 but for kotlin-spring.

Fixes #18884
2024-06-17 11:36:03 +08:00
William Cheng
13facdaab5
[python] Add an option to add ensure_ascii=False to json.dumps (#18888)
* Added ensure ascii

* add option to add ensure_ascii=False in jsom.dumps

* remove option

* update workflow

---------

Co-authored-by: Emile Girard <Emile.Girard@opal-rt.com>
2024-06-15 18:39:06 +08:00
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
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
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
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
devhl-labs
368110a631
[csharp][generichost] Added 4.8 samples (#18791)
* added 4.8 samples

* easer to understand diff

* build samples again

* build samples again
2024-06-01 16:17:58 +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
Philzen
9c999b6559
[General] Remove defunct global property withXml from generator, docs, maven & gradle plugin (#18568)
* Mention that Golang generator also supports XML annotations

Looking at src/main/resources/go/model_simple.mustache and
src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java
the GoLang seems to cater for withXml=true

* Fix maven plugin config description for `withXml`

* Add basic test for global withXml setting

* Use global withXml setting if not configured in ConfigOptions

Resolves #3839 and #5764

* Don't generate metadata or other files when only Models are tested

* Reformat table for readability

* Remove global property `withXml` from generator and docs

* Move WITH_XML constant out of system constants block

Currently there is only a single reference to this value in the whole
codebase (GoClientOptionsProvider). Maybe we should re-think how this
file is organised (i.e. provide a clearer split / mapping / understanding
what are system properties vs. global properties vs. configOptions and
where to put them).

* Remove global option `withXml` from Maven plugin (Breaking change)

This is a "soft" breaking change: Plugin will no longer execute if
user have this option – which is good, b/c it never worked as expected.
We may want to hint this in the 8.0 release notes.

* Remove global property `withXml` from Gradle plugin (Breaking change)

This is a "soft" breaking change: Plugin will no longer execute if
user have this option – which is good, b/c it never worked as expected.
We may want to hint this in the 8.0 release notes, so they can add it
to the `configOptions` map if required, or simply delete it

* Update samples to reflect removed `withXml` property

* Move `withXml` option into ConfigOptions for Java Microprofile sample

* Remove unused local vars and parameters

* Avoid repetition using fluent assertions

* Remove extraneous debug output
2024-05-27 14:35:32 +08:00
Horace Li
d0a8726580
[java][resttemplate] Fix missing javax validation imports with list validation (#18332)
* Fix java list validation

* Fix java list validation

* Fix java list validation

* Fix java list validation
2024-05-22 15:07:42 +08:00
Stefan Koppier
27120357aa
[kotlin-wiremock] New generator for generating WireMock stubs using Kotlin (#18705)
* [kotlin] Target correct library in jvm-spring-webclient sample

* [kotlin] Fixed warning in jvm-spring-restclient

* [kotlin-wiremock] added generator and sample

* [kotlin-wiremock] First version with petstore

* [kotlin-wiremock] Small typo

* [kotlin-wiremock] Added echo-api test

* [kotlin-wiremock] Split stub and stub builder

* [kotlin-wiremock] Added default values and jackson annotations to models

* [kotlin-wiremock] Small default value fix

* [kotlin-wiremock] Use Gradle wrapper version in samples-kotlin-server GitHub workflow

* [kotlin-wiremock] Added default artifact name

* [kotlin-wiremock] Added kotlin docs

* [kotlin-wiremock] Fixed capitalization in kotlin docs

* [kotlin-wiremock] Added kotlin-wiremock echo_api sample to GitHub workflow

* [kotlin-wiremock] Added new generator to README.md

* [kotlin-wiremock] Generated docs

* [kotlin-wiremock] Generated docs (missed commit)

* [kotlin-wiremock] Explicit Gradle wrapper version in kotlin server generators

* Revert "[kotlin-wiremock] Explicit Gradle wrapper version in kotlin server generators"

This reverts commit 71e1c47def93fdcb9c7e4efe999fc34e21d7518c.

* [kotlin-wiremock] Revert Gradle in workflow samples-kotlin-server and moved kotlin-wiremock samples to separate workflow

* [kotlin-wiremock] Use Java 11 instead of Java 8

* [kotlin-wiremock] ensure-up-to-date
2024-05-21 13:53:44 +08:00
Aniokrait
9b0ca06442
[html2] Change to correct variable (#18685) 2024-05-19 17:46:27 +08:00
William Cheng
a9b1f93d65
clean up samples, update test spec (cpp-restsdk) (#18675) 2024-05-15 15:09:17 +08:00
Marc Le Bihan
1fa2d474b4
[[BUG][C][cpp-restsdk] Missing Set.h when trying to generate from Twitter OpenAPI JSON #9969](https://github.com/OpenAPITools/openapi-generator/issues/9969) (#18631)
- Handling `std::set` in cpp-restdsk
    - Member variables using `std:set` added to `Pet` in cpp-restsdk 3.0 Petstore sample

[cpp-pistache-server] taking into account a remark on this issue about cpp-pistache-server and its set management

    - Switching `std::vector` to `std::set` for openapi set type in cpp-pistache-server
2024-05-15 14:51:59 +08:00
William Cheng
cc5c50b227
update cpp-restsdk to use 3.0 petstore spec (#18670) 2024-05-14 17:15:36 +08:00
William Cheng
09be19cef7
upgrade okhttp-gson and google-api-client to junit5 (#18668)
* upgrade okhttp-gson and google-api-client to junit5

* add changes in StringUtilTest

* use https instead of http to fix 301 (moved) error

* revert petstore test server url to http://petstore.swagger.io and regenerate samples

* synced gradle/sbt/pom, re-generated samples

* revert removal of port 80 from test url

* udpate google api client tests

* update sha

* update comment

---------

Co-authored-by: Thorsten Hirsch <t.hirsch@web.de>
2024-05-14 17:04:33 +08:00
William Cheng
51ef8683fb
[java] implement #18032 add builder pattern to java client and spring generator (#18650)
* add builder pattern to java client and spring generator

* regenerate samples

* update doc

---------

Co-authored-by: jpfinne <jeanpaul@finne.be>
2024-05-14 11:38:30 +08:00
Tim Quinn
0e05cf26d9
Add support for Helidon 4 MP client and server generation (#18627)
* Add support for Helidon 4 MP client and server generation

Signed-off-by: Tim Quinn <tim.quinn@oracle.com>

* Rerun samples generation trying to fix spring jobs

Signed-off-by: Tim Quinn <tim.quinn@oracle.com>

* Update copyright

Signed-off-by: Tim Quinn <tim.quinn@oracle.com>

* Correct the copyright notice

Signed-off-by: Tim Quinn <tim.quinn@oracle.com>

---------

Signed-off-by: Tim Quinn <tim.quinn@oracle.com>
2024-05-12 16:49:28 +08:00
Vikrant Balyan
4b56fd281a
[Go] uses sanitized model name instead of the name (#18644)
* uses sanitized model name instead of the name

* commit sample

* samples updated

* update CI file to test the changes

* adds a pom.xml to the sample
2024-05-12 15:04:39 +08:00
William Cheng
eec30f2cda update sha256 for JSONTest.java 2024-05-12 00:08:27 +08:00