This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-03-02
Channels
- # admin-announcements (9)
- # alda (21)
- # announcements (1)
- # beginners (68)
- # boot (241)
- # braid-chat (18)
- # cider (32)
- # cljs-dev (4)
- # cljsrn (11)
- # clojure (60)
- # clojure-dusseldorf (1)
- # clojure-germany (1)
- # clojure-poland (212)
- # clojure-russia (64)
- # clojure-sg (10)
- # clojurescript (212)
- # core-async (1)
- # css (14)
- # datomic (1)
- # emacs (9)
- # funcool (2)
- # hoplon (18)
- # jobs (1)
- # ldnclj (1)
- # lein-figwheel (5)
- # leiningen (3)
- # om (190)
- # onyx (46)
- # parinfer (13)
- # proton (3)
- # re-frame (7)
- # reagent (10)
- # ring-swagger (2)
- # slack-help (3)
- # specter (1)
- # yada (31)
@ericfode after thinking about this, I feel logging each request (and result, starus code, etc.) Is something that yada should offer to do as core. There are plans to do this and provide a console too.
@malcolmsparks: Not sure what I had in mind, I somehow thought it was handled as a special property or something. And then maybe the swagger version was derived from there. Content negotiation will do. Thanks a lot for your quick answer!
Hi @malcolmsparks I'm trying to upgrade to the latest yada and I seem to be bumping into an exception:
{:type java.lang.UnsupportedOperationException
:message "nth not supported on this type: PersistentArrayMap"
:at [clojure.lang.RT nthFrom "RT.java" 933]}]
:trace
[[clojure.lang.RT nthFrom "RT.java" 933]
[clojure.lang.RT nth "RT.java" 883]
[bidi.bidi$route_seq invoke "bidi.cljc" 386]
[bidi.bidi$route_seq invoke "bidi.cljc" 390]
[yada.swagger$swagger_spec doInvoke "swagger.clj" 89]
[clojure.lang.RestFn invoke "RestFn.java" 425]
[yada.swagger$swaggered doInvoke "swagger.clj" 172]
(yada/swaggered
{:info {:title "API"
:version "0.1"}
:basePath api-path}
(yada/yada "asdf"))
@imre Args have been switched. It's so the resource comes first to smooth use of ->
hey, i am using yada and am getting a 406 for a request that seems correct, or almost correct.
(defn get-all [connection]
(-> {:methods {:get {:response (fn [_] (mapv maps/map-site (sm/hyrdate-sites connection)))}}
:access-control
{:allow-origin ""}
:produces [{:media-type "application/transit+json"
:charset "utf-8"}]
:consumes [{:media-type "application/transit+json"
:charset "utf-8"}]}
;;(merge core/produces-transit core/consumes-transit)
(yada/resource)))
curl -i '' -H 'Accept: application/transit+json; charset=utf-8' -H 'Referer: ' -H 'Connection: keep-alive' -H 'Cache-Control: max-age=0' —compressed
i am guessing that is has something to do with the charset or the encoding but i am not sure what is miss-aligned
curl -i '' -H 'Accept: application/transit+json' -H 'Referer: ' -H 'Connection: keep-alive' -H 'Cache-Control: max-age=0' —compressed
@iwillig charsets are only applicable for text/* media types. Try dropping the charset altogether from the produces, consumes and accept header. application/json charset is non-negotiable, and only determined between utf-8, utf-16 and utf-32 by sniffing the initial byte order mark. This is outside the scope of http and by extension yada.
application/json;charset=utf-8 is not a recognisable mimetype as per its iana registration
@ericfode it's the error from aleph when bidi doesn't match anything
Good tip is ending with a backstop of [true (yada nil)]
giving you a 404
@iwillig np, hope you get it working
It was missing due to improper vhosts configuration… Not sure where I would have put something to catch that since the backstop still misses it...
Ah ok. Vhosts is new. Probably needs some more thought