-
-
Save aeriksson/072546aafcaee64c6db6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; This gives "Can't use qualified name as parameter: id" | |
;; Note that defresource is a macro: https://clojure-liberator.github.io/liberator/doc/resource-definition.html | |
(defmacro def-get-resource [name exists-fn get-fn] | |
`(defresource ~name [id] | |
:available-media-types ["application/json"] | |
:exists? (~exists-fn id) | |
:handle-ok (~get-fn id))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment