Commit Graph

120 Commits

Author SHA1 Message Date
Robbe Sneyders
fb071ea56f Extract JSON request body validation to middleware (#1588)
* Set up code skeleton for validation middleware

* Add more boilerplate code

* WIP

* Add ASGI JSONBodyValidator

* Revert example changes

* Remove incorrect content type test

Co-authored-by: Ruwan <ruwanlambrichts@gmail.com>
2022-09-18 10:55:16 +02:00
Nico Braun
64f42547dc rename method view resolver and pass class args and kwargs to it (#1564)
Signed-off-by: Nico Braun <rainbowstack@gmail.com>
2022-07-05 00:27:05 +02:00
Nico Braun
3c6e13c1c1 call as_view in methodresolver (#1552)
* call as_view in methodresolver

Signed-off-by: Nico Braun <rainbowstack@gmail.com>

* allow to use deprecated method view resolver

Signed-off-by: Nico Braun <rainbowstack@gmail.com>

* update method view example

Signed-off-by: Nico Braun <rainbowstack@gmail.com>

* update method view docs

Signed-off-by: Nico Braun <rainbowstack@gmail.com>

* fix pre-commit issues

Signed-off-by: Nico Braun <rainbowstack@gmail.com>
2022-06-24 17:55:11 +02:00
Robbe Sneyders
ca70b16ff5 Drop aiohttp support (#1491) 2022-03-22 22:26:41 +01:00
Ruwann
85058ed3f1 Rework required_scopes checking (#1474)
* WIP: rework required_scopes checking

* Update tests for security scopes

* Add test for oauth security scheme with multiple possible scopes

* Update security tests

* Change optional auth test to correct behaviour

* Update security documentation

* Remove TODOs

* Catch possible exceptions from failed checks in async security factory

* Add .venv/ to gitignore

* Try to raise most specific exception

* Add test for raising most specific error

* Update async security handler factory

* Fix security handler error catching

* Fix imports order
2022-03-21 21:31:26 +01:00
Andrey Abramov
87a0fed4dc Remove obsolete code from basicauth example (#1486)
* Remove obsolete code

* Remove scopes completely

* Add hinting

* Remove outdated function from docs/security

* Revert "Add hinting"

This reverts commit faeea24c28bf88eead4015feea8f4dbd750cec1c.

* Change README for examples and other review fixes
2022-03-16 20:20:44 +01:00
Ruwann
3703a46d09 Add link to Flask JSONEncoder documentation (#1484) 2022-03-12 11:01:28 +01:00
Robbe Sneyders
d335e01fd2 Move x-body-name to requestBody level (#1475)
* issue 1452 - placement of x-body-name isnt valid OAS3 location for an extension

* issue 1452 - placement of x-body-name isnt valid OAS3 location for an extension

* add vim temp files to ignore

* issue 1452 - placement of x-body-name isnt valid OAS3 location for an extension - now at requestBody after review comment

* issue 1452 - placement of x-body-name isnt valid OAS3 location for an extension - now at operation after review

* removed unused import

* Move x-body-name into requestBody

* Update tests/fixtures/simple/openapi.yaml

Co-authored-by: Ruwann <ruwanlambrichts@gmail.com>

* Update README.rst

Co-authored-by: Ruwann <ruwanlambrichts@gmail.com>

* Update docs/request.rst

Co-authored-by: Ruwann <ruwanlambrichts@gmail.com>

* Update README.rst

Co-authored-by: Ruwann <ruwanlambrichts@gmail.com>

* Add deprecationwarning for x-body-name position

Co-authored-by: John Lonergan <john.lonergan@gmail.com>
Co-authored-by: Ruwann <ruwanlambrichts@gmail.com>
2022-03-07 18:09:21 +01:00
Ruwann
a67baa5be0 Use both class docstring and init docstring for autoapi (#1451) 2022-02-05 14:39:02 +01:00
Roger Camargo
7aeb3bdfb7 #1436: [Documentation] Add a flask error handler complete example (#1437)
* #1436: [Documentation] Add a flask error handler complete example

* #1436: [Documentation] Change to use the add_error_handler function
2021-10-22 08:36:29 +02:00
Ruwann
7c862e1ba8 Feature/relative resolver (#1419)
* Add a relative resolver

* Fix super() usage

* Apply suggestions from code review

* Allow root_path to be a Python module

* Expand documentation for RelativeResolver

* Add tests for relative resolver
2021-10-06 11:34:07 +02:00
soof-golan
2dfd57dafb Replace links of master in favor of main (#1421)
Replace links referring to the ``master`` branch in favor of ``main``
2021-09-02 10:46:43 +02:00
Ruwann
3195bec4e3 Add support for multiple security schemes in AND fashion (#1290)
* Add support for multiple security schemes in AND fashion

* Add test for operation with multiple security schemes combined using logical AND

* Add test for multiple oauth combined using logical AND
2021-07-16 08:46:15 +02:00
Robbe Sneyders
2066503c5c Add ARCHITECTURE.rst and module docstrings (#1368)
* Add ARCHITECTURE.rst and module docstrings

* fix flake8

Co-authored-by: Henning Jacobs <henning@zalando.de>
2021-07-09 17:49:54 +02:00
Henning Jacobs
594ded9a05 Document how to use a wildcard path parameter (#1398)
* Update cookbook.rst

* address review comments
2021-07-09 17:49:42 +02:00
Amin Alaee
3810da72b4 Add pythonic_params to routing docs (#1394) 2021-07-08 14:02:42 +02:00
Robbe Sneyders
e3dd3c9273 Add API reference documentation (#1390)
* Add auto generated api documentation

* Fix rst formatting errors

* Add flake8 rst docstring check
2021-07-06 23:33:20 +02:00
Christian Clauss
6c4f99051d Upgrade syntax for Python >= 3.6 (#1383)
* pyupgrade --py36-plus **/*.py

* Fix indentation

* Fix indentation
2021-07-04 20:04:22 +02:00
KarelChanivecky
51a3c84a59 Update security.rst (#1339)
Hi guys. There was a chunk of information missing from this page that was present in the main github readme, so I propose adding it here.
2021-06-24 14:04:31 +02:00
Paul Bruce
3531ef2c46 Add note about x-openapi-router-controller when using OAS (#1353) 2021-06-24 14:03:39 +02:00
Gabriele Labanca
8485b1b6f5 Update exceptions.rst (#1358)
Added import for Request in example code.
2021-06-24 14:01:34 +02:00
Drew J. Sonne
1b78f030cb Allow nesting of path resources in RestyResolver (#1265)
Fixes #206 - Handle nested paths in swagger definitions.

 - Allow nested paths to be handled in `get` and `search` handlers

An explicit decision has been made to resolve paths (with a prefix like `my.api`) like:
 - `/hello/{hello_id}/world` --> `my.api.hello.world:search(hello_id)`
 - `/hello/world/{world_id}` --> `my.api.hello.world:get(world_id)`
2020-07-20 09:07:01 +00:00
Jiehong
a21dd62b82 doc: improve documentation for Basic Auth 2020-07-20 07:20:37 +02:00
Jiehong
fa708ef984 doc: fix warnings on docs/request.rst 2020-07-20 07:20:37 +02:00
Qasim Albaqali
7e08135f57 Fix typo in security.rst from of to an or (#1158)
* Fix typo in security.rst from of to an or

Changed `of` to an `or`, I guessed a Dutch person wrote this and noticed it's one of the biggest gotchas to see if a Dutchie is the author.

* Changed 'of' to 'with a value of'
2020-04-23 23:12:54 +02:00
Mikko Nylén
0022e7f93e Document token_info argument (#1212)
Fixes #1188
2020-04-23 23:01:56 +02:00
Joseph Birkner
a250e5a59f Fixed spelling of uri_parser_class documentation (#1192) 2020-03-28 13:41:49 +01:00
Mark Foster
4b93890606 add documentation regarding resolver_errors 2020-01-22 07:33:00 +00: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
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
Tomasz Trębski
ec37d03902 Drop Python 2.7 support (#1058)
* Drop 2.7

* fixup! Drop 2.7

* fixup! Drop 2.7
2019-10-27 23:01:23 +01:00
rgmerk
c94fa6127a Instructions for deploying on modwsgi (#1018) 2019-10-18 12:41:39 +02:00
Asbjørn Apeland
485380d54f Document how to set Swagger UI path (#1051) 2019-10-09 18:28:14 +02:00
Albert Suarez
1a9db69583 Fixed [connextion] typo in documentation page (#1049) 2019-10-08 14:00:16 +02:00
Christian Siegel
d5699cc897 Mention pythonic_params in request docs (#947) 2019-07-11 13:12:33 +02:00
Tomasz Trębski
123c5c9fbd Remove Python 3.4 (#990)
* EOL Python 3.4

* fixup! EOL Python 3.4

* fixup! EOL Python 3.4

* fixup! EOL Python 3.4
2019-07-09 13:53:44 +02:00
Dan Walker
d24a8e2579 Update request.rst (#953)
Fix duplication
2019-06-07 12:01:51 +02:00
Spencer Herzberg
0989a93df5 fixes basic auth example doc; adds apikey example (#894)
* fixes basic auth example doc; adds apikey example

* remove required_scopes references that dont pertain to apikey
2019-03-11 08:22:37 +01:00
Simon
92867452a2 Added MethodViewResolver (#847)
* Added MethodViewResolver

By subclassing RestyResolver and modifying its `resolve_function_from_operation_id` method, it is now possible to use automatic routing functionality with Flask's MethodView together with MethodViewResolver.

* Add MethodView example

* Add tests for methodview

* add documentation on how to use MethodViewResolver
2019-02-04 08:25:27 +01:00
Daniel Grossmann-Kavanagh
d8cd116154 fix docs on adding error handler (#818) 2018-12-18 08:28:06 +01:00
Phil Sturgeon
fc8e018a8b Swagger -> OpenAPI (#813) 2018-12-11 08:30:15 +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
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
Henning Jacobs
845d4255ab Update docs version to 2.0 (#744)
- Fixes #717 for now.
2018-11-07 08:15:37 +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
2018-11-05 14:50:42 +01: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
fdemello
cbca315326 Update routing.rst (#674)
Changes proposed in #596
2018-09-14 09:12:20 +02:00