* [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 :/
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
* 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
* Adds boolean enum component and object property and tests of it
* Regenerates samples
* Passes needed locale argument to toUpperCase
* Regenerates samples
* [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>
* [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>
* 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>
* [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
* [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
* 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
* [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
* [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
* [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
* 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
* 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