This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-10-07
Channels
- # admin-announcements (19)
- # announcements (1)
- # beginners (14)
- # boot (244)
- # cider (2)
- # clojure (23)
- # clojure-dev (23)
- # clojure-poland (55)
- # clojure-russia (118)
- # clojure-uk (4)
- # clojurescript (143)
- # core-async (31)
- # core-logic (1)
- # cursive (30)
- # datascript (2)
- # datomic (3)
- # emacs (7)
- # hoplon (40)
- # ldnclj (8)
- # off-topic (2)
- # om (64)
- # reagent (10)
- # ring (1)
- # yada (71)
hi @malcolmsparks, I'm impressed with what yada has become after we last spoke at EuroClojure
@stijn: thanks - @ordnungswidrig pushed me to refactor the core.clj and it took on a simpler form as a result.
@ordnungswidrig: not sure what that means, I need to go on an emoticons course...
That pictures a human being raising it’s arm to celebrate joy.
LOL. I actually read „emotions course“ and thought: indeed, that’s the english people.
I can see the \o/ person now. I spent years typing to indicate smiling before I realised that if you look at it sideways you can see a smiling face.
(and that was before computer terminals replaced your ASCII with pictures, of course)
like slack just did
Oh, that supports my theory on english people
…and emotions
you mean that we're stupid?
I partially agree
reserved
I meant, english people are reserved, except after the pub or at sports. That’s what I learned from german television
that basically sums up english people - you've nailed it
i used to think brits were reserved, then i lived in norway for a few years
now i think there is a continuum of reservation which starts at the north pole and decreases as you approach the equator
except it flips over across Great Britain
well, I mean England really, the Scots are well..
ha, well kinda - northerners are better at saying hello in the street, but when it comes to actual emotions, not so much (and i have 46 years of experience with being a northerner, so i can say that)
that's true - I've been told off in Manchester for not talking to strangers
or at least, saying 'hello' , or 'howdo' or whatever you're meant to say in yorkshire (which i know manchester isn't in)
"smile love, it 'asn't 'appened yet"
they need to invent an emoticon for that
perhaps that's on the advanced course
too advanced for me
@malcolmsparks: i'm seeing some NPE (well, no protocol) coming out of representation/highest-charset-quality ...
stijn: have you tried having it return a nil response instead ?
(yada/yada (fn [ctx] (when-let [app (get apps (some-> ctx :parameters :app-id))]
(api/config-to-app
(get-in config [:statscentre :base-url])
(some-> ctx :parameters :version)
app)))
{:error-handler identity
:parameters {:get {:path {:app-id Keyword}}}})
@stijn the intention is that returning nil here would indeed yield 404.
let me take a look
@malcolmsparks: the response is 404
but what I wanted was, instead of yada generating a 404 response, search for possible matches in the bidi routes, and finally hit the default not-found-handler (with the some-fn trick you use in modular/bidi)
oh, that's impossible - because the bidi pattern has already matched and you've returned a handler - routing has ended
instead, I suggest you write a Matched record, which does the same logic and returns nil if there's no app-id (presumably app-id is a path parameter)
if there is an app-id, the Matched can 'succeed' and return {:handler this}, or {:handler foo} where foo is you Ring handler
it's a bit confusing, but take a look at how ResourcesMaybe is implemented
yes, as long as you provide them as a vector or vectors (pairs)
it's like this: the REST API sits in "/", and every part of the path is a path parameter
if order isn't important, you could use a map, but it's better if you use the vector of vectors style
yes, you'd have to be careful that the "/" route isn't matching greedily
I hope you get it working
the yada.swagger/Swaggered
resource makes quite a good example of what I was talking about earlier - it can match a bidi route and succeed based on some logic, and even serves itself, via the Ring protocol and using (succeed this ...)
the yada swagger spec 'handlers' are themselves yada resources, it's all a bit incestuous down there
@malcolmsparks: in order to add e.g. default representations to a set of yada resources I would yada.walk/merge-options ?
yes, each yada resource is independent, shared nothing. That's quite an important principle, because I didn't want to complect resources with routing
so the answer is data transformation
you can post-process the API tree by walking it
and since yada resources are simply records, you can assoc/dissoc to them
and they remain yada resources
well, pedestal has a lot of strengths - it is more mature than yada but hopefully yada will mature too ove rtime
bidi was heavily influenced by pedestal - but what I don't like about pedestal is the mixing of route declarations with inceptor chains - for me the domains are very different, one is a model, the other an implementation detail
I didn't look too much into detail, but I found it hard to see where you put state in the interceptors
@mccraigmccraig: Can you send me that stack-trace in the conneg?
plus the resource that is causing it?