This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-26
Channels
- # aleph (2)
- # beginners (119)
- # boot (18)
- # cider (19)
- # cljs-dev (46)
- # cljsjs (1)
- # cljsrn (30)
- # clojure (101)
- # clojure-dusseldorf (12)
- # clojure-finland (1)
- # clojure-greece (7)
- # clojure-india (2)
- # clojure-italy (6)
- # clojure-poland (4)
- # clojure-russia (120)
- # clojure-sg (3)
- # clojure-spec (147)
- # clojure-uk (75)
- # clojurescript (86)
- # cursive (4)
- # datomic (50)
- # docker (1)
- # emacs (4)
- # juxt (51)
- # leiningen (16)
- # liberator (1)
- # luminus (1)
- # lumo (116)
- # mount (2)
- # off-topic (2)
- # onyx (38)
- # pedestal (4)
- # protorepl (2)
- # re-frame (44)
- # reagent (8)
- # ring-swagger (16)
- # schema (5)
- # specter (16)
- # test-check (226)
hello everyone, i know its possible to do a custom coercer in Schema, but before digging in to that id like to make sure there isnt any stanrdart way of doing it...
is there any easy documented way of specifying a field inside a :body-params
vector a datetime
or date
format?
@plins You mention :body-params
so I guess you want to coerce string from JSON to DateTime or Date? Ring-swagger has built-in coercion for this
the table at ring-swagger readme defines the supported classes/schemas https://github.com/metosin/ring-swagger#out-of-the-box-supported-schema-elements
No java8 dates currently, but jodatime is supported
Oh, in fact ring-swagger supports java 8 but the readme is not updated
oh this is nice, cause i was going for a custom formatter because im using java 8 format dates, should i just use the class name in the right hand operator like
:body-params [mydate :- java.time.LocalDate]
?@plins Yeah, that should work
after I succeed, should I update the README of ring-swagger to include a java8 example?
I updated the table in readme to mention java8
Nope, only iso8601 formats are supported
Yeah, and by default is uses iso8601 format, yyyy-mm-dd