Commit Graph

1169 Commits

Author SHA1 Message Date
Mohab Usama
db6a5fb8e0 fix readme (#585) 1.4.2 2018-05-16 10:47:03 +02:00
Jeremiah
830711c8fb Make compatible with latest gevent version (#583)
See https://github.com/gevent/gevent/blob/master/CHANGES.rst#13b2-2018-05-03
```
The long-deprecated and undocumented module gevent.wsgi was removed.
```
1.4.1
2018-05-14 21:36:54 +02:00
Daniel Grossmann-Kavanagh
5bc8a788aa fix 500 in sqlalchemy example (#581) 2018-04-27 08:13:30 +02:00
Henning Jacobs
6cad83c383 Merge branch 'dutradda-aiohttp_support' 1.4 2018-04-09 21:25:33 +02:00
Henning Jacobs
bbff57ca6e fix wording 2018-04-09 21:25:17 +02:00
Henning Jacobs
b775d4de05 Merge branch 'aiohttp_support' of https://github.com/dutradda/connexion into dutradda-aiohttp_support 2018-04-09 21:22:55 +02:00
Diogo Dutra
afbd4789fa updated the aiohttp version 2018-02-19 17:20:50 -03:00
Ishaan Kumar
9f20c5ffb7 Minor typo (#567) 2018-02-13 10:55:20 +01:00
Shaun Kaasten
a4cabb23ae Allow token_info response to use 'scopes' key (#565) 2018-02-08 16:30:00 +01:00
Diogo Dutra
8f4ff0313d Changes for aiohttp support:
- 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.
2018-02-05 13:35:56 -02:00
Diogo Dutra
cce83b5786 Merge pull request #1 from prawn-cake/aiohttp_support_refactoring
Test refactoring + some aiohttp_api updates
2018-02-03 23:36:44 -02:00
Maksim Ekimovskii
2841697b9e aiohttp tests: simplify folder layout; naming refactoring. Small aiohttp_api refactoring + tests; Extend aiohttp swagger files and fake apis. Problem with request body for aiohttp handlers remains; 2018-02-03 17:40:03 +02:00
Diogo
fdaaa28d9b Changes:
- 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.
2018-01-18 18:25:50 -02:00
Diogo Dutra
1408dbeb19 Added an aiohttp lib validation on cli 2018-01-18 14:27:08 -02:00
Diogo Dutra
34b4f941aa Added some documentation for aiohttp backend 2018-01-18 14:27:08 -02:00
Diogo Dutra
d1565cf259 Changes requested by @prawn-cake:
- Unified the python version checking
 - Fixed the endpoint name registration on AioHttpApi
2018-01-18 14:27:08 -02:00
Diogo Dutra
09daab63ca Changed the cli script:
- created a new option called 'server'
 - did wsgi-server option deprecated
 - changed the app-cls option to app-framework
 - fixed the possible frameworks that will run the app
 - added a validation on framework/server selection
2018-01-18 14:27:08 -02:00
Diogo Dutra
8328507f88 fixed flake8 issues 2018-01-18 14:27:02 -02:00
Diogo Dutra
51449d4dd4 Changes requested by @prawn-cake:
- improved the code on __init__ when aiohttp was not installed;
 - renamed the ujson package to json on import;
 - renamed the AioHttpApi.aiohttp_api property to AioHttpApi.subapp. I choose the name "subapp" because it works like the flask blueprint. The AioHttpApp.add_api uses the add_subapp method of the aiohttp Application;
 - changed a if/else setence to a more concise version;
2018-01-18 12:53:58 -02:00
Diogo Dutra
f24ca441dc Changes did on the base code to support aiohttp
- Added the AioHttpApi and AioHttpApp on connexion __init__;
- Created an abstract method on AbstractApi to cast the framework response to connexion response;
- Implemented the get_connexion_response on FlaskApi;
- Changed the CLI to use any kind of App class;
- Changed the ResponseValidator to always convert the response to a connexion response;
- Changed the ResponseValidator to support coroutine responses;
- Added the aiohttp as optional dependency;
- Added ujson as optional dependency;
- Skipped the aiohttp tests run on python 2.7;
- Changed the tests configs to run aiohttp tests properly on python 3.4+.
2018-01-18 12:53:58 -02:00
Diogo Dutra
5ce51450fe Addded aiohttp support 2018-01-18 12:53:57 -02:00
Henning Jacobs
4486438e70 run tests against PyPI dependencies for release (#561)
* run tests against PyPI dependencies for release

* fix docs format
2018-01-13 19:57:28 +01:00
Henning Jacobs
7199745862 Fix tests (#560)
* isort

* no longer test dev dependencies on Travis
2018-01-13 19:48:43 +01:00
Henning Jacobs
a566aeba85 Merge branch 'MaicoTimmerman-master' 2018-01-13 18:28:38 +01:00
Henning Jacobs
a64884075e README for local validation 2018-01-13 18:28:27 +01:00
Maico Timmerman
546782a8d6 Updated docs and README 2018-01-10 23:05:44 +01:00
Maico Timmerman
a17caefd8e Added option for local function token lookup. 2018-01-10 22:59:06 +01:00
Mikko Valkonen
f4bc6dc71b FIX a typo causing an ERROR log (#523)
* FIX a typo causing an ERROR log

A small bug was introduced in #500 when sanitizing the request query
parameters. Instead of fetching the arguments from `request.query`,
the parameters were sanitized from the `request.form`. This causes an
error log to be printed, as the parameters are not expected for the
query (for example in the case of a POST request).

Fixes #504

* adds a fixture for testing query param sanitazion

Adds a simple fixture to test form and query parameter sanitazion. This
is mostly related to #522, in which the `formData` parameters were
treated as query parameters.

* add a test to validate form data params

* introduce testfixtures library
1.2
2017-11-16 13:04:06 +01:00
Mikko Valkonen
0918a9efec refactor catch-all exceptions (#545)
The flake8 checks were failing for py3.5 due to a couple of catch-all
exceptions when importing tornado and gevent libraries. Refactored to
catch the `ImportError`
2017-11-15 08:35:54 +01:00
Mohab Usama
a275f7b0e2 Use Authorization headers for verifying token info (#542)
* Use Authorization headers for retrieving token info

* Fix flake8

* Adjust token info example

* Only accept Authorization headers in test
2017-11-14 18:13:41 +01:00
Yigal Lazarev
f846126d42 Restoring Flask-Injector support by passing "undocumented" path parameters to the handler (#526)
* Restored Flask-Injector support

* Added a unit test to verify injection works (#469)

* Changed unittest to support Python 2
1.1.16
2017-10-11 21:44:40 +02:00
Jeremy
6af5dff3de Update CORS documentation (#524)
Resolved error since flask cors was moved to its own project: `ExtDeprecationWarning: Importing flask.ext.cors is deprecated, use flask_cors instead.`

Will also require installation `pip install -U flask-cors`
2017-10-10 23:22:42 +02:00
John Krukoff
94f64b80e1 Allow http.HTTPStatus enums as response status codes. (#504)
* Allow http.HTTPStatus enums as response status codes.

Python 3.5 introduced a new enumeration "http.HTTPStatus" for
representing HTTP response status codes. The default response validation
introduced in connexion 1.1.12 highlighted the fact that connexion does
not natively support this type and was previously silently ignoring
non-integer status code representations.

This modifies the response validation code to extract the value when
given an enum instead of an int. Somewhat hacky test code is added to
check for enum support on python versions that include
"http.HTTPStatus".

* [master]: Restructure tests from PR comments.

* [master]: Revert to exception based version checking.

This reverts to exception based python version checking for both tests,
due to the suggested unittest skipping alternative not being supported
in all python versions.

"unittest.case.SkipTest: Not supported in this version" is the error
reported.

* [master]: Move enum handling deeper into the stack.

* [master]: Respond to yet more PR comments.
2017-10-05 09:08:59 +02:00
Dan Fairs
7811708fd9 Include a link to the changelog (#521)
Fixes #519
2017-09-30 11:43:48 +02:00
Michael Duergner
56de5aaea5 Add inbound license notice (#515)
Contributors need to be made aware of the terms and conditions under which they contribute to this repository.
2017-09-22 08:59:49 +02:00
Lance Hannestad
f36c24685b Preserving the multiplicity of array type query parameters (#500)
* Preserving the multiplicity of array type query parameters

* Resolved failing tests, and refactored code block into a method

* Added tests for multi array

* Refactored parameter.py and updated tests in test_parameters.py
1.1.15
2017-09-08 15:18:47 +02:00
Rafael Carício
08dd554ad3 Merge pull request #508 from MikeRalphson/patch-2
Tests; remove duplicate test of missing_op_id in debug mode
2017-08-31 11:52:34 +02:00
Mike Ralphson
d7cea4e1b3 Tests; remove duplicate test of missing_op_id in debug mode 2017-08-31 10:26:22 +01:00
Ronaldo Ferreira
f2923148f8 Fix UnicodeEncodeError for query-strings on Python 2 (#507)
* Fix UnicodeEncodeError for query-strings on Python 2

* Fix test for Python 3.4 and 3.5
1.1.14
2017-08-28 18:52:10 +02:00
Rafael Carício
b34ee7c2e3 Merge pull request #506 from mvalkon/fix/minor_fixes
Fix the examples
2017-08-16 11:21:42 +02:00
Mikko Valkonen
dedc5d1450 fix the enforcedefaults example
The enforcedefaults example did not run as the port (9090) was passed as
the server parameter.
2017-08-16 11:38:42 +03:00
Mikko Valkonen
3833cb10e7 fix the helloworld example
The helloworld example did not run as the port (9090) was passed as the
server parameter.
2017-08-16 11:38:37 +03:00
Mikko Valkonen
b3d04a615d Fix exception string formatting
When the `Exception` was raised for unknown server, the string format
followed the logging-module style of formatting in which the variable
to insert is passed as a parameter to the logging call. This doesn't
work and produced an unhelpful error message.
2017-08-16 10:42:18 +03:00
João Santos
ea955c3434 Merge pull request #497 from f11r/master
Fix KeyError if no Content-Type was provided in request
2017-08-15 09:33:33 +02:00
Fiete Gruenter
07ce38b484 Move import to top level. 2017-08-15 09:09:12 +02:00
Fiete Gruenter
ee72325345 Implement hacky workaround for passing environ to test_client.open() for no-content-type-test since old flask<=0.12.2 does not support it. 2017-08-04 09:30:25 +02:00
Fiete Gruenter
bf66cc726d Add a test that posts a requests without sending Content-Type in the header. 2017-08-03 12:43:48 +02:00
Fiete Gruenter
26031bc9ad Fix KeyError if no Content-Type was provided in request. 2017-08-02 13:37:15 +02:00
Bence Nagy
d51e9c8a4c setup.py: Use env markers for Python version-specific dependencies (#495)
* setup.py: Use env markers for Python version-specific dependencies

Changing package properties dynamically in setup.py means that universal
wheels will actually be built only for the builder's environment, and
might not work properly on different platforms/PYthon versions.

Closes https://github.com/zalando/connexion/issues/493

* travis: Upgrade setuptools before running tests

* reqs: Stop installing pathlib from mercurial in dev mode

The mercurial repo is at 0.8 while the latest release on PyPI is 1.0.1
1.1.13
2017-07-29 12:28:13 +02:00
gb-dsigmeth
78e962f5f4 Fix for Issue #308: MockResolver: support "example" in definitions (#491)
* Fix for Issue #308: MockResolver: support "example" in definitions

* Improve handling of not existing refs.

* Improve handling of not existing definitions.

* Leave the error message the same.

* Support examples for inline shchema definition.
2017-07-21 23:10:47 +02:00