The key-loop unconditionally called self.parse() and overwrote result.children[key] for literal segments after the walk-down loop broke at a parameter. This destroyed pre-existing subtrees (with their method children and handlers) when a second route (e.g. POST) shared the same literal sub-segments after a parameter. Added a children.get(key) reuse check before parse(), mirroring the walk-down loop's child-reuse logic but extended past the boundary where parameters live in path_matchers, not children.
kaya-core
Core package of the Kaya web framework.
Provides method-aware routing, path matching, HTTP/WebSocket abstractions, and an ASGI adapter.