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 SessionsJoin the OAI Slack WorkspaceOnce 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.