11973 Commits

Author SHA1 Message Date
William Cheng
05f4792df7
[csharp-netcore] fix OAuth2 integration when using httpclient library (#12954)
* Update RestSharp to v108

* Add OAuth2 Application (client_credentials) authentication

* Run generators and fix typos

* Undo accidental python and rust changes

* Add documentation, fix authenticator bug, and fix user agent bug

* Fix tests

Missed some changes in the mustache templates.
Also had to update the `netcoreapp2.0` test project to `netcoreapp3.1` for compatibility with RestSharp

* Switch HttpUtility to WebUtility for compatibility

* skip oauth file generation for httpclient

* fix templates

* remove files, regenerate samples

* add reference to system.web

Co-authored-by: Jared Bates <Jared.Bates@sight-sound.com>
2022-07-20 20:30:56 +08:00
Jared Bates
2dcc319e13
[csharp-netcore] Update RestSharp and add client_credentials auth support (#12789)
* Update RestSharp to v108

* Add OAuth2 Application (client_credentials) authentication

* Run generators and fix typos

* Undo accidental python and rust changes

* Add documentation, fix authenticator bug, and fix user agent bug

* Fix tests

Missed some changes in the mustache templates.
Also had to update the `netcoreapp2.0` test project to `netcoreapp3.1` for compatibility with RestSharp

* Switch HttpUtility to WebUtility for compatibility
2022-07-20 19:25:29 +08:00
Cédric Thireau
0a0a8cffd6
Fix spring implicitHeaders w/o annotationLibrary (#12921)
Fix erroneous code generation when `implicitHeaders=true` and `annotationLibrary=none`
2022-07-20 11:42:49 +08:00
William Cheng
322f617d33
add schema mapping to powershell generator (#12934) 2022-07-20 11:10:27 +08:00
William Cheng
e2b1ed3dfc
add schema mapping to r client (#12933) 2022-07-20 11:09:56 +08:00
devhl-labs
92193f7159
Adds isInnerEnum to CodegenProperty (#12860)
* added nonNullableVars

* added return property to operation

* added return property to operation

* build samples

* added inner enum

* build samples

* added a comment
2022-07-20 01:41:17 +08:00
Bruno Coelho
8d62e597ae
[kotlin][client] Kotlinx Serialization code formating (#12922)
* [kotlin][client] Kotlinx Serialization cleanup

* [kotlin][client] Kotlinx Serialization cleanup
2022-07-19 14:05:17 +01:00
Marcus Handte
8fded5c47e
Fix npe when unwrapping optional. (#12882) 2022-07-19 12:11:11 +01:00
stropho
f176716a61
[typescript-axios] avoid stringifying header string values (#12919)
* feat(typescript-axios) don't stringify string headers

* samples
2022-07-19 09:55:34 +02:00
William Cheng
b722fd9063
cache the model name for faster lookup in r client gen (#12918) 2022-07-19 14:12:55 +08:00
William Cheng
d2be711669
powershell: cache model name for faster lookup (#12917) 2022-07-19 14:12:36 +08:00
Akhil Nair
259221ab25
This PR adds memoization to Java **toModelName()** method. (#12909)
### PR checklist

- [x] Read the [contribution guidelines](https://github.com/openapitools/openapi-generator/blob/master/CONTRIBUTING.md).
- [x] Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
- [x] Run the following to [build the project](https://github.com/OpenAPITools/openapi-generator#14---build-projects) and update samples:
  ```
  ./mvnw clean package
  ./bin/generate-samples.sh
  ./bin/utils/export_docs_generators.sh
  ```
  Commit all changed files.
  This is important, as CI jobs will verify _all_ generator outputs of your HEAD commit as it would merge with master.
  These must match the expectations made by your contribution.
  You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example `./bin/generate-samples.sh bin/configs/java*`.
  For Windows users, please run the script in [Git BASH](https://gitforwindows.org/).
- [x] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master` (6.1.0) (minor release - breaking changes with fallbacks), `7.0.x` (breaking changes without fallbacks)
- [x] If your PR is targeting a particular programming language, @mention the [technical committee](https://github.com/openapitools/openapi-generator/#62---openapi-generator-technical-committee) members, so they are more likely to review the pull request.

This PR greatly reduces the time taken for Java code generation.
**toModelName()** method is invoked numerous times and it was accumulating a lot of time.

This has reduced the Java SDK generation time for our rather large open API spec from ~3h30m hours to 4 mins.

The generated code is the same as before.

spec: https://cdn.intersight.com/components/an-apidocs/1.0.11-7546/model/intersight-openapi-v3-1.0.11-7546.yaml

@wing328
2022-07-19 11:48:32 +08:00
William Cheng
b88666b87a
add uuid test, better hyper test (#12916) 2022-07-19 11:22:29 +08:00
Taufik Rama
4ee336a9da
[Rust] Changed 'UUID' handling into 'uuid' crate (#12895)
* [Rust] Changed 'UUID' handling into 'uuid' crate

* [Rust] updated 'samples/'
2022-07-19 11:03:53 +08:00
Jaemin Park
ed4ed3923f
[cpp-ue4] Fix GET request writes body (OpenAPITools#12833) (#12904)
Co-authored-by: nullbus <nullbus@nm-fc.com>
2022-07-18 17:14:18 +08:00
William Cheng
2e0a121205
add decimal support to crystal cilent (#12899) 2022-07-18 17:01:36 +08:00
William Cheng
eb471db7c9
[R] fix a couple warnings reported by lintr (#12903)
* better code format in r client

* update code based on lintr

* update samples
2022-07-17 23:49:37 +08:00
William Cheng
e05b9746ea
[R] Add lintr (#12902)
* add lintr

* update samples
2022-07-17 17:29:05 +08:00
Max K
d2294d2eca
Updated mustache templates, generator and docs (#12848) 2022-07-17 15:51:05 +08:00
William Cheng
f05dd12b43
add decimal mapping in perl client gen (#12897) 2022-07-17 13:10:53 +08:00
AnaTofuZ
75895e18bc
Perl: Fix JSONization of ArrayObjects (#12896)
* Perl: fix object to json

* generate samples

* add test case
2022-07-17 12:50:39 +08:00
William Cheng
0b80444b56
fix circular reference in inline model (#12894) 2022-07-17 12:43:40 +08:00
William Cheng
bdd54dacad
Fix parameter schema mapping (#12893)
* fix parameter schema mapping,refactor unaliasSchema

* minor code format change
2022-07-17 12:43:00 +08:00
AnaTofuZ
a9e63f4ce3
Perl: Type coercion for the JSON conversion part of Perl (#12891)
* Perl: separate date and DateTime

- Since the json values to be returned are different for date and DateTime, they are managed separately

* Per: Enforcing Perl types to openAPI types

Perl JSON values return different types depending on the context, so look at openapi's type and modify the type.

* generate samples

* generate docs

* add perl test (json types)
2022-07-16 22:18:51 +08:00
Thomas Hansen
e2b9f39b19
[PHP] ObjectSerializer::deserialize() associative arrays bugfix (#12849)
* [PHP] ObjectSerializer::deserialize(): fix bug with json_encode

* [AUTOGENERATED] update samples
2022-07-16 17:21:42 +08:00
Sascha Peilicke
bf604a08ab
Java: Add toString method to ApiException (#12851)
Previously, only the class name appeared in stacktrace whereas now
relevant details are added. This applies to most Java-related
generators.
2022-07-16 17:20:30 +08:00
William Cheng
40c87e125c
fix stream_callback doc (#12879) 2022-07-16 16:33:41 +08:00
William Cheng
ed6280b0f7
add roxygen2 to workflow (#12880) 2022-07-16 16:33:23 +08:00
sebastien-allard
5fb40e571e
[BUG][typescript] Unnecessary semicolon [sonar(typescript:S1116)] (#12863)
* [BUG][typescript] Unnecessary semicolon [sonar(typescript:S1116)]

Making generated stringEnum compliant with Sonar rule:
https://rules.sonarsource.com/typescript/RSPEC-1116

* [BUG][typescript] Unnecessary semicolon [sonar(typescript:S1116)]

Making generated stringEnum compliant with Sonar rule:
https://rules.sonarsource.com/typescript/RSPEC-1116
2022-07-15 17:25:54 +02:00
stropho
87aab5a1f3
[typescript-axios] discriminator type in template (#12878)
* feat(typescript-axios) discriminator type

* add samples
2022-07-15 11:39:26 +02:00
Ruben Fiszel
810a8b5937
[Typescript] Support text/plain by ObjectSerializer.stringify (#12799)
* [Typescript] Support text/plain by ObjectSerializer.stringify

* Update ObjectSerializer.mustache

* Update ObjectSerializer.mustache

* Update ObjectSerializer.ts

* generate samples

* generate samples

* update samples, remove trailing spaces

* Update modules/openapi-generator/src/main/resources/typescript/model/ObjectSerializer.mustache

Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>

* regenerate samples

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>
Co-authored-by: Esteban Gehring <esteban.gehring@bithost.ch>
2022-07-15 11:35:34 +02:00
William Cheng
a3269a0569
Add R GitHub action file (#12868)
* fix travis, update rbuildignore

* add comment
2022-07-15 15:31:22 +08:00
Justin Black
ca4a86ea55
Turns on json-schema python-exp anyOf + oneOf unit tests (#12864)
* Spec updated to anyof only

* All tests turned on

* Revert version file

* Adds oneOf tests also
2022-07-14 09:57:43 -07:00
William Cheng
28b74d79cb
remove unused import in r package (#12867) 2022-07-14 16:23:02 +08:00
William Cheng
4dfac192f8
fix warning in rdoc due to missing @param (#12865) 2022-07-14 15:41:56 +08:00
Justin Black
01afbaecd8
[python-experimental] turns on allOf unit test cases (#12826)
* Spec regenerated with only allOf on

Sample regnerated

Fixes a bug where AnyType composed schemas omitted validations, Fixes a bug where properties in AnyType schemas were omitted, Stops storing multipleOf value in a list

Adds required variable info to AnyType classes

Samples regenerated

Turns all unit tests back on

* Samples regenerated

* Docs and models regenerated
2022-07-13 19:27:55 -07:00
Justin Black
c44fe8a04a
Fixes fromProperty when property is required vs optional (#12858)
* Adds required boolean to fromProperty

* Adds required to other method signatures

* pythn-exp sample regenerated

* Samples regenerated

* Adds java test of fix
2022-07-13 18:17:33 -07:00
devhl-labs
57bcb046d1
Adds return property to CodegenOperation (#12816)
* added nonNullableVars

* added return property to operation

* added return property to operation

* build samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2022-07-13 17:01:43 +08:00
justM4D
464da4a10f
[csharp-netcore] Generic Host: Added port definion to the uriBuilder in API template (#12795)
* Added port definition to uriBuilder, since it was ignored before and couldn't be set even by supplying a custom client

* generated samples

* update samples

Co-authored-by: Matthias Lewen-Rieger | PROSPER X GmbH <matthias.lewen-rieger@prosper-x.de>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2022-07-13 16:49:59 +08:00
devhl-labs
636820b541
Add nonNullableVars to CodegenModel (#12815)
* added nonNullableVars

* build samples
2022-07-13 16:48:23 +08:00
Linus Klöckner
57496ff0b0
[java][okhttp-gson] Complex values in form data get serialized as JSON instead of String (#12779)
* Java: fix complex object serialization in form-data

* Java: update samples
2022-07-13 15:47:39 +08:00
roedde
9e2b8a0ec1
#12844: copy skipOperationExample from builder to WorkflowSettings (#12845) 2022-07-13 11:16:44 +08:00
Oleh Kurpiak
2e2da7bc82
[Spring] fix deprecated generation (#12832) 2022-07-13 11:08:28 +08:00
Edward Poot
8025aa3bfa
Fix: Always set jakarta_annotation_version (#12834)
Commit 1735ab9d27656171def2440fa75cfe0c80a510f5 added changes to set the `jakarta_annotation_version`.

I've recently noticed that when using retrofit2 library, the project builds fine with Maven but fails with Gradle.

The build fails due to `Could not get unknown property 'jakarta_annotation_version' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler`.

Digging into this, in the generated `build.gradle` the `jakarta_annotation_version` is never set.
Upon closer inspection, aforementioned commit seems to indeed set it differently for the Maven build configuration than the Gradle build configuration (same for SBT configuration) for that matter.

The issue is that due to human error the `jakarta_annotation_version` line is added within the `{{#usePlayWS}}` block, meaning it won't be generated when `usePlayWS` is false, even though it should.

This commit changes this to always generate it.
2022-07-13 11:05:35 +08:00
William Cheng
60c5875091
Custom Content type: better message and added tests (#12841)
* add tests for custom mime types

* better message for custom mime type example handling

* minor code format change
2022-07-12 18:32:15 +08:00
Akhil Nair
6dfbc58bb8
[custom_content_issue] (#12836)
This PR will fix issue: https://github.com/OpenAPITools/openapi-generator/issues/12835

Signed-off-by: the-akhil-nair <sam1232007@gmail.com>
2022-07-12 15:26:18 +08:00
William Cheng
8b58abfdf2
add schema mapping support to go generator (#12839) 2022-07-12 14:30:20 +08:00
William Cheng
00db9255c0
add schema mapping support in typescript client codegen (#12840) 2022-07-12 07:40:33 +02:00
Oleh Kurpiak
4bbfa01ba8
[Java] fix JsonCreator with JsonNullable (#12813) 2022-07-12 10:41:55 +08:00
Hans Nuttin
073a800464
[Typescript] support schemaMapping (#12803)
Co-authored-by: hansnuttin <hans.nuttin@aca-it.be>
2022-07-11 19:06:57 +02:00