It would be nice to have the meaning of string extended when they are used inside of route maps, so that they behave as constraints. It could allow an improved expressiveness.
For example, we could declare routes based on certain content-types:
;; From documentation at https://lacinia-pedestal.readthedocs.io/en/latest/request.html#post-application-json
;; This actually returns false, unfortunately.
(ataraxy/valid?
'{"/graphql"
{[:get #{query}] [:graphql-get query]
[:post
{{"application/json" "Content-Type"} :headers}
{{:keys [query variables operationName]} :body}]
[:graphql-post query variables operationName]}})
It would be nice to have the meaning of string extended when they are used inside of route maps, so that they behave as constraints. It could allow an improved expressiveness.
For example, we could declare routes based on certain content-types: