As its name implies, the terse syntax provides a compact approach for
describing routes. When the argument to
api:expand-routes[ns=io.pedestal.http.route]
is a vector, it will be expanded using the terse syntax.
In essense, the terse syntax is nested maps; the nesting supplies the structure of the
path and each nested map contains keyword keys to identify handlers (by method), or string keys
to describe further nested paths.
This is all a bit complex and hard to describe, thus the move to
table routes.
Unlike the table syntax, any verb can be specified without verb whitelisting.
A route table is a vector of nested vectors. Top-level
vector(s) are termed application vectors. Nested vectors are termed route
vectors.
The spec api:terse-routes[ns=io.pedestal.http.route.specs] defines the terse
table format.
|
There’s an intermediate step hidden in the terse syntax; the map format
is quietly converted into the proper terse format; the map
is keyed on path name and the value is a route description, which may define sub-routes.
These are flattened into a non-nested sequence of routes.
|