This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-24
Channels
- # 100-days-of-code (7)
- # announcements (1)
- # bangalore-clj (1)
- # beginners (87)
- # boot (6)
- # cljdoc (16)
- # cljsrn (13)
- # clojure (32)
- # clojure-dev (30)
- # clojure-italy (18)
- # clojure-nl (4)
- # clojure-serbia (1)
- # clojure-uk (48)
- # clojurescript (18)
- # cursive (18)
- # datascript (1)
- # datomic (7)
- # events (9)
- # figwheel-main (28)
- # fulcro (2)
- # hyperfiddle (2)
- # immutant (8)
- # jobs (16)
- # liberator (4)
- # nyc (2)
- # pedestal (15)
- # re-frame (8)
- # reagent (12)
- # reitit (8)
- # remote-jobs (1)
- # ring-swagger (2)
- # robots (1)
- # rum (1)
- # schema (1)
- # shadow-cljs (45)
- # spacemacs (49)
- # sql (13)
- # tools-deps (59)
- # uncomplicate (1)
- # vim (10)
if i make a format mimicking the code of the muuntaja built-ins that should work as expected right? eg https://github.com/metosin/muuntaja/blob/master/modules/muuntaja/src/muuntaja/format/edn.clj
true that, if you have coercion, you need to parse the format before it. EDN-format is a good example of an simple format.
i had this function for byte array input stream -> string
(defn bais->bytes
[^java.io.ByteArrayInputStream bais]
(.reset bais)
(let [av (.available bais)
bs (byte-array av)]
(.read bais bs 0 av)
(String. bs "UTF-8")))
i'm not familiar with the properties of that object, i made it based on simple trial and error.
is it safe(r) to use the inputstreamreader -> pushbackreader way i see in your edn format?all right made a basic plaintext one that can be parameterized for any content type that should be handled as plain text
(defn format
([] (format "application/xml"))
([content-type]
(core/map->Format
{:name content-type
:matches [(re-pattern
(clojure.string/replace-first content-type "/" "/(.+\\+)"))]
:decoder [decoder]
:encoder [encoder]})))
[metosin/reitit "0.2.3"]
is out with default OPTIONS
endpoints generated for all paths (to better support CORS), parameter-middleware
fix & updated deps. Changelog: https://github.com/metosin/reitit/blob/master/CHANGELOG.md#023-2018-09-24