This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-01-12
Channels
- # arachne (1)
- # aws (2)
- # beginners (123)
- # boot (22)
- # boot-dev (8)
- # chestnut (3)
- # cider (38)
- # clara (36)
- # cljs-dev (148)
- # clojars (2)
- # clojure (76)
- # clojure-austin (2)
- # clojure-greece (1)
- # clojure-italy (6)
- # clojure-russia (5)
- # clojure-spec (8)
- # clojure-uk (65)
- # clojurescript (45)
- # core-async (38)
- # cursive (9)
- # data-science (5)
- # datomic (28)
- # docs (1)
- # emacs (2)
- # fulcro (34)
- # hoplon (18)
- # jobs-discuss (7)
- # keechma (8)
- # lumo (5)
- # om (3)
- # onyx (31)
- # parinfer (1)
- # pedestal (1)
- # re-frame (20)
- # reagent (5)
- # ring-swagger (16)
- # shadow-cljs (56)
- # spacemacs (11)
- # specter (8)
- # sql (5)
- # unrepl (29)
- # yada (6)
Hello Tommi, lot of thanks for the hint and example! The reason I need it is exactly for documentation purposes - it is for a prototype where just by having swagger/api docs and something to play with by asking/getting data is very useful and needs almost no specific UI to show the concepts, especially when the actual tree/path data is pretty wide and deep. I looked at the example and as it says - it provides the dynamic paths, but doesn’t show them to the end user. Probably would be able to call compojure-api.sweet/api with at runtime constructed maps. Hope that route will bring me further.
if you know the nesting in advance, you can generate the routes with normal for, reduce etc.
@ikitommi having trouble with c.api making application/edn work as the default format. I've set :formats (-> (m/create) (assoc :default-format "application/edn"))
in my app, but i'm getting json formatted data back no matter what. I've been digging around the examples and wiki for a while now, must be missing something obvious - could you point me in the right direction pls?
Getting the following from testing simplest thing (fallback 404 handler):
{:response
{:status 404,
:headers {"Content-Type" "application/edn"},
:body
#object[java.io.ByteArrayInputStream 0x683795a5 "[email protected]"],
:muuntaja/format "application/json"}
@mgrbyte Muuntaja
instance is stateful and caches the values given in creation (for speed), despite it’s implemented as a Record. I wrote an issue to re-implement it as a Protocol to avoid confusion. But the correct way is to transform the options and create a Muuntaja
out of those, eg. (-> (assoc m/default-options :default-format "application/edn") (m/create))
fwiw, I'm using the latest c.api, with spec - decided to make all clients pass EDN as it makes the validation much easier. I was finding that e.g making certain values in maps conform to a namespaced keyword (datomic ident form an enum for example) ...
I'm making good progress with my authz stuff, will try and extract an example repo when I'm done and feedback to the project.
@mgrbyte is there still an issue spec + with namespaces keywords, could you paste an example? looking forward to the authz stuff 🙂
No direct issue, other than JSON doesn't natively support keywords, so not sure there's a (direct) coercion path without writing custom code
e.g clj: {:myms/scheama-attr :a-ns/some-ident}
- a client supplying something that maps to this in json?
In the clojure side of things, want to describe :myns/schema-attr
with a spec. This needs to work for both the client and the app itself. could write two specs, but not sure that trumps making the client(s) use EDN.
@mgrbyte Muuntaja
instance is stateful and caches the values given in creation (for speed), despite it’s implemented as a Record. I wrote an issue to re-implement it as a Protocol to avoid confusion. But the correct way is to transform the options and create a Muuntaja
out of those, eg. (-> (assoc m/default-options :default-format "application/edn") (m/create))