Skip to content

feat: expose FastAPI /docs endpoint for API discovery #23

@gordonmurray

Description

@gordonmurray

FastAPI auto-generates an OpenAPI spec at /docs and /openapi.json, but the static file mount at / catches all routes, making the Swagger UI inaccessible.

This makes the API harder to discover for integrators. The API surface is small and clean, so exposing /docs would make it self-documenting with zero additional code.

Options:

  1. Mount static files on a subpath (e.g., /ui). This would be a breaking change for existing users.
  2. Register the static mount with lower priority so explicit FastAPI routes take precedence.
  3. Add a specific route exclusion for /docs and /openapi.json.

Option 2 seems least disruptive.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions