-
-
Notifications
You must be signed in to change notification settings - Fork 870
Description
What is the feature you are proposing?
Description
Some APIs follow the Google AIP convention for custom methods, where actions on a resource are expressed with a colon suffix instead of an additional sub-path. Examples include:
/books/69420:archive - performs the archive action on book 69420
/books:create - performs a collection-level create action
In Hono, the colon currently indicates the start of a path parameter, which makes it difficult to define these routes without workarounds (see #1301). It would be useful to provide a clean, explicit way to escape a colon so that it is interpreted as a literal character rather than the start of a parameter.
Examples of proposed syntax:
/books/:id\:archive
/books\:create
Requested Enhancement:
Add a mechanism to escape colons in route definitions so that Hono can cleanly support Google AIP-style custom methods without interfering with parameter parsing.
This would allow developers to register routes that match these patterns directly and maintain compatibility with APIs that adopt this style.
Use Cases:
Implementing Google-style custom methods.
Integrating with APIs or microservices already using these conventions.
Generating client libraries that depend on predictable literal route shapes.
Expected Outcome:
A consistent, documented way to escape colons in route paths so that Hono treats them as literal characters.