Skip to content

Instantly share code, notes, and snippets.

@ikitommi
Created May 27, 2014 12:37
Show Gist options
  • Save ikitommi/e84df225ab5968b7afd8 to your computer and use it in GitHub Desktop.
Save ikitommi/e84df225ab5968b7afd8 to your computer and use it in GitHub Desktop.
LocalDate coercion
lein try metosin/ring-swagger
;nREPL server started on port 62925 on host 127.0.0.1
;REPL-y 0.3.0
;Clojure 1.5.1
user=> (require '[ring.swagger.schema :refer :all])
nil
user=> (defmodel Neiti {:aika org.joda.time.LocalDate})
#'user/Neiti
user=> (coerce! Neiti {:aika "2014-06-06"})
{:aika #<LocalDate 2014-06-06>}
user=>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment