1230 Commits

Author SHA1 Message Date
William Cheng
56aafe30d9 Merge remote-tracking branch 'origin/master' into 5.3.x 2021-07-27 11:33:35 +08:00
Peter Leibiger
88e22b0a52
[dart][dart-dio-next] Authentication fixes and improvements (#9975)
* [dart-dio-next] Update http mock test library

* [dart-dio-next] Fix authentication problems

* correctly map authentication by type and scheme
* add new authentication interceptor for `bearer` scheme - this currently does the same as the OAuth interceptor
* add tests for all authentication types except OAuth
* use temporary test library branch until new fixes and features get merge there

* Actually commit the fixed test library dependency

* Update http mock library

* Format :/
2021-07-27 10:04:05 +08:00
Marcel Stör
c5f5d3dd6a
[Java] Add @javax.annotation.Nonnull to required getters (#9593)
* Add @javax.annotation.Nonnull to required getters

* Add updated samples

* Consider the nullable constraint
2021-07-19 10:48:58 +08:00
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
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
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
2021-07-09 17:06:55 +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
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
Bastien Gérard
510e64fa43
Fix minor typo in @cached_property docstring (#9886) 2021-07-04 12:29:55 +08:00
Gabriel Rohden
44c1fee3e2
[dart] fix some compilation issues and added casts for analyzer implicit-casts flag (#8244)
* fix: missing dart casts and analyzer issues

* chore: regenerate dart template files

* refactor: remove unneeded implicit-casts:false and regenerate sources

* chore: regenerate templates after merge

* chore: regenerate dart pet store codes
2021-06-24 10:24:28 +08:00
William Cheng
c5405aa59a
[Go-client] Fix inability to download files (#9812)
* Revert a change to the Go Client code that broke
the ability to download files. This reverts the change
from 14d41310b9

* Missed import for "io/ioutil"

* update samples

Co-authored-by: icubbon <icubbon@gmail.com>
2021-06-19 11:23:05 +08:00
Daniel Krebs
2e65e6f62d
[python][client] allow passing floats for _request_timeout (#9532)
* [python][client] allow passing floats for _request_timeout

While several method docstrings suggested that you could pass floats for
_request_timeout and the underlying urllib3.Timeout can deal with them,
the code only allowed integer values so far when passed as a single
number.

* [python][samples] update with fix for _request_timeout type
2021-06-18 15:09:55 +08:00
shartte
8a31064028
[Java] Remove JAX-RS dependency from generated java-native client. (#8320) (#9585) 2021-06-18 15:05:55 +08:00
Tino Fuhrmann
0dcae66e0c
Revert "[typescript] Generate documentation and examples (#9413)" (#9758)
This reverts commit 624b6a7a85a22579f26be47698c99e583f582c64.
2021-06-14 08:12:41 +02:00
NouemanKHAL
624b6a7a85
[typescript] Generate documentation and examples (#9413)
* generate docs for typescript

* commit changed files
2021-06-12 09:31:40 +02:00
FallenRiteMonk
6611ae64bb
[dart] fix Date.toDateTime utc (#9717) 2021-06-10 11:11:08 +08:00
Peter Leibiger
fdbf02764d
[dart][dart-dio] Add support for query collection parameter format (#9635)
* [dart][dart-dio] Add support for query collection parameter format

* add support for collectionFormat in query parameters and www-url-encoded content
* add tests
* remove empty query parameter maps from generated code
* closes #6681
* closes #9522
* closes #8271 (the last remaining parts)

* Fix formatting
2021-06-07 09:49:59 +08:00
Peter Leibiger
afd65b3cb0
Update query parameter sample to include pipe delimiter (#9590) 2021-05-30 17:45:38 +08:00
Peter Leibiger
f7b93ebdf2
Update fake API to contain sample with binary body (#9610) 2021-05-29 10:26:01 +08:00
William Cheng
28c3e1d544 update samples, docs 2021-05-28 10:26:48 +08:00
adessoDpd
12c34d4658
New generator: WSDL (#9545)
* init port

* add outputDir

* fill out current .md

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2021-05-28 10:22:28 +08:00
Peter Leibiger
6edbc91eeb
[dart][dart-dio] Update docs for dart-dio-next (#9584)
* remove deprecated author field from all pubspec templates
* improve dart-dio-next readme/markdown documentation
* add a lot of dart-doc to model and API classes
2021-05-27 10:58:37 +08:00
William Cheng
32d5900611 update samples, docs 2021-05-27 10:40:32 +08:00
desmese
4f1d8f4699
- added localVar prefix to the contentType variable defined in the api.mustache template in the java resttemplate library (#9568)
- rerun generate-samples.sh and export_docs_generators.sh
2021-05-27 10:24:38 +08:00
Peter Leibiger
ab11acd634
[dart][dart-dio-next] Improve support for file uploads (#9542)
* [dart][dart-dio] Improve support for file uploads

* add support for filenames in multipart requests by using  `MultipartFile` from dio directly
* add support for binary/file body data
* fixes #6671
* fixes #9079

* Add and fix tests

* Only use MultipartFile for body/multipart parameters

* Fix test

* Actually fix tests
2021-05-25 23:58:39 +08:00
alespour
e360228a76
fix: dart2 mustache templates minor improvements (#9539)
* fix: prefer_is_not_empty linter suggestion

* fix: annotate_overrides linter suggestion

* chore: update samples
2021-05-24 11:01:53 +08:00
Peter Leibiger
be84c44fcc
[dart][dart-dio-next] Add stacktraces to manual DioError instances (#9549) 2021-05-24 10:54:51 +08:00
Peter Leibiger
48924eb1a0
[dart] Improve content-type handling (#9517)
* [dart] Improve content-type handling

* fixes #9334
* superseeds #9454
* use `prioritizedContentTypes` in the same way `JavaClientCodegen` does
* move `application/json` to the front if it exists
* don't do anything if it is multi-part or url-encoded as for this the first content-type already needs to match
* log warning if an unsupported content-type is first after prioritizing
* remove some unused code blocks from dio generators

* Only use first prioritized content-type in dio generators

* don't default to any content-type in dio-next, dio defaults itself to JSON
2021-05-24 10:53:39 +08:00
Rinish Sam
9eb9c30a92
[dart][dart-dio] Fix gitignore comment style (#9554)
* Fix gitignore comment style in templates

* Update samples
2021-05-23 11:27:07 +08:00
Peter Leibiger
b8c5a647e0
[dart][ci] Move Dart samples from CircleCI to Github actions (#9515)
* [dart] Move Dart samples from CircleCI to Github actions

* Fix format failing with latest Dart version

* Workflow naming

* Split dart samples depending on version

* use fixed version to prevent flaky builds

* Change branch pattern for release branches
2021-05-21 14:45:50 +08:00
Arthur Mogliev
ab6d66147b
[php-mezzio-ph] PHP 8 support (#9445)
* Huge update for php-mezzio-ph generator:
- proper container support for data types
- support for query parameter references and query parameter schema references
- dependency update (PHP 7.3+, PathHandler 0.7+, DataTransfer 0.5+)

* Sample regeneration after rebasing for php-mezzio-ph

* - added custom CLI option for php-mezzio-ph to generate code using modern PHP syntax
- removed obsolete php-mezzio-ph samples in samples/openapi3/server/petstore/php-mezzio-ph

* - fixes for JavaDoc declarations that seems to break CI

* - fix for outdated sample file
2021-05-21 14:40:38 +08:00
Peter Leibiger
55b95bc9c5
Fix CircleCI failures (#9503)
* Fix go-echo-server sample not running in CircleCI

* remove wrong argument

* [dart] Fix petstore sample tests & Multipart not working

* follow up to #9392
* `MultipartRequest(null, null)` is no longer valid after `http` package upgrade
* fix petstore sample project not compiling
* disable live petstore tests
* use template to strip out unused code blocks
2021-05-18 23:09:29 +08:00
Justin Black
fb3aed6dc4
Fixes python test_fake_api tests (#9483)
* Fixes test_upload_download_file

* Fixes test_string

* Fixes test_string_enum

* Fixes test_number_with_validations test_composed_one_of_number_with_validations

* Fixes two more tests

* Fixes test_array_of_enums

* Fixes two tests

* Removes comment

* Fixes serializationf of composed schema object models, fixes test

* Samples regenerated

* Removes pdb
2021-05-17 20:15:53 -07:00
Kuzma
e1ef7d40b3
add OAuth2 to typescript template (#9466)
* add OAuth to typescript

* generate samples
2021-05-17 18:22:18 +02:00
William Cheng
5e29d61639 Merge remote-tracking branch 'origin/master' into 6.0.x 2021-05-13 18:44:58 +08:00
gbmarc1
c966b5fe1f
[python] readonly constructors (#9409)
* readonly

* other tests

* doc

* python samples

* model utils
2021-05-10 18:41:26 -07:00
Kuzma
686b2110e6
[BUG] [typescript] Duplicate parameter's names (rename options to _options and config to _config) (#9428)
* rename options to _options and config to _config

* add samples
2021-05-10 19:52:58 +02:00
Adi1231234
1961c661f3
upgrade dart generator dependencies (#9392)
* upgrade intl package

* upgrade http package and change url to uri

* update petstore sample

* update pubspec files

* upgrade http dependency

* upgrade dev dependencies

* update json_serializable and test

* delete nullable - deprecated on json_serializable 4.1.1

* fixed NNBD issue

* change test version
2021-05-10 16:07:03 +08:00
William Cheng
be214dc349 Merge remote-tracking branch 'origin/master' into 5.2.x 2021-05-07 10:15:12 +08:00
William Cheng
560bf7e080
v5.1.1 release (#9421) 2021-05-07 09:57:19 +08:00
johnthagen
a88313c40c
[Python] Avoid DeprecationWarning in inspect.getargspec on Python 3 (#9271)
* Avoid DeprecationWarning in inspect.getargspec on Python 3

* Regenerate samples
2021-04-30 11:59:33 -07:00
William Cheng
b63d735312 update samples 2021-04-28 21:14:23 +08:00
William Cheng
3e58b0908c Merge remote-tracking branch 'origin/5.2.x' into 6.0.x 2021-04-28 18:08:24 +08:00