* 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
* 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
* Converting response to raise a ProblemException
* Centralizing around ProblemException for errors in the app.
* Adding the ability to skip error handlers, allow for defining exception payload.
* Fixing flake8
* Fixed some bugs found through unit testing.
* Unit tests are now passing.
* Added problem back to __init__
* Updating based on the feedback from the PR.
Fixes the build.
Changes proposed in this pull request:
- apply all of the isort changes that resulted from the latest version
- pin to the latest version (4.3.15) so this doesn't happen again, unless we bump the version on purpose
* Fix: #772. Serving yaml spec.
Serve yaml spec with a yaml prettifier. Uses a separate method for
doing the job and does not modify the openapi_json one.
Fixes#829
* aiohttp openapi basic auth testing
* let oauth_problem_middleware recognize all OAuth exceptions
* scope problem should return 403
* excepting two classes makes more sense than subclassing hacks
- App and Api options must be provided through the "options" argument (``old_style_options`` have been removed).
- You must specify a form content-type in 'consumes' in order to consume form data.
- The `Operation` interface has been formalized in the `AbstractOperation` class.
- The `Operation` class has been renamed to `Swagger2Operation`.
- Array parameter deserialization now follows the Swagger 2.0 spec more closely.
In situations when a query parameter is passed multiple times, and the collectionFormat is either csv or pipes, the right-most value will be used.
For example, `?q=1,2,3&q=4,5,6` will result in `q = [4, 5, 6]`.
The old behavior is available by setting the collectionFormat to `multi`, or by importing `decorators.uri_parsing.AlwaysMultiURIParser` and passing `parser_class=AlwaysMultiURIParser` to your Api.
- The spec validator library has changed from `swagger-spec-validator` to `openapi-spec-validator`.
- Errors that previously raised `SwaggerValidationError` now raise the `InvalidSpecification` exception.
All spec validation errors should be wrapped with `InvalidSpecification`.
- Support for nullable/x-nullable, readOnly and writeOnly/x-writeOnly has been added to the standard json schema validator.
- Custom validators can now be specified on api level (instead of app level).
- Added support for basic authentication and apikey authentication
- If unsupported security requirements are defined or ``x-tokenInfoFunc``/``x-tokenInfoUrl`` is missing, connexion now denies requests instead of allowing access without security-check.
- Accessing ``connexion.request.user`` / ``flask.request.user`` is no longer supported, use ``connexion.context['user']`` instead
- Created a metaclass for AbstractAPI (it is used to set the jsonifier for the class);
- Created a new class method AbstractAPI._set_jsonifier;
- Changed the code to use the new jsonifier interface;
- Create a new module called coroutines_wrapper to put the wrapper functions with the 'yield from' statement. It is used to enable frameworks with coroutine handlers;
- Did the AioHttpApi.get_request coroutine and add req.read() to get the request body;
- Moved the flask jsonifier to utils and did it a generic jsonifier;
- Created a function called 'has_coroutine' on utils module;
- Added aiohttp_jinja2 to requirements-aiohttp;
- Added a new python3 coreragerc file to skip only python2 lines;
- Fixed the set of validation_response on test_aiohttp_simple_api.py;
- Added the test to check the aiohttp body request;
- Fixed the response for 'aiohttp_bytes_response' and 'aiohttp_non_str_non_json_response' paths on aiohttp/swagger_simple.yml file.
- Added a note to create aiohttp handlers;
- Added a new parameter on AioHttpApp.__init__ to choose create only one api. With this parameter we can create an api with a empty base_path;
- Added exceptions messages on AioHttpApp.add_api method;
- Created new tests for AioHttpApp.add_api.