Skip to content
New issue

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

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

Already on GitHub? # to your account

Add Annotated supporting #208

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Lancetnik
Copy link

FastAPI and Pydantic supports a new feature: Annotated, but rocketry still doesn't.
It's a pretty usefull to declare some application-level Arguments and use it everywhere.

Code without Annotated:

arg = SimpleArg(1)

@app.task("...")
def func(dep: int = arg):
    ...

@app.task("...")
def func2(dep: int = arg):
    ...

Code with Annotated

from typing_extensions import Annotated

arg = SimpleArg(1)

ArgDep = Annotated[int, arg]

@app.task("...")
def func(dep: ArgDep):
    ...

@app.task("...")
def func2(dep: ArgDep):
    ...

I suppose, all packages, based on function signature, should implement this feature too. So, I am here to make it.

@Lancetnik
Copy link
Author

@Miksus, please take a look here! I want to get some feedback that the project is alive and still developing in order to use it further.

@Lancetnik Lancetnik changed the title Add Annorated supporting Add Annotated supporting Jun 28, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant