Commit Graph

1169 Commits

Author SHA1 Message Date
Daniel Grossmann-Kavanagh
ab430afaf5 Fixes #1020, OAS3 false positive for extra form param (#1124)
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.
2020-01-21 09:49:46 +01:00
Daniel Grossmann-Kavanagh
1abab0653f scope deepObject defaults code to query params only (#1110)
* scope deepObject defaults code to query params only (fixes spread of defaults into other parameters)

* make default param test strict
2020-01-20 10:21:08 +01:00
Henning Jacobs
77f2861880 Merge pull request #1127 from dtkav/bug/1116/sanitized_path_param_types_aiohttp
fix pythonic path param types in aiohttp
2020-01-15 12:05:07 +01:00
Henning Jacobs
0766df50b6 Merge pull request #1125 from dtkav/pyyaml_5_3_datetime_update
Fixes Build: Allow new datetime behavior in PyYAML 5.3
2020-01-15 12:04:19 +01:00
Daniel Grossmann-Kavanagh
667ceba45c use non-sanitized path param name when getting the path definition from the spec 2020-01-14 18:26:31 -08:00
Daniel Grossmann-Kavanagh
f575f0e54d update tests to allow new datetime behavior in PyYAML 5.3 2020-01-14 17:37:00 -08:00
Henning Jacobs
f55cb1c923 Merge pull request #1075 from mblaettler/feat/enable-empty-security
enable empty security definition
2020-01-06 13:39:20 +01:00
Henning Jacobs
28860670e8 Merge pull request #1113 from pando85/fix/python3.8-aiohttp-access_log
Fix: aiohttp access_log duplicated if passed as argument
2019-12-25 16:56:32 +01:00
pando85
917956cc2f Fix: aiohttp access_log duplicated if passed as argument
- Pop access_log option from aiohttp options
  - Add test to access_log options in aiohttp run
2019-12-24 14:24:14 +01:00
Henning Jacobs
f31ac615bf Merge pull request #1109 from spacether/issue_1108_py27_fix
Don't allow connexion installation in py27
2.5.1
2019-12-18 19:43:44 +01:00
Justin Black
5666ea770a Adds Programming Language :: Python back in 2019-12-18 09:58:11 -08:00
Justin Black
4278d4efdf Adds python_requires to setup.py 2019-12-18 09:51:17 -08:00
Justin Black
44910e1dea Removes python 2 from setup.py 2019-12-18 09:44:30 -08:00
Michael Blättler
b14e235108 enable empty security definition
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>
2019-12-18 08:15:09 +01:00
Henning Jacobs
c08111b6db Merge pull request #823 from dtkav/dynamic_ui_path
Serve correct openapi spec basepath when path is altered by reverse-proxy
2019-12-17 10:30:53 +01:00
Daniel Grossmann-Kavanagh
e85960947f Merge branch 'master' into dynamic_ui_path 2019-12-17 11:42:35 +11:00
Henning Jacobs
f6e8b8c9ea Merge pull request #1105 from zalando/release-script
Release script
2019-12-16 14:56:07 +01:00
Henning Jacobs
e0a02ed77e use non-signed tag 2.5.0 2019-12-16 14:41:50 +01:00
Henning Jacobs
7240f94748 fix release.sh to succeed 2019-12-16 14:39:38 +01:00
Henning Jacobs
852eca0e0f Remove six (Python 2 support) (#1102)
* remove some six uses (Py2)

* remove more six usages

* no need for "object" in Py3

* remove remaining six uses
2019-12-13 21:12:53 +01:00
Patrick Wang
e3f0279de2 Test schema corrections (#1010)
* fix `style: csv` in test spec

`csv` is not allowed for `type: array` with `in:query`, per https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#style-values

* fix `style: simple` in query param test spec

`simple` is not allowed for `type: array` with `in:query`, per https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#style-values

* fix `style: simple` in form-param test

`simple` is not allowed for `type: array` in `requestBody`, per https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#encoding-object and https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#style-values

* fix empty `responses` in test spec

"The `Responses Object` MUST contain at least one response code" - https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#responses-object

* make name required

> If the parameter location is "path", [the field `required`] is REQUIRED and its value MUST be true.

https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#fixed-fields-10
2019-12-13 08:42:48 +01:00
Daniel Grossmann-Kavanagh
d287fcc4bd Revert "Fixes #510 in upstream: multiple file uploads via POST now work correctly. (#1000)" (#1101)
This reverts commit 4a1c69e372.
2019-12-13 08:30:49 +01:00
Roberto Polli
9fdd9587e6 Fix: #910. Add swagger-ui to requirements. Update connexion version. (#911) 2019-12-12 18:29:09 +01:00
Daniel Grossmann-Kavanagh
5abdcbb859 Fix test that relies on the repo folder being named Connexion 2019-12-12 08:02:42 +00:00
Daniel Grossmann-Kavanagh
dd5f29b444 remove check for python versions less than 3.5 2019-12-11 18:27:34 -08:00
Daniel Grossmann-Kavanagh
d0efe57433 fix deprecated logging.warn calls in reverse proxy examples 2019-12-11 18:23:08 -08:00
Daniel Grossmann-Kavanagh
26249b9572 fix yaml spec creation 2019-12-11 18:17:14 -08:00
Daniel Grossmann-Kavanagh
154d367a9e use yaml.BaseLoader in test to remove warning 2019-12-11 18:16:15 -08:00
Julien Sagnard
a6496975de Improve with PR comments 2019-12-11 17:59:43 -08:00
Daniel Grossmann-Kavanagh
c672c85c00 add tests for reverse proxies 2019-12-11 17:58:15 -08:00
Daniel Grossmann-Kavanagh
2b23b75ce0 add aiohttp reverse proxy example 2019-12-11 17:58:15 -08:00
Daniel Grossmann-Kavanagh
93fe858922 add reverseproxy example 2019-12-11 17:58:15 -08:00
Daniel Grossmann-Kavanagh
0892baeecd modify spec base_path on request 2019-12-11 17:58:15 -08:00
Daniel Grossmann-Kavanagh
2267f45409 use url_for to reverse the route for openapi.json 2019-12-11 17:57:36 -08:00
Jyhess
d18c387d94 Return tuple for aiohttp (#849)
* 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
2019-12-11 12:54:44 +01:00
svetlana-v
50f640a33a Pop apiKey from query parameters in security decorator to fix #470 (#1077) 2019-12-11 12:49:40 +01:00
Marco Favorito
7cbeb7565a Forward options to the AioHTTP app. (#885)
* 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.
2019-12-08 23:41:12 +01:00
Brad Belyeu
2f345f9710 Remove unused metavar (#900)
* 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`
2019-12-08 23:12:49 +01:00
Alberto Massidda
3446508c3d fixed mocks not honouring OpeanAPI 3 examples standard (printing "value" key in output examples) (#1091) 2019-12-03 22:05:50 +01:00
Cédric Messiant
35d5294d78 Allow users to enable debug mode via environment variables (#1084) 2019-12-03 22:04:15 +01:00
Eugene Fabrikant
6f600234fe Updated API Key example link to correct location (#1089)
* Updated API Key example link to correct location

* Fixed example href location per PR feedback
2019-12-03 22:03:01 +01:00
Jyhess
db4459fa20 Datetime serialization (#851)
* Add datetime and uuid serialization for AioHttp

* Remove ujson dependency

* fix merge error

* Retry CI

* remove bad jsonifier import

* remove ujson import
2019-12-03 05:23:36 +01:00
Davy Durham
9925789820 [#935] supporting application/json within multipart/form-data request body (#980)
* [#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
2019-12-03 05:12:49 +01:00
Peter Bašista
738f47ed50 Do not sanitize body keys in OpenAPI 3 (#1008)
* 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.
2019-12-03 05:01:49 +01:00
Terry Corley
c4c7e677f0 Fix return type docstring for get_response (#912) 2019-12-03 00:08:57 +01:00
Alberto Massidda
6dc2b7fada Fixed mocking function not working with examples under numeric status codes (e.g., 200) , due to status code string being casted as integer and not raising a ValueError. (#1088)
Included tests that break without the patch (it was testing for 'default' only, but not for numeric codes like '200')
2019-12-03 00:06:50 +01:00
drewdogg
16ef766b89 Fix unit tests on Windows (#1071) 2019-12-03 00:05:45 +01:00
Christian Siegel
67f48ae24d Add swagger_ui_config option to pass config to the Swagger UI (#948)
* 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
2019-11-05 10:12:59 +01:00
simondrabble
4a1c69e372 Fixes #510 in upstream: multiple file uploads via POST now work correctly. (#1000) 2019-11-05 10:08:17 +01:00
Tomasz Trębski
a4300026ed Clean up dropping Python 3.{4,5} (#1057)
This is a follow up for c8d8973c7e
(dropping Python 3.5). There waere some leftovers in requirements for
Pythonv versions `connexion` no longer supports.
2019-10-27 23:14:56 +01:00