Skip to content

Commit 0c0c517

Browse files
Update quickstart documentation (#1701)
Contributes towards #1531 Updates the quickstart documentation for v3. I removed some more detailed stuff that I don't think belongs on this page.
1 parent ab54842 commit 0c0c517

File tree

8 files changed

+262
-92
lines changed

8 files changed

+262
-92
lines changed

connexion/apps/abstract.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ def __init__(
5353
:param import_name: The name of the package or module that this object belongs to. If you
5454
are using a single module, __name__ is always the correct value. If you however are
5555
using a package, it’s usually recommended to hardcode the name of your package there.
56+
:param lifespan: A lifespan context function, which can be used to perform startup and
5657
:param middlewares: The list of middlewares to wrap around the application. Defaults to
57-
:obj:`middleware.main.ConnexionmMiddleware.default_middlewares`
58+
:obj:`middleware.main.ConnexionMiddleware.default_middlewares`
5859
:param specification_dir: The directory holding the specification(s). The provided path
5960
should either be absolute or relative to the root path of the application. Defaults to
6061
the root path.
@@ -71,8 +72,8 @@ def __init__(
7172
start.
7273
:param strict_validation: When True, extra form or query parameters not defined in the
7374
specification result in a validation error. Defaults to False.
74-
:param swagger_ui_options: A :class:`options.ConnexionOptions` instance with configuration
75-
options for the swagger ui.
75+
:param swagger_ui_options: A dict with configuration options for the swagger ui. See
76+
:class:`options.ConnexionOptions`.
7677
:param uri_parser_class: Class to use for uri parsing. See :mod:`uri_parsing`.
7778
:param validate_responses: Whether to validate responses against the specification. This has
7879
an impact on performance. Defaults to False.

connexion/apps/asynchronous.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,10 @@ def __init__(
141141
:param import_name: The name of the package or module that this object belongs to. If you
142142
are using a single module, __name__ is always the correct value. If you however are
143143
using a package, it’s usually recommended to hardcode the name of your package there.
144+
:param lifespan: A lifespan context function, which can be used to perform startup and
145+
shutdown tasks.
144146
:param middlewares: The list of middlewares to wrap around the application. Defaults to
145-
:obj:`middleware.main.ConnexionmMiddleware.default_middlewares`
147+
:obj:`middleware.main.ConnexionMiddleware.default_middlewares`
146148
:param specification_dir: The directory holding the specification(s). The provided path
147149
should either be absolute or relative to the root path of the application. Defaults to
148150
the root path.
@@ -159,8 +161,8 @@ def __init__(
159161
start.
160162
:param strict_validation: When True, extra form or query parameters not defined in the
161163
specification result in a validation error. Defaults to False.
162-
:param swagger_ui_options: A :class:`options.ConnexionOptions` instance with configuration
163-
options for the swagger ui.
164+
:param swagger_ui_options: A dict with configuration options for the swagger ui. See
165+
:class:`options.ConnexionOptions`.
164166
:param uri_parser_class: Class to use for uri parsing. See :mod:`uri_parsing`.
165167
:param validate_responses: Whether to validate responses against the specification. This has
166168
an impact on performance. Defaults to False.

connexion/apps/flask.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def __init__(
201201
:param lifespan: A lifespan context function, which can be used to perform startup and
202202
shutdown tasks.
203203
:param middlewares: The list of middlewares to wrap around the application. Defaults to
204-
:obj:`middleware.main.ConnexionmMiddleware.default_middlewares`
204+
:obj:`middleware.main.ConnexionMiddleware.default_middlewares`
205205
:param server_args: Arguments to pass to the Flask application.
206206
:param specification_dir: The directory holding the specification(s). The provided path
207207
should either be absolute or relative to the root path of the application. Defaults to
@@ -221,6 +221,8 @@ def __init__(
221221
start.
222222
:param strict_validation: When True, extra form or query parameters not defined in the
223223
specification result in a validation error. Defaults to False.
224+
:param swagger_ui_options: A dict with configuration options for the swagger ui. See
225+
:class:`options.ConnexionOptions`.
224226
:param uri_parser_class: Class to use for uri parsing. See :mod:`uri_parsing`.
225227
:param validate_responses: Whether to validate responses against the specification. This has
226228
an impact on performance. Defaults to False.

connexion/middleware/main.py

+11-4
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ def __init__(
160160
start.
161161
:param strict_validation: When True, extra form or query parameters not defined in the
162162
specification result in a validation error. Defaults to False.
163-
:param swagger_ui_options: A :class:`options.ConnexionOptions` instance with configuration
164-
options for the swagger ui.
163+
:param swagger_ui_options: A dict with configuration options for the swagger ui. See
164+
:class:`options.ConnexionOptions`.
165165
:param uri_parser_class: Class to use for uri parsing. See :mod:`uri_parsing`.
166166
:param validate_responses: Whether to validate responses against the specification. This has
167167
an impact on performance. Defaults to False.
@@ -309,8 +309,8 @@ def add_api(
309309
start.
310310
:param strict_validation: When True, extra form or query parameters not defined in the
311311
specification result in a validation error. Defaults to False.
312-
:param swagger_ui_options: A :class:`options.ConnexionOptions` instance with configuration
313-
options for the swagger ui.
312+
:param swagger_ui_options: A dict with configuration options for the swagger ui. See
313+
:class:`options.ConnexionOptions`.
314314
:param uri_parser_class: Class to use for uri parsing. See :mod:`uri_parsing`.
315315
:param validate_responses: Whether to validate responses against the specification. This has
316316
an impact on performance. Defaults to False.
@@ -358,6 +358,13 @@ def add_api(
358358
def add_error_handler(
359359
self, code_or_exception: t.Union[int, t.Type[Exception]], function: t.Callable
360360
) -> None:
361+
"""
362+
Register a callable to handle application errors.
363+
364+
:param code_or_exception: An exception class or the status code of HTTP exceptions to
365+
handle.
366+
:param function: Callable that will handle exception.
367+
"""
361368
if self.middleware_stack is not None:
362369
raise RuntimeError(
363370
"Cannot add error handler after an application has started"

docs/conf.py

+6-13
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,14 @@
2727
# Add any Sphinx extension module names here, as strings. They can be
2828
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
2929
# ones.
30-
extensions = ['autoapi.extension']
31-
32-
autoapi_type = 'python'
33-
autoapi_options = ['members',
34-
'inherited-members',
35-
'undoc-members',
36-
'show-inheritance',
37-
'show-module-summary',
38-
'special-members',
39-
'imported-members']
40-
autoapi_python_class_content = 'both'
41-
autoapi_dirs = [
42-
'../connexion'
30+
extensions = [
31+
'sphinx.ext.autodoc',
32+
'sphinx_copybutton',
33+
'sphinx_design',
4334
]
4435

36+
autoclass_content = 'both'
37+
4538
# Add any paths that contain templates here, relative to this directory.
4639
templates_path = ['_templates']
4740

docs/images/swagger_ui.png

56.3 KB
Loading

0 commit comments

Comments
 (0)