Skip to content

In routers.jinja2 template operation path is specified as "snake_case_path" instead of just "path" #487

@codeseedr

Description

@codeseedr

Please compare:

https://github.com/koxudaxi/fastapi-code-generator/blob/0.5.3/fastapi_code_generator/template/main.jinja2#L18

@app.{{operation.type}}('{{operation.path}}', response_model={{operation.response}}

with:

https://github.com/koxudaxi/fastapi-code-generator/blob/0.5.3/fastapi_code_generator/modular_template/routers.jinja2#L13

@router.{{operation.type}}('{{operation.snake_case_path}}', response_model={{operation.response}}

A param in path gets forcibly formatted in snake case while in the schema YAML it may be formatted differently, and if it happens to be, there is an obvious mismatch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions