Commit Graph

29 Commits

Author SHA1 Message Date
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 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
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
2017-11-16 13:04:06 +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
Rafael Carício
93c06711ed New style of passing options to Connexion (#436)
* Order classes by relevance in module

* Order definitions by relevance within module

* Swagger UI options extracted

* New style options

* Use new-style options

* Reuse code

* Sort imports

* Ignore typing imports

* Warn users about parameter name change

* Add back isort check

* Fix isort check
2017-04-11 16:47:21 +02:00
Rafael Carício
1858c9d4a0 Flask required only if necessary (#424)
* Example with Flask support

* Only show import error when trying to use Flask

* Re-organize imports

* Move flask_utils next to related module

* Code style

* Change back to incentivizes

* Includes Flask by default

* Project clean up

* Update Rafael Caricio's e-mail address

* Fix conflicts
2017-04-04 20:48:08 +02:00
Diogo Dutra
3952ea2771 did changes requested by isort and flake8 2017-04-04 08:20:25 -03:00
Diogo
5857dd237f Uncouple all flask functions from base code.
removed test_decorators and test_parameter (this test is useless now);
removed the request/response containers and add new request response classes;
created a abstract api class and a api flask class;
derived classes will implements the get_response/get_request methods that will convert framework req/resp types to connexion req/resp types;
moved the jsonifier from produces to flask api;
created a abstract app class and a app flask class;
changed all validators to use the ConnexionRequest instead flask request;
changed the problem function to generate a ConnexionRequest;
created a new user variables container called context (this is a property of ConnexionRequest). this will be passed as kwargs to all operations functions;
this context is used on authentication;
fixed all tests to new API;
some changes that I did may not be documented in this commit.
2017-04-04 08:20:24 -03:00
Diogo Dutra
a7af62fbf0 Uncouple flask from App and Api. Created Abstract classes for theses modules. Fixed the tests 2017-04-04 08:20:23 -03:00
Dan Ballance
702142ec48 Fixes #340 | Convert camelcased parameter names to Python style 2017-03-09 16:42:17 +00:00
Rafael Caricio
9b036923ec Fix annoying typo 2016-12-10 22:37:40 +01:00
Rafael Caricio
3b5bb13276 Refactor code to fix confusion with returned values 2016-12-10 19:54:27 +01:00
Yoan Blanc
be437a980b Fix isort checks 2016-10-16 11:32:11 +02:00
Jens Finkhaeuser
74cec244b4 Fixes after running & fixing TOXENV=isort-check tox 2016-09-13 16:24:28 +02:00
Jens Finkhaeuser
9d4a40ee38 Merge branch 'fix-missing-operation-id' into bad-operation-id-to-5xx
See #274 for discussion.
2016-09-13 15:37:23 +02:00
Jens Finkhaeuser
328aa51f6c Fix isort errors. Some of these look like they're not from my branch to
begin with.
2016-09-12 13:56:29 +02:00
Jens Finkhaeuser
3cd04f8b8d Add test cases for the resolver_error flag. That's what it should do,
next up: the implementation.
2016-09-09 11:52:05 +02:00
Jens Finkhaeuser
f804a96a45 It's bad practice to derive custom exception classes from BaseException.
See https://www.python.org/dev/peps/pep-0352/
2016-09-07 13:36:36 +02:00
Dylan Semler
b7c6dede95 Add flag for strict_validation on extra parameters 2016-07-31 20:21:19 -04:00
Rafael Caricio
654df09838 #256 🎯 identify the bug 2016-07-27 22:57:23 +02:00
Arjun Naik
dba916c354 Fix for when parameter spec is unordered. 2016-05-17 16:29:32 +02:00
Rafael Caricio
c30bdbb324 Fix import sorting in examples and tests 2016-04-08 14:33:27 +02:00
Rafael Caricio
a86b96c5e2 Sort imports in tests and examples 2016-04-08 14:33:27 +02:00
Rafael Caricio
6358c8c47d Adopt isort to ensure better code quality 2016-04-08 14:33:27 +02:00
João Santos
e4ab78b619 #173 Use new-style Python classes since we support Python 2.7 2016-03-08 08:08:47 +01:00
Rafael Caricio
6d5630e32d Increases significantly the test running time 2016-02-25 16:41:36 +01:00
Rafael Caricio
d6aac92eee Increase coverage 2016-02-25 15:41:11 +01:00
Rafael Caricio
a7aec5d53c Split tests in isolated modules 2016-02-25 14:49:19 +01:00
Rafael Caricio
2fec6e9259 Leave body param validation to external lib 2016-02-25 14:49:19 +01:00