18059 Commits

Author SHA1 Message Date
Jon Jensen
bd070308d9
[Java][*] Annotate deprecated operations and schemas (#9478)
Refs #3358

Ensure `deprecated` operations are annotated/documented as such on the
generated methods. Libraries updated:
  * [feign]
  * [google-api-client]
  * [microprofile]
  * [okhttp-gson]
  * [resttemplate]
  * [retrofit]
  * [retrofit/play*]
  * [webclient]
  * [vertx]

Ensure `deprecated` schemas are annotated/documented as such on the
generated classes/fields. Libraries updated:
  * [feign]
  * [google-api-client]
  * [jersey2]
  * [microprofile]
  * [native]
  * [okhttp-gson]
  * [rest-assured]
  * [resteasy]
  * [resttemplate]
  * [retrofit*]
  * [webclient]
  * [vertx]

Also fix two minor bugs to get the java sample tests working:

* Fix an invalid jackson-datatype-threetenbp version number in vertx/pom.mustache
* Fix a bad return type in webclient/api_test.mustache when uniqueItems=true

Since this commit updates petstore-with-fake-endpoints-models-for-testing.yaml,
several other samples were updated, but it's just new files to reflect the
deprecated schemas, so there should be no consequential differences.

Relevant bits of the spec:

* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#user-content-operationdeprecated
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#user-content-schemadeprecated
2021-07-19 10:27:03 +08:00
Florian Kamella
c42e03e251
Support openApiNullable in jaxrs-cxf-client generator (#8863)
* Introduce jaxrs-cxf-client-jackson-nullable sample

Generated using: ./bin/generate-samples.sh bin/configs/other/openapi3/jaxrs-cxf-client-jackson-nullable.yaml

* Add support for openApiNullable to JavaCXFClientCodegen

Add import mapping for JsonNullable to AbstractJavaCodegen

* Deduplicate string "jackson" in generators extending AbstractJavaCodegen

* Adjust nullable fields

* Adjust standard getters for nullable fields

add @JsonIgnore to standard getters

* Adjust standard setters for nullable fields

* Adjust fluent setter for nullable fields

* Introduce distinct getter and setter for nullable fields

* Adjust add method for nullable lists

* Adjust put method for nullable maps

* Cleanup JavaJaxRS/cxf/pojo.mustache

* Further cleanup JavaJaxRS/cxf/pojo.mustache

* Adjust inner enum getters
2021-07-19 10:22:52 +08:00
szTheory
6229801935
[Ruby] Add new Ruby versions to the Travis CI build matrix configuration (#9971)
* Add new Ruby versions to the Travis CI build matrix configuration

* Build the project and update samples
2021-07-19 09:57:55 +08:00
Peter Leibiger
5920bbd6df
[dart] Fix tests failing in CI after automatic dependency update (#9961)
* prevent future problems of this kind by adding the pubspec.lock file to VCS for all 3 test projects
2021-07-16 21:05:23 +08:00
William Cheng
160db768af update cpp ue4 samples 2021-07-16 11:46:03 +08:00
Samuel Kahn
27e2ee0b64
[cpp-ue4] Added support for bool in URL parameters, now writes true/false instead of 1/0 (#9951) 2021-07-16 11:37:34 +08:00
Mikael Lixenstrand
2e030c0c47
[Erlang] decrease memory usage (#9946)
* do not keep generator_state in cowboy match structure

* update generated example
2021-07-16 11:34:18 +08:00
William Cheng
d99f16edc5
[C#][netcore] Remove redundant logic in adding ICollection (#9938)
* remove reduce logic in adding IColletion

* remove redundant logic in csharp client generator

* update samples
2021-07-16 11:33:40 +08:00
Toby Archer
8df43a10c1
[Elixir] Adding :package and :description to mix.exs template (#9945)
* feat: templating elixir's mix.exs :package and :description

* adding updated elixir sample
2021-07-16 11:16:18 +08:00
Isaac van Bakel
65a271c50b
Haskell-http-generator - Make endpoints which don't return anything yield NoContent (#9916)
* Make endpoints which don't return anything yield NoContent

Relevant issue: OpenAPITools/openapi-generator#9901

The haskell-http-client generator tries to generate a polymorphic return
type for endpoints which don't return anything in the success case, but
still produce content in other cases. This means that these endpoints
hit a decoding error in the success case, because there is no content to
decode.

This changes the behaviour so that endpoints that don't return anything
are *always* generated as returning NoContent, and never try to decode
the response. This change is based on a similar one for the
haskell-servant generator, which can be found at:

OpenAPITools/openapi-generator#9830

which resolved a similar issue for that generator.

* Update samples after haskell-http-client NoContent change
2021-07-15 10:57:14 -05:00
William Cheng
79866e90cf update haskell servant samples 2021-07-13 21:03:07 +08:00
devhl-labs
519ab9290e
[abstract csharp] Optional param data type (#9885)
* fix optional parameter dataType

* add test

* removed stray spaces

* improved test method name
2021-07-13 17:12:31 +08:00
Profpatsch
7bd633f1ae
[haskell][server] Export the Wai Application for the server (#9801)
For tests it’s useful to have direct access to the Wai `Application`,
which is the plain function from `Request` to `Response`.

Then you don’t need to use a full-blown http server to run requests.
2021-07-13 17:00:06 +08:00
Jacob Heider
aa88d5bbe6
Swift5/Vapor query parameter coding keys required (#9924)
* Fixes camel-case query parameters (perPage => per_page)

* Prep for PR
2021-07-13 15:27:44 +08:00
Bruno Coelho
26f998b043
[kotlin][client] define kotlin coroutines context (#9936)
* [kotlin][client] define coroutines context

* [kotlin][client] update sample projects

* [kotlin][client] add missing kotlinx coroutines dependency

* [kotlin][client] update sample projects
2021-07-13 15:26:59 +08:00
William Cheng
05e4c3cf64 update samples 2021-07-12 17:15:22 +08:00
William Cheng
35f933b27f Merge remote-tracking branch 'origin/5.3.x' into 6.0.x 2021-07-12 17:11:35 +08:00
William Cheng
7573234a4c
Update PR template to refer to 5.3.x 2021-07-12 16:59:53 +08:00
Justin Black
11515da053
Python client - fixes boolean enum use case (#9926)
* Adds boolean enum component and object property and tests of it

* Regenerates samples

* Passes needed locale argument to toUpperCase

* Regenerates samples
2021-07-09 18:55:22 -07:00
William Cheng
39fbf53150 create v5.3.0 2021-07-10 00:12:23 +08:00
William Cheng
02835b35bc
Prepare v5.2.1 (#9922)
* bump verions to 5.2.1-SNAPSHOT

* update samples

* update readme

* fix gradle properties
2021-07-09 22:42:31 +08:00
William Cheng
90f7bcd909
Prepare v5.2.0 release (#9920)
* 5.2.0 release

* update samples

* update meta codegen
v5.2.0
2021-07-09 17:06:55 +08:00
Bruno Coelho
f5c3430a26
[swift5][client] avoid local variable name collision (#9913)
* [swift5][client] avoid variable name collision

* [swift5][client] update sample projects
2021-07-09 01:03:54 +08:00
John Boyes
7084a79ede
[BUG][PYTHON] Do not set Content-Type for GET, HEAD or DELETE requests (#9852)
* [BUG][PYTHON] Do not set Content-Type for GET, HEAD or DELETE requests

The Python generator no longer sets a default `Content-Type` of
`application/json` for `GET`, `HEAD` and `DELETE` requests.

Having the `Content-Type` set for these requests was causing issues with
other tools which insist that GET, HEAD and DELETE requests do not have
a Content-Type (as per the OpenAPI 3 specification).

An example of the problem that this commit fixes is when using
[Prism][1] as a [validation proxy][2].

[Prism rejects any GET request that has a Content-Type][3].

Here is [an example of the problem manifesting itself][4].

To validate the fix in this commit:

1. Start with any OpenAPI3 spec e.g. the Petstore example at
https://editor.swagger.io/
2. Generate Python client code for the spec
3. Look at the generated `rest.py` e.g. in the [standard sample in this
repo][5] and see that the `Content-Type` defaults to `application/json`
for all HTTP methods (including `GET`, `HEAD` and `DELETE`), rather than
there being no `Content-Type` for `GET`, `HEAD` and `DELETE`.

Fixes #9831

[1]: https://github.com/stoplightio/prism
[2]: https://meta.stoplight.io/docs/prism/docs/guides/03-validation-proxy.md
[3]: https://github.com/stoplightio/prism/issues/1408#issuecomment-690948020
[4]: https://github.com/agilepathway/gauge-openapi-example/pull/28/checks?check_run_id=2888606052#step:13:18
[5]: 969cea8ce1/samples/openapi3/client/petstore/python/petstore_api/rest.py (L141)

* update samples

* Fix Python DELETE bug introduced in earlier commit

The earlier commit 9dfe1f6 introduced a bug for `DELETE` requests on the
standard Python generator.  This commit fixes that bug and also includes
the updated samples.

Co-authored-by: William Cheng <wing328hk@gmail.com>
2021-07-07 11:04:26 +08:00
William Cheng
60c4c88a74 update samples 2021-07-06 15:36:48 +08:00
William Cheng
046780657c
fix regex in erlang, update samples (#9892) 2021-07-06 11:10:08 +08:00
Łukasz Leszczuk
efe0e1d7a0
Fix cancellation token usage for async calls in csharp-netcore. (#9841) 2021-07-05 13:11:45 +08:00
William Cheng
eb2e56dbb1 better code indentation 2021-07-05 09:30:51 +08:00
Katsuya Oda
a835f6ec0e
fix: missing vendor extensions in inlined objects #8064 (#9810) 2021-07-05 09:16:35 +08:00
Jens Fischer
870c1e1894
[Java] [Native] Unify exception messages for async, add the status code (#9825)
* [Java] [Native] Unify exception messages for async, add the status code

The template has two methods for creating API exceptions, and the enhancements from #9169 didn't make it to the async version.

- unify the signatures of the two methods (name, arguments)
- make sure the sync version is not generated with asyncNative
- extract the formatting logic into a common formatExceptionMessage() method
- add the status code to the exception message as well, not just the body
- shortened "call received non-success response" to a more concise "call failed with"

* Treat an empty body the same as a null body

Co-authored-by: Jens Fischer <jens.fischer@vier.ai>
2021-07-05 08:57:40 +08:00
William Cheng
a5c98dd416
better null check to surpress sonarcloud warning (#9888) 2021-07-04 15:16:19 +08:00
cal
d2e79be728
[cleanup] erefactor/AutoRefactor - TestNG asserts (#9861)
AutoRefactor cleanup 'TestNGAssert' applied by erefactor:

Refactors to a proper use of TestNG assertions.

For AutoRefactor see https://github.com/JnRouvignac/AutoRefactor
For erefactor see https://github.com/cal101/erefactor
2021-07-04 14:49:47 +08:00
cal
611a3effa6
[cleanup] erefactor/AutoRefactor - Log parameters rather than log message (#9859)
AutoRefactor cleanup 'LogParametersRatherThanLogMessage' applied by erefactor:

Replaces a string concatenation as parameter of a logger method by a
string template followed by objects.

For AutoRefactor see https://github.com/JnRouvignac/AutoRefactor
For erefactor see https://github.com/cal101/erefactor
2021-07-04 14:47:52 +08:00
cal
54814caeb1
[cleanup] erefactor/EclipseJdt - Add missing @Override annotation - include interface implementations (#9860)
EclipseJdt cleanup 'AddMissingOverrideAnnotation' applied by erefactor.

For EclipseJdt see https://www.eclipse.org/eclipse/news/4.20/jdt.php
For erefactor see https://github.com/cal101/erefactor
2021-07-04 14:44:57 +08:00
William Cheng
b134e8e135
Fix GitHub action (#9887)
* fix missing jar

* add comment
2021-07-04 13:53:25 +08:00
dependabot[bot]
6c6525aa31
Bump actions/download-artifact from 2.0.9 to 2.0.10 (#9793)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 2.0.9 to 2.0.10.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v2.0.9...v2.0.10)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-04 12:43:34 +08:00
dependabot[bot]
e345eef32c
Bump actions/upload-artifact from 2.2.3 to 2.2.4 (#9794)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2.2.3 to 2.2.4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2.2.3...v2.2.4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-04 12:43:08 +08:00
Bastien Gérard
510e64fa43
Fix minor typo in @cached_property docstring (#9886) 2021-07-04 12:29:55 +08:00
Matthias Ernst
17b6379df5
[Kotlin Multiplatform] Update and fixes for Kotlin 1.5.10 and Kotlinx.serialization 1.2.1 (#9755)
* Update Kotlin Multiplatform with Kotlin 1.5.10, Ktor 1.6.0 and Kotlinx.serialization 1.2.1
* remove @Serializable from interfaces
* Using 'String(CharArray): String' is an error. Use CharArray.concatToString() instead
* Fix, RequestConfig needs a type to infer type variable T

Fixes from @DevSrSouzaern
* Fix `private` keyword not being handle as a reservedWords
* Fix enum serialization generation
* Migrate gradle build to Kotlin DSL

* update samples and documentation

* PR Review changes
* sample update
* revert non multiplatform kotlinx_serialization removal
* default Json{} in ApiClient
* revert accidental version push for jvm client
* Match ktor and Kotlinx Serialization version in documentation and build.gradle.kts

* remove const from JSON_DEFAULT

* Update AbstractKotlinCodegen.java

Co-authored-by: Gabriel Souza <devsrsouza@gmail.com>
Co-authored-by: ern <ern@ti8m.ch>
2021-07-03 23:33:39 +08:00
William Cheng
173c7ca652 update powershell samples 2021-07-03 22:30:54 +08:00
SimeonGerginov
3663831b4d
[REQ][PowerShell] Improve generated PowerShell examples (#9836)
* Implement new PowerShell example structure

Signed-off-by: Simeon Gerginov <sgerginov@vmware.com>

* Modify documentation template to work with the new PowerShell example format

Signed-off-by: Simeon Gerginov <sgerginov@vmware.com>

* Update PowerShell Generator documentation with the new properties

Signed-off-by: Simeon Gerginov <sgerginov@vmware.com>

* Update PowerShell samples with the new PowerShell example format

Signed-off-by: Simeon Gerginov <sgerginov@vmware.com>

* Fix issues with array of models as parameters

Signed-off-by: Simeon Gerginov <simeongerginov1@gmail.com>

* Change string value generation to include the prefix 'My'

Signed-off-by: Simeon Gerginov <simeongerginov1@gmail.com>

* Remove multiple new lines and trim leading and trailing spaces in PowerShell example

Signed-off-by: Simeon Gerginov <simeongerginov1@gmail.com>
2021-07-03 22:27:06 +08:00
Bernhard Danecker
32a3eb1655
fix generate-samples code sample line break (#9880) 2021-07-03 22:09:53 +08:00
Marc de Jonge
bba23272ff
#9848 Add support for generating a Set for a list with uniqueItems set to true (#9849) 2021-07-01 17:56:28 +08:00
Adriaan Duz
147367e559
[Kotlin][Bug] Added open, external and internal as reserved keywords for kotlin (#9842)
* Added open, external and internal as reserved keywords for kotlin

* ./bin/generate-samples.sh
./bin/utils/export_docs_generators.sh
with only kotlin
2021-07-01 17:54:04 +08:00
Bernhard Danecker
f0cbfbc820
Updated openapi-generator-gradle-plugin/README.adoc to latest plugin version (#9874)
Updated docs to reference latest gradle plugin version with important support for gradle 7
2021-07-01 17:48:28 +08:00
William Cheng
cd2bd84bb6 update samples 2021-06-29 20:37:09 +08:00
Ghufran Zahidi
90233d6653
conditional serialization add only those property which user wants to… (#9807)
* conditional serialization add only those property which user wants to configure.

* fixed the samples

* fixed the sample String to string issue.

* fixed the sample String to string issue.

* updated the sample

* Added unit test for conditional serialization

* update samples

* remove trailing spaces, update samples

* remove files

* add back files

* build the project in the ci

Co-authored-by: William Cheng <wing328hk@gmail.com>
2021-06-29 20:28:47 +08:00
Florian Verger
b9b539459a
Typescript angular discriminator mapping (#8929)
* remove trailing spaces

* add support of discriminator mapping for typecript-angular generator

* PR comment
2021-06-29 13:01:58 +02:00
William Cheng
919945b65b
ensure haskell, erlang server samles up-to-date (#9851) 2021-06-26 18:53:07 +08:00
Michał J. Gajda
1cd1001e34
Fix returning NoContent. (#9830) 2021-06-26 18:20:59 +08:00