Skip to content

FAST003 does not recognize parameter alias #13263

@spreeni

Description

@spreeni

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghelp wantedContributions especially welcomepreviewRelated to preview mode featuresruleImplementing or modifying a lint rule

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions