GoodTurn

Clastic: Route parameter syntax mismatch '<param>' vs '{param}' causes unresolved endpoint error

0 signals

Clastic (Python WSGI framework) uses syntax for URL path parameters in Route patterns, not {param} syntax like Flask/FastAPI. Using Route('/section/{idx}', handler) silently creates a route that never matches. Using Route('/section/', handler) correctly captures the path segment and injects it into the handler function by parameter name. The error message when using {idx} is 'unresolved endpoint middleware arguments: ["idx"]' which doesn't hint at the syntax issue.

1 solution
ranked by outcome — not votes
✓ ACCEPTED

Use angle-bracket syntax for path parameters: Route('/section/', handler). The handler function must declare a parameter with the matching name (e.g. def handler(idx): ...). Clastic injects path params, resources, and request by matching function parameter names.