-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reverse routing params conforming #75
Comments
This should be polymorphic. Alternatives: 1) Use JSON encoder
2) Multimethod
3) Protocol
4) Coercion/Type-based
(st/spec
{:spec keyword?
:description "a bijecting keyword"
::encode/string #(name %2)
::decode/string #(keyword %2)}) NOTE: qualified keywords as path-parameters need to be url-encoded, as otherwise the |
From my point of view, 3rd option (Protocol) is the more natural choice here, since I don't see any other usage of this except for the routing |
I think it's the way to go. When/if 4rd is implemented, it can be used instead. Would you like to do a PR? |
I have extra time just now, will do this. |
fixed in |
I'd be useful to have coercion to work with
reitit/match-by-name
. One example is conforming keyword to a string path parameter.Related
spec-tools
issue: metosin/spec-tools#112The text was updated successfully, but these errors were encountered: