-
Notifications
You must be signed in to change notification settings - Fork 230
feat: Add AsyncAPI HTTP Support #2142
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
Conversation
Hi @Lancetnik can you review please? |
@tmulligan98 sorry, missed this one! I definitely check check soon |
Done 😃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for waiting so long
Great job! Really appreciate the help. But, I think, we should make some more extensive changes – migrate ASGI functions to classes to incapsulate some logic to them and make them able to store metainforamation
Also, we should polish the types to remove all mypy ignores (if it is possilbe)
docs/docs/en/release.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, remove this file changes
Not sure. Looks enough for me. |
Well, thank you! I think, it is good enough. I want to polish some things by myself and then we can merge the PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am sorry, but your schema.routes
looks like a LLM fantasy
The code is fine, but generated AsyncAPI schema is totally incorrect
Please, follow the official AsyncAPI specification to investigate, how HTTP should be represented in the schema
Please, take a look here:
AsyncAPI HTTP bindings – https://github.com/asyncapi/bindings/tree/master/http
Example of FastAPI + AsyncAPI usage – https://github.com/Kludex/fastapi-asyncapi
AsyncAPI Studio to validate schema – https://studio.asyncapi.com/
faststream/asyncapi/generate.py
Outdated
@@ -69,6 +72,7 @@ def get_app_schema(app: "AsyncAPIApplication") -> Schema: | |||
externalDocs=app.external_docs, | |||
servers=servers, | |||
channels=channels, | |||
routes=asgi_routes, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should reinvent HTTP AsyncAPI schema again
faststream/asyncapi/schema/routes.py
Outdated
from pydantic import BaseModel | ||
|
||
|
||
class Route(BaseModel): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class doesn't exist in AsyncAPI
I think, we can merge it without Issue close |
Description
Add support for an
include_in_schema
parameter to register HTTP routes in the app schemaTODO: Should
include_in_schema
beTrue
by default?Part of #2091
Type of change
Please delete options that are not relevant.
Checklist
scripts/lint.sh
shows no errors)scripts/test-cov.sh
scripts/static-analysis.sh