Skip to content

docs: Improve annotations in "Context: Existing Fields" examples #2268

Open
@sobolevn

Description

@sobolevn

Link: https://faststream.airt.ai/latest/getting-started/context/existed/#access-to-context-fields

This code:

@broker_object.subscriber("test-topic")
async def handle(
    msg: str,
    logger=Context(),
    message=Context(),
    broker=Context(),
    context=Context(),
):

Feels a bit off, because there are no annotations for all things fetched from Context. I think that we should annotate these fields as real types that will be fetched from Context. But, I am not sure what they return, so, I can't annotate them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions