ASC 2022 - API Specifications Conference has ended
September 19-21, 2022 | South San Francisco, California
View More Details  & Register Here
Back To Schedule
Monday, September 19 • 9:00am - 12:00pm
Virtual: Routing with URI Templates - Austin Wright

Sign up or log in to save this to your schedule, view media, leave feedback and see who's attending!

Feedback form is now closed.
Virtual Track sessions will be available on-demand on the OpenAPI Initiative YouTube channel at 9:00 AM PT on Monday, September 19. View the sessions here and watch your favorites before joining the Speaker Q&A session on the OpenAPI Initiative Slack workspace at 12:00 PM PT.
Watch the Sessions
Join the OAI Slack Workspace
Once you’ve joined Slack, join the #asc2022_virtual-track channel. A thread will be created for each talk where speakers and attendees can discuss the content. Please note that not all virtual speakers are able to participate in the Q&A session, but please keep the conversation going with fellow viewers!


URI Templates are a popular standard that allows clients to construct a URI according to the server's instructions, rather than following a hyperlink, or implementing manually-written directions in the documentation.

Wouldn't it be useful if you could use these same URI templates to handle incoming HTTP requests? I will show how to reverse this process, so that when a request is received, the URI can be routed to a matching URI Template, from among all of the ones used in the API; recovering the values used to fill in the variables.

I'll show applications for this technique, including a router that reads directly from an OpenAPI description, and detecting overlapping or ambiguous routes.

And I will show the basis in Automata Theory, starting by modeling URI Templates as a regular grammar, then taking the union of all of the URI Templates in use to produce a deterministic finite state machine to find the ones that match (in constant time, with respect to the size of the routing table!).

Finally, I'll discuss implications for various API description standards, including how to support nearly the full range of URI Template operators, and what it should mean when there's overlapping routes.


Austin Wright

HTTP Hobbyist and Editor on JSON Schema
Just this guy, you know?

Monday September 19, 2022 9:00am - 12:00pm PDT