-
Notifications
You must be signed in to change notification settings - Fork 4
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
correct usage of :ataraxy.error/failed-spec
#3
Comments
If I've understood you correctly: it's intentional. Check the README for an explanation. |
|
Yes, that's correct. See: https://github.com/weavejester/ataraxy#specs |
Though if you're using specs, you might want to give the result key a namespace to ensure it's somewhat unique. |
I mean the {[:get "/example" {body :params}] [:aaa/example body]} ; this :aaa/example will match the handler :my.handler.aaa.example
(defmethod ig/init-key :my.handler.aaa/example [_ options]
...) ; this handler will be called for /example However, For adding the result validation
The different handling between handler shorthand and the result-spec is quite surprise. If it is intended, it should be documented. |
I don't know why you consider it surprising. As the name suggests, Maybe it would have been simpler to make the syntax: {[:get "/example" {body :params}] [:my.handler.aaa/example body]} That would unify the keys, which seem to be a source of confusion. But when I tried it, it just seemed to make the route syntax too verbose. |
I think a few words describing the usage of |
Here is a working example start from
[module.ataraxy 0.17]
. May I know using:example
instead of:my.handler/example
is intentional or not?config.edn
my.handler/example.clj
my.handler/error.clj
The text was updated successfully, but these errors were encountered: