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.