Skip to content

Query parameter 'format' shadows Python built-in #12

@jtdub

Description

@jtdub

Problem

In reports.py:67, the export endpoint uses format as a query parameter name:

async def export_report(report_id: str, format: str = Query("json")) -> str:

This shadows Python's built-in format() function within the function scope.

Suggested Fix

Rename the parameter to format_type or export_format, using FastAPI's Query(alias="format") to preserve the external API:

async def export_report(report_id: str, export_format: str = Query("json", alias="format")) -> str:

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions