Skip to content

src/dazzle_back/runtime/route_generator.py

Generated: 2026-03-30T04:38:48.072017+00:00

Commit: 615f1354a103

Language: python

Scope: dazzle_back

Purpose

Route generator - generates FastAPI routes from EndpointSpec.

This module creates FastAPI routers and routes from backend specifications.

Key Exports

  • create_list_handler
  • create_read_handler
  • create_create_handler
  • create_update_handler
  • create_delete_handler
  • create_custom_handler
  • create_neighborhood_handler
  • create_shortest_path_handler
  • create_components_handler
  • RouteGenerator
  • generate_crud_routes
  • generate_route
  • generate_all_routes
  • router
  • list_items
  • get_item
  • create_item
  • update_item
  • delete_item
  • handler_with_input

Dependencies

Imports

  • collections.abc.Callable
  • enum.Enum
  • typing.TYPE_CHECKING
  • typing.Any
  • uuid.UUID
  • pydantic.BaseModel
  • dazzle.core.strings.to_api_plural
  • dazzle_back.runtime._fastapi_compat.FASTAPI_AVAILABLE
  • dazzle_back.runtime._fastapi_compat.Depends
  • dazzle_back.runtime._fastapi_compat.HTMLResponse
  • dazzle_back.runtime._fastapi_compat.HTTPException
  • dazzle_back.runtime._fastapi_compat.Query
  • dazzle_back.runtime._fastapi_compat.Request
  • dazzle_back.runtime._fastapi_compat.APIRouter
  • dazzle_back.runtime.repository.ConstraintViolationError
  • dazzle_back.specs.endpoint.EndpointSpec
  • dazzle_back.specs.endpoint.HttpMethod
  • dazzle_back.specs.service.OperationKind
  • dazzle_back.specs.service.ServiceSpec
  • dazzle_back.runtime.auth.AuthContext

Event Interactions

None detected.

Invariants and Assumptions

  • Validates: via condition must have at least one entity binding
  • Treat None values as missing — they must not bypass the deny sentinel (#591).

  • Assert: optional_auth_dep is not None # narrowing for mypy
  • Assert: cedar_access_spec is not None # narrowing for mypy
  • need row-level isolation must add explicit scope: blocks.

Tests

  • tests/integration/test_runtime_e2e.py
  • tests/integration/test_runtime_pipeline.py
  • tests/unit/test_runtime_test_routes.py
  • tests/unit/test_runtime_services.py
  • tests/unit/test_runtime_mcp_tools.py

Notes

This page was automatically generated by tools/gen_reference_docs.py.