Skip to content

fix: add injection extra options in lifespan #2335

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

Merged
merged 1 commit into from
Jul 4, 2025
Merged

Conversation

Sehat1137
Copy link
Collaborator

@Sehat1137 Sehat1137 commented Jul 3, 2025

Description

Fix bug, when extra options was ignored for ASGI Application

from faststream import FastStream
from faststream.nats import NatsBroker
from contextlib import asynccontextmanager


broker = NatsBroker()


@asynccontextmanager
async def lifespan(test: int, port: int):
    print(port)  # 5000
    print(test)  # 3
    yield


app = FastStream(broker, lifespan=lifespan).as_asgi(
    asyncapi_path="/docs",
)
faststream run main:app --test 3 --port 5000

Type of change

Please delete options that are not relevant.

  • Documentation (typos, code examples, or any documentation updates)
  • Bug fix (a non-breaking change that resolves an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a fix or feature that would disrupt existing functionality)
  • This change requires a documentation update

Checklist

  • My code adheres to the style guidelines of this project (scripts/lint.sh shows no errors)
  • I have conducted a self-review of my own code
  • I have made the necessary changes to the documentation
  • My changes do not generate any new warnings
  • I have added tests to validate the effectiveness of my fix or the functionality of my new feature
  • Both new and existing unit tests pass successfully on my local environment by running scripts/test-cov.sh
  • I have ensured that static analysis tests are passing by running scripts/static-analysis.sh
  • I have included code examples to illustrate the modifications

@Sehat1137 Sehat1137 requested a review from Lancetnik as a code owner July 3, 2025 21:37
@Sehat1137 Sehat1137 changed the title fix: added injection extra options in lifespan fix: add injection extra options in lifespan Jul 3, 2025
@Lancetnik Lancetnik added this pull request to the merge queue Jul 4, 2025
Merged via the queue into ag2ai:main with commit 020307e Jul 4, 2025
33 checks passed
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.

2 participants