You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- 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
Connexion is a framework on top of Flask_ that automagically handles
33
-
HTTP requests based on `OpenAPI 2.0 Specification`_ (formerly known as
34
-
Swagger Spec) of your API described in `YAML format`_. Connexion
35
-
allows you to write a Swagger specification, then maps the
36
-
endpoints to your Python functions; this makes it unique, as many
37
-
tools generate the specification based on your Python
38
-
code. You can describe your REST API in as much detail as
39
-
you want; then Connexion guarantees that it will work as
40
-
you specified.
32
+
Connexion is a framework that automagically handles HTTP requests based on `OpenAPI Specification`_
33
+
(formerly known as Swagger Spec) of your API described in `YAML format`_. Connexion allows you to
34
+
write an OpenAPI specification, then maps the endpoints to your Python functions; this makes it
35
+
unique, as many tools generate the specification based on your Python code. You can describe your
36
+
REST API in as much detail as you want; then Connexion guarantees that it will work as you
37
+
specified.
41
38
42
39
We built Connexion this way in order to:
43
40
@@ -77,6 +74,25 @@ Other Sources/Mentions
77
74
- Connexion listed on Swagger_'s website
78
75
- Blog post: `Crafting effective Microservices in Python`_
79
76
77
+
New in Connexion 2.0:
78
+
---------------------
79
+
- App and Api options must be provided through the "options" argument (``old_style_options`` have been removed).
80
+
- You must specify a form content-type in 'consumes' in order to consume form data.
81
+
- The `Operation` interface has been formalized in the `AbstractOperation` class.
82
+
- The `Operation` class has been renamed to `Swagger2Operation`.
83
+
- Array parameter deserialization now follows the Swagger 2.0 spec more closely.
84
+
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.
85
+
For example, `?q=1,2,3&q=4,5,6` will result in `q = [4, 5, 6]`.
86
+
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.
87
+
- The spec validator library has changed from `swagger-spec-validator` to `openapi-spec-validator`.
88
+
- Errors that previously raised `SwaggerValidationError` now raise the `InvalidSpecification` exception.
89
+
All spec validation errors should be wrapped with `InvalidSpecification`.
90
+
- Support for nullable/x-nullable, readOnly and writeOnly/x-writeOnly has been added to the standard json schema validator.
91
+
- Custom validators can now be specified on api level (instead of app level).
92
+
- Added support for basic authentication and apikey authentication
93
+
- If unsupported security requirements are defined or ``x-tokenInfoFunc``/``x-tokenInfoUrl`` is missing, connexion now denies requests instead of allowing access without security-check.
94
+
- Accessing ``connexion.request.user`` / ``flask.request.user`` is no longer supported, use ``connexion.context['user']`` instead
95
+
80
96
How to Use
81
97
==========
82
98
@@ -160,8 +176,8 @@ identify which Python function should handle each URL.
160
176
If you provide this path in your specification POST requests to
161
177
``http://MYHOST/hello_world``, it will be handled by the function
162
178
``hello_world`` in the ``myapp.api`` module. Optionally, you can include
163
-
``x-swagger-router-controller`` in your operation definition, making
164
-
``operationId`` relative:
179
+
``x-swagger-router-controller`` (or ``x-openapi-router-controller``) in your
180
+
operation definition, making ``operationId`` relative:
165
181
166
182
.. code-block:: yaml
167
183
@@ -249,8 +265,8 @@ function expects an argument named ``message`` and assigns the value
249
265
of the endpoint parameter ``message`` to your view function.
250
266
251
267
.. warning:: When you define a parameter at your endpoint as *not* required, and
252
-
this argument does not have default value in your Python view, you will get
253
-
a "missing positional argument" exception whenever you call this endpoint
268
+
this argument does not have default value in your Python view, you will get
269
+
a "missing positional argument" exception whenever you call this endpoint
254
270
WITHOUT the parameter. Provide a default value for a named argument or use
255
271
``**kwargs`` dict.
256
272
@@ -300,22 +316,25 @@ You can implement your own URI parsing behavior by inheriting from
0 commit comments