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

Fix middleware doc example #1796

Merged
merged 1 commit into from
Nov 8, 2023
Merged

Conversation

ajoga
Copy link
Contributor

@ajoga ajoga commented Nov 8, 2023

I'm starting to use the project with the newly release 3 version.

from connexion import AsyncApp, ConnexionMiddleware
middlewares = [middleware for middleware in ConnexionMiddleware.default_middlewares
if not isinstance(middleware, SecurityMiddleware)]
app = AsyncApp(__name__, middlewares=middlewares)

It seems this example is not correct.

  1. missing import for SecurityMiddleware
  2. ConnexionMiddleware.default_middlewares is a list of classes, not class instances: the filtering never happen.

1. missing import for SecurityMiddleware
2. `ConnexionMiddleware.default_middlewares` is a list of classes, not class instances: the filtering never happenned as classes are not instances of themselves.
Copy link
Member

@RobbeSneyders RobbeSneyders left a comment

Choose a reason for hiding this comment

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

Thanks @ajoga!

@coveralls
Copy link

Coverage Status

coverage: 94.271%. remained the same
when pulling 9ed6e29 on ajoga:middlewaredocs
into 70084bc on spec-first:main.

@RobbeSneyders RobbeSneyders merged commit 095ae89 into spec-first:main Nov 8, 2023
8 checks passed
@ajoga ajoga deleted the middlewaredocs branch November 10, 2023 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants