When using an OAS3 spec with formdata, the validation logic looks
for the key 'formData' in the spec parameters list. This keys is
specific to OAS2, and will never be present, causing any form data to
throw an ExtraParameterProblem.
This allows to use optional authentication and provide different
responses to authenticated users via the same API-Endpoint.
Co-Authored-By: Jacob Floyd <cognifloyd@gmail.com>
* Support aiohttp handlers to return tuples
* Minor update from #828 review
* Factorize more code between Flask and AioHttp response
* Fix CI
* Drop six string types
* Standardize response logging
* Handle one-tuples that only contain data
* clean up a couple of type hint comments
* Add a few more get_response tests
* Adjust _prepare_body interface to simplify improving _serialize_data
Rename _jsonify_data to _serialize_data to make its purpose easier to
understand (this was also known as _cast_body in aiohttp_api).
In exploring how to harmonize json serialization between aiothttp and
flask, we needed to be able to adjust the mimetype from within
_serialize_data. Harmonizing the actual serialization has to wait until
backwards incompatible changes can be made, but we can keep the new
interface, as these functions were introduced in this PR (#849).
* Add deprecation warnings about implicit serialization
* Forward options to the AioHTTP app.
* fix tests/aiohttp/test_aiohttp_app.py::test_app_run for #885
* Update connexion/apps/aiohttp_app.py
Co-Authored-By: Jacob Floyd <cognifloyd@gmail.com>
* fix pop of 'use_default_access_log' option for aiohttp app.
* It appears the mockmode metavar is unused in code.
* The problem it causes by being there is it overrides the default
`--help` string from `connexion run --help` so that it is difficult to
understand what the possible arguments are for `--mock`
* [#935] adding support to automatically decode json when a multipart/form-data contains a field with an application/json content-type
* Update connexion/decorators/uri_parsing.py
Co-Authored-By: Tomasz Trębski <kornicameister@gmail.com>
* Update connexion/decorators/uri_parsing.py
accepting other non-standard json content types too
Co-Authored-By: Tomasz Trębski <kornicameister@gmail.com>
* Update uri_parsing.py
syntax fix
* syntax fix
* fixes
* Adding unit test to verify that multipart/form-data values which are json objects are decoded and validated as such
* Remove the unused "query_sanitazion" fixture
* Test whether no sanitization is performed in the request body
* Do not perform sanitization on request body keys in OpenAPI v3
The deserialized JSON form of the request body
needs to be passed to the client applications
* without further modification *
so that they can work directly with objects
that have been received over the network.
The only names for which sanitization makes sense
are the ones which are used as Python identifiers.
Keys of the top-level JSON object within the request payload
are never used by Connexion as Python identifiers.
Also, no such sanitization of keys within request body
is performed in OpenAPI v2.
Closes issue #835.
* Add swagger_ui_config option to configure the Swagger UI
There was no possibility to configure the Swagger UI. Through
this new option a config object can be passed to the UI via
a `swagger-ui-config.json` file.
* Add tests for swagger_ui_config option
This is a follow up for c8d8973c7e
(dropping Python 3.5). There waere some leftovers in requirements for
Pythonv versions `connexion` no longer supports.