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

FAST003 does not recognize parameter alias #13263

Closed
spreeni opened this issue Sep 6, 2024 · 0 comments · Fixed by #13394
Closed

FAST003 does not recognize parameter alias #13263

spreeni opened this issue Sep 6, 2024 · 0 comments · Fixed by #13394
Assignees
Labels
bug Something isn't working help wanted Contributions especially welcome preview Related to preview mode features rule Implementing or modifying a lint rule

Comments

@spreeni
Copy link

spreeni commented Sep 6, 2024

Aliases for query parameters are not considered by FAST003, which leads to an incorrect error message.

The following valid code

from typing import Annotated
from fastapi import FastAPI, Path

app = FastAPI()


@app.get("/documents/{documentId}")
def get_document(document_id: Annotated[str, Path(alias="documentId")]) -> str:
    return "Lorem Ipsum"

outputs:

FAST003 Parameter documentId appears in route path, but not in get_document signature

@MichaReiser MichaReiser added bug Something isn't working preview Related to preview mode features rule Implementing or modifying a lint rule help wanted Contributions especially welcome labels Sep 6, 2024
@charliermarsh charliermarsh self-assigned this Sep 18, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working help wanted Contributions especially welcome preview Related to preview mode features rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants