Commit Graph

1169 Commits

Author SHA1 Message Date
Sławomir Zborowski
2bc7bc0ffe Proper debug logs for aiohttp's StreamResponse (#787)
Signed-off-by: Sławomir Zborowski <slawomir.zborowski@nokia.com>
2018-11-23 08:34:46 +01:00
krise3k
fa9c00a191 Run travis on python3.7 (#790) 2018-11-22 08:32:36 +01:00
Daniel Grossmann-Kavanagh
72b16676cf simplify Operation class construction (#726)
* simplify *Operation creation

* move Specification classes to separate file
2.0.2
2018-11-15 07:45:59 +01:00
Christoph Ziebuhr
94686c0974 Don't let openapi_spec_validator tamper raw spec (#762) 2018-11-13 14:41:59 +01:00
krise3k
2fc255f86d Fix link to example in JWT docs (#776)
Fix not working link to example in JWT docs.
2018-11-13 13:38:30 +01:00
The UNIX Man
b66aee3089 collectionFormat doesn't need the ' (#778)
It's plural.
2018-11-13 13:37:34 +01:00
The UNIX Man
6bf058f6b7 Use / instead of \ (#777)
URIs use forward slashes.
2018-11-13 13:36:49 +01:00
Daniel Grossmann-Kavanagh
343643428c update documentation (#771) 2018-11-12 09:40:42 +01:00
Daniel Grossmann-Kavanagh
ddd5eeb5cb rename bandit.yaml to bandit.yml (#773)
Fixes #679
2018-11-12 09:15:58 +01:00
krise3k
6ec11825b8 Add support for JWT authentication (#732)
* Add support for JWT

* Add example for JWT

* Add minimal JWT documentation
2018-11-12 08:53:50 +01:00
Daniel Grossmann-Kavanagh
fcba5afcf7 Remove type hint for options kwargs (#766)
* remove type hint for options in App.run(...)

* also remove type hint from flask_app.py
2018-11-09 08:58:38 +01:00
Daniel Grossmann-Kavanagh
53dffc0b78 Only pass body on PATCH/POST/PUT request (#761)
Fixes #757
2018-11-09 08:27:08 +01:00
Daniel Grossmann-Kavanagh
638e4e6455 Add connexion.operation dummy module for backwards compatability (#758)
- add connexion.operation dummy module that proxies connexion.operations.(Fixes #752)
2018-11-09 08:16:53 +01:00
Daniel Grossmann-Kavanagh
296f89217d Enforce that spec has string keys (JSON does not support integer keys) (#763)
Fixes #756
2018-11-09 08:06:16 +01:00
Daniel Grossmann-Kavanagh
fdac62726d Use server_spec option in cli.py instead of swagger_ui (#745)
- gets rid of deprecation warning when using `connexion run ...` (Fixes #747)
2.0.1
2018-11-07 08:34:47 +01:00
Henning Jacobs
845d4255ab Update docs version to 2.0 (#744)
- Fixes #717 for now.
2018-11-07 08:15:37 +01:00
Daniel Grossmann-Kavanagh
57001c0238 Handle TypeValidationError in form-data (#749)
- handle `TypeValidationError`s in form-data (Fixes #748)
2018-11-07 08:14:04 +01:00
Daniel Grossmann-Kavanagh
0c5ddd67e5 Pass files to handler if filename in arguments _or_ has_kwargs (#753)
- pass file if filename in arguments _or_ has_kwargs (Fixes #750)
2018-11-07 08:09:17 +01:00
João Santos
44ea9336fe Connexion 2.0 (#619)
- 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
2.0.0
2018-11-05 14:50:42 +01:00
Daniel Grossmann-Kavanagh
08faf2aa86 disable threading in sqlalchemy demo (in-memory db) (#709)
- disable threading in sqlalchemy demo
2018-10-04 14:55:30 +02:00
Roberto Polli
1596f18b3d Fix: #582. Describe logging (#693)
- Show how to configure the logger
- Show how to access the logger
2018-10-04 08:41:21 +02:00
Tomasz Trębski
2b6169aade Fix bad parsing of query params for AioHttp (#697)
* Fix bad parsing of query params for AioHttp
2018-09-27 09:04:55 +02:00
Andrzej Górski
7e8435aea5 fix "Crafting effective Microservices in Python" blog post url (#685) 2018-09-17 18:26:29 +02:00
dmksnnk
1c0bd7d0f8 Add x-nullable support for body validators (#642)
* add x-nullable support for body validators

* add check for Iterable
1.5.3
2018-09-17 08:13:12 +02:00
fdemello
cbca315326 Update routing.rst (#674)
Changes proposed in #596
2018-09-14 09:12:20 +02:00
Diogo Dutra
b02023ce1c fix on utils.has_coroutine function (#600)
Fixed coroutinefunction verification when has async def.
   It is necessary because there's no @asyncio.coroutine decorator to validate
2018-09-13 11:57:39 +02:00
Daniel Grossmann-Kavanagh
83deb1fb1f skip codacy warnings about the use of assert in unit tests (#673)
The `assert` keyword is used in unit tests, but codacy flags this as an error.
This results in bad codacy grades for PRs that add unit tests.

Changes proposed in this pull request:
 - skip codacy warning/errors from using the `assert` keyword
2018-09-13 08:15:37 +02:00
fdemello
0adac4a135 Update README.rst (#675)
Changes proposed in #596.
2018-09-10 09:29:18 +02:00
gavronek
806bba12aa Improve metrics reporting (#672)
* Improve metrics reporting

* Switch default status to 500
2018-09-07 09:37:04 +02:00
Bartek Wójcicki
b6bb9ddf55 Add validator kind to error logs extra in validators (#671)
To easily discern response and request validation errors logs
programmatically (e.g. in logging filter).
2018-09-01 16:09:34 +02:00
João Santos
87f7003e1e Add Daniel Grossmann-Kavanagh as maintainer (#662) 2018-08-16 12:28:27 +02:00
Pavel Melnikov
6675ccc800 Fix body validator different error codes for bad Content-Types. (#629)
Fixes #628 .

 - Added a test for this bug.
 - Fixed it by checking for non-empty HTTP POST payload by considering request.body, request.form and request.files (only request.body was checked)
2018-08-14 13:22:03 +02:00
Tomer Cohen
ccd62f897f fix link to odata (#661)
Link has markdown syntax in a reStructuredText document.
2018-08-08 20:29:30 +02:00
João Santos
9f48a767a4 Accept only 👍 from Zalando Employees
Merges to master should only be allowed for members of the Zalando Organization
2018-08-07 15:42:16 +02:00
Daniel Grossmann-Kavanagh
79e0e3db4d isort... 1.5.2 2018-07-25 08:50:30 +02:00
Daniel Grossmann-Kavanagh
212820bf35 add more test cases for form params 2018-07-25 08:50:30 +02:00
Daniel Grossmann-Kavanagh
9a3f149cbc make uri parsing test more uniform 2018-07-25 08:50:30 +02:00
Daniel Grossmann-Kavanagh
0e83b1ee3c Also parse form parameters in Swagger2URIParser 2018-07-25 08:50:30 +02:00
Craig Blaszczyk
76ff6682ca Use Connexion logger 1.5.1 2018-07-23 15:56:12 +02:00
Diogo Dutra
e326711aa4 Increase the code coverage (#631)
removed the validate_defaults method from Operation because the new swagger_spec_validation version do this validation
    added tests for AbstractApi._handle_add_operation_error
1.5.0
2018-07-21 13:15:55 +02:00
Stephen Kwong
ee07865b78 Add capability to pass framework's request context to handler functions 2018-07-13 08:41:01 +02:00
Pavel Melnikov
5333d31d05 Minor change in readme about non-required parameters (#625)
I think "non-named" word was ill-placed here (at least I did not understand what it meant). I tried to clarify this better and propose a solution to not get a exception.
2018-07-12 21:00:08 +02:00
Pavel Melnikov
0c352cd4da Correct validator response on bad JSON (#610)
* report 400 Bad Request if validation fails to parse JSON while Content-Type is json.
2018-07-10 09:43:44 +02:00
Daniel Grossmann-Kavanagh
1f734d56e8 add oas3 test fixtures (#616) 2018-07-09 20:34:03 +02:00
Diogo Dutra
b42f02435a create a new method AbstractAPI._validate_spec (#564)
Created a new method AbstractAPI._validate_spec  to encapsulate the specification validation.
2018-07-09 11:08:41 +02:00
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
Lenz Grimmer
50bcd120f6 README.rst: replaced MarkDown formatting with their ReST equivalentsImproved formatting by replacing MarkDown formatting with the appropriateRestrucuredText counterparts, fixed notes and warnings to use ReST.Signed-off-by: Lenz Grimmer <lenz@grimmer.com> (#615) 2018-07-03 08:59:15 +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
Zach Bloomquist
1fbb1ff941 Clarify the x-tokenInfoFunc interface (#609) 2018-06-28 07:37:53 +02:00
Alexey
31358f0a18 Improve docstring for AbstractApp.add_api (#589)
Specification argument can be a string, yet docstring disallowed that.
2018-06-06 22:02:26 +02:00