Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the import statements for the cookbook snippets #1805

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions docs/cookbook.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ Starlette. You can add it to your application, ideally in front of the ``Routing
:sync: AsyncApp

.. code-block:: python
from pathlib import Path
RobbeSneyders marked this conversation as resolved.
Show resolved Hide resolved

from connexion import AsyncApp
from connexion.middleware import MiddlewarePosition
from starlette.middleware.cors import CORSMiddleware


app = connexion.AsyncApp(__name__)
app = AsyncApp(__name__)

app.add_middleware(
CORSMiddleware,
Expand All @@ -48,13 +49,14 @@ Starlette. You can add it to your application, ideally in front of the ``Routing
:sync: FlaskApp

.. code-block:: python
from pathlib import Path
RobbeSneyders marked this conversation as resolved.
Show resolved Hide resolved

from connexion import FlaskApp
from connexion.middleware import MiddlewarePosition
from starlette.middleware.cors import CORSMiddleware


app = connexion.FlaskApp(__name__)
app = FlaskApp(__name__)

app.add_middleware(
CORSMiddleware,
Expand All @@ -80,10 +82,11 @@ Starlette. You can add it to your application, ideally in front of the ``Routing
:sync: ConnexionMiddleware

.. code-block:: python
from pathlib import Path
RobbeSneyders marked this conversation as resolved.
Show resolved Hide resolved

from asgi_framework import App
from connexion import ConnexionMiddleware
from connexion.lifecycle import ConnexionRequest, ConnexionResponse
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless there's a hidden reason to import these classes (?) they were not used in the snippet.

from starlette.middleware.cors import CORSMiddleware

app = App(__name__)
app = ConnexionMiddleware(app)
Expand Down