Commit Graph

28 Commits

Author SHA1 Message Date
Daniel Grossmann-Kavanagh
2f074998e3 URI parsing decorator (#613)
- array logic refactored into one place.
- validation.py and parameter.py no longer try to join the array, and the split it again.
- validation of defaults now works, because the validator is given the correct type.
- some additional classes that change the behavior of deduplicating query parameters that are defined multiple times
  - **AlwaysMultiURIParser** that is backwards compatible, warts and all (used by default)
  - **Swagger2URIParser** that adheres to the spec's definition of `collectionFormat: multi` and uses the last-defined query parameter value (ex. `query?a=1&a=2` => `a = 2`)
  - **FirstValueURIParser** that behaves like Swagger2URIParser, except that the first-defined value is used (ex. `query?a=1&a=2` => `a=1`)
2018-07-09 11:06:24 +02:00
Daniel Grossmann-Kavanagh
0b19ed489a Update to swagger-spec-validator 2.3.1 (fixes #612) (#611) 2018-07-03 08:21:43 +02:00
Rodrigo di Lorenzo Lopes
9a8bddf509 solving fixed argument (server) for FlaskApp (backward incompatible and undesired change) 2017-06-06 14:44:17 +02: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
2ddebfdbe2 did changes requested by isort-check 2017-04-04 08:20:25 -03: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
Leena Bhegade
f7b3d9a0bb add parameter to decode 2017-02-08 23:48:04 +00:00
Leena Bhegade
c1020bf0f6 Fix tests 2017-02-08 21:31:35 +00:00
Rafael Caricio
108d0a6760 Fix imports ordering 2016-12-10 20:24:14 +01:00
Rafael Caricio
3b5bb13276 Refactor code to fix confusion with returned values 2016-12-10 19:54:27 +01:00
Daniel DeFisher
34adf1b18e Swap import statements 2016-11-05 18:28:48 -04:00
Daniel DeFisher
01315b5178 Fix import order 2016-11-05 14:59:15 -04:00
Daniel DeFisher
1e82c66f29 refactor param names 2016-10-18 09:22:45 -04:00
Daniel DeFisher
5a6cdb51a2 Support app.add_api() with API-dictionary as an alternative to file path 2016-10-12 23:12:44 -04: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
jkozlowicz
bfc68da1ec Fixed the coding style errors 2016-06-06 15:03:23 +02:00
jkozlowicz
bd25c5ca74 Corrected the Content-Type header for /basePath/swagger.json to return application/json and added a test for that 2016-06-06 14:21:15 +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
Greg Brockman
a6cc07cca8 Make JSON printing a bit nicer 2016-04-04 21:59:54 -07:00
David Feinzeig
0c177c7539 make swagger_json optional when adding an api 2016-03-29 00:00:27 -04: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