This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-16
Channels
- # alda (1)
- # aws-lambda (1)
- # bangalore-clj (1)
- # beginners (70)
- # boot (24)
- # cider (1)
- # cljs-dev (167)
- # cljsjs (8)
- # cljsrn (17)
- # clojure (224)
- # clojure-android (7)
- # clojure-austin (8)
- # clojure-russia (17)
- # clojure-spec (120)
- # clojure-uk (46)
- # clojurescript (68)
- # community-development (198)
- # conf-proposals (1)
- # core-async (7)
- # cursive (6)
- # datomic (27)
- # dirac (19)
- # events (9)
- # hoplon (2)
- # jobs (1)
- # luminus (9)
- # off-topic (1)
- # om (281)
- # om-next (5)
- # onyx (50)
- # pedestal (1)
- # re-frame (19)
- # reagent (11)
- # ring-swagger (14)
- # slack-help (2)
- # spacemacs (1)
- # untangled (72)
- # yada (30)
Question about specifying schema for :responses
https://github.com/juxt/yada/blob/master/src/yada/swagger.clj#L121 when I attempt to provide a schema as you would in ring-swagger, I’m given the validation error that the key :schema
is not allowed.
[["/resource-counts/" :id]
(yada/resource
{:methods
{:get {:parameters {:path {:id Long}}
:produces "application/json"
:response (fn [ctx]
(let [id (get-in ctx [:parameters :path :id])]
(db/harvest-discovery-timeseries id)))
:responses {200 {:schema [{:count s/Int :modified_date s/Str}]
:description "List of Harvest Discovery Counts"}}}}})]
It doesn’t look like ring-swagger is enforcing any keys https://github.com/metosin/ring-swagger/blob/master/src/ring/swagger/swagger2_schema.clj#L32
Looks like I had an old version of Yada “1.1.28”. Upgraded to “1.1.33” and I’m good to go. https://github.com/juxt/yada/blob/7929c38916227b2e028fcae5d7344bf902794b08/test/yada/swagger_test.clj#L220
@kingoftheknoll good to hear.
just wondering if someone's already gone through all the bits and bobs to get this to work, before i go through all the bits and bobs needed to get this to work 🙂
@tcoupland I wouldn't expect anything to break. Unless there are macro mistakes. But spec should make it obvious & easy.
I was able to make it run with alpha11 (I think?) with the addition of a colon before require
in an ns declaration
Yes. All working on alpga-12 on yada 1.1.33 but needs latest aleph, manifold and ring-swagger. Some kind contributor fixed yada a couple of months ago
Can dig out the actual versions I used if you need them @tcoupland but did this exercise earlier in the week
i thought i had it then, yada tests past, but my actual project isn't very happy at all
@malcolmsparks that would be great, if you've got them
i had to change some code, as the middleware functions in aleph have changed names.
+ [aleph "0.4.2-alpha8"] + [manifold "0.1.6-alpha1"]
+ [metosin/ring-swagger "0.22.10"]
I'm not using any aleph middleware (in yada, or my project)
sorry, more specifically, there is [aleph.http.client-middleware :as middleware] in the yada.phonebook-test
ah, I haven't tried developing yada itself on 1.9-alpha, I've only had experience with a project that uses yada as a dependency
while clojure 1.9 is in alpha, some lib devs (like me) might ignore it, but clojure 1.9 can't come out of alpha because it will break everyone's projects (because of libraries) - it's going to be clojure.contrib all over again 🙂
@tcoupland you are on the bleeding edge - so anything you find you need to fix, please send in a PR 🙂
if you wouldn't might filling in the yada + clojure 1.9 details as you go... http://c2.com/cgi/wiki?BlackaddersMap