Commit Graph

33 Commits

Author SHA1 Message Date
Dan Price
bbd085bd39 Fix missing colons in request docs; rename /path to /foo for consistency with other examples (#1818) 2023-11-20 22:23:51 +01:00
Robbe Sneyders
165a91511b Fix multiple file upload (#1813)
Fixes #1806
Fixes #1811
2023-11-19 22:55:40 +01:00
Robbe Sneyders
b9ba13cde5 Centralize error handling in ExceptionMiddleware (#1754)
I was writing the documentation on exception handling, and I noticed
that it was very hard to explain our current behavior.

Error handlers can be registered either on the internal Flask app (not
the Starlette one) or on the Connexion app, which leads to some
undefined (actually just really hard to explain) behavior. Eg.
- Registering error handlers on a status code would capture
`starlette.HTTPException` errors on the Connexion app, and
`werkzeug.HTTPException` errors on the Flask App, which means that
registering an error handler on a status code doesn't catch all the
errors with that status code.
- Flask does some default error handling which leads to some exceptions
never reaching the error handlers registered on the Connexion app.

So I made the following changes:
- Replaced the default error handlers we registered on the Flask app
with a default handler on the `ExceptionMiddleware` that takes into
account other handlers registered on status codes.
- Configured Flask to propagate exceptions instead of catching them.
- Abstracted away the Starlette `Request` and `Response` types, so users
can and must now use `ConnexionRequest`
  and `ConnexionResponse` types in error handlers.
- Renamed the `ASGIRequest` class to `ConnexionRequest` since it is the
only Request class part of the high level
  Connexion interface.

We could also rename `ConnexionRequest` and `ConnexionResponse` to just
`Request` and `Response`. Wdyt?
2023-10-29 09:37:54 +01:00
Robbe Sneyders
655ea430ed Add validation documentation (#1743)
Contributes to #1531
2023-10-17 23:57:06 +02:00
Robbe Sneyders
17fcad0c30 Update response handling documenation (#1742)
Contributes to #1531
2023-10-16 23:51:21 +02:00
Robbe Sneyders
b102ad9f6c Update request handling documentation (#1741)
Contributes to #1531
2023-10-15 12:59:58 +02:00
Heinz-Alexander Fuetterer
8459c614fd chore: fix typos (#1740)
Changes proposed in this pull request:

 - fix some minor typos
2023-10-12 23:30:23 +02: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
Jiehong
fa708ef984 doc: fix warnings on docs/request.rst 2020-07-20 07:20:37 +02:00
Joseph Birkner
a250e5a59f Fixed spelling of uri_parser_class documentation (#1192) 2020-03-28 13:41:49 +01: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
Dan Walker
d24a8e2579 Update request.rst (#953)
Fix duplication
2019-06-07 12:01:51 +02:00
The UNIX Man
b66aee3089 collectionFormat doesn't need the ' (#778)
It's plural.
2018-11-13 13:37:34 +01:00
Daniel Grossmann-Kavanagh
343643428c update documentation (#771) 2018-11-12 09:40:42 +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
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
Petr Horáček
e166d0fea5 add documentation for custom validators 2016-12-04 13:07:21 +01:00
Jason Estibeiro
e6ce534082 Made minor spelling and grammatical corrections 2016-10-27 12:30:03 +05:30
Dylan Semler
fd69a372ef Add strict_validation details to documentation 2016-07-31 20:21:19 -04:00
Rafael Caricio
0f54d79205 Add link to official spec 2016-06-07 15:46:29 +02:00
Rafael Caricio
87111d3207 Add note for usage 2016-03-30 11:36:48 +02:00
Rafael Caricio
795dc6ed54 Add warning for nullable fields 2016-03-26 01:04:53 +01:00
Rafael Caricio
2b41e4d256 Add documentation for x-nullable flag 2016-03-25 20:08:36 +01:00
Arjun Naik
c9b6acafdb Update doc for header to use headers object from connexion. 2016-03-17 14:55:15 +01:00
Arjun Naik
27077a4440 Added documentation about header parameters. 2016-03-17 11:21:23 +01:00
João Santos
495e865eb0 #75 Fixes suggested in the Pull Request 2016-03-04 15:19:54 +01:00
João Santos
bc527fed58 #75 Use @rafaelcaricio's version of the parameter handling documentation 2016-03-04 15:14:05 +01:00
João Santos
ba77fc3f7f #75 Document how arguments are passed to the functions 2016-03-04 14:26:08 +01:00
João Santos
a0cc20a47b #75 include a link to jsonschema 2016-03-04 14:14:46 +01:00
João Santos
7bd4851689 #75 document request validation 2016-03-04 14:12:47 +01:00
João Santos
ac95f912f8 #167 Split response and request documentation 2016-03-04 13:37:54 +01:00