Fork me on GitHub
#yada
<
2017-01-10
>
danielcompton00:01:07

For some reason I had the impression that I could just return a response on a core.async channel to Yada and it would handle it automatically. Looking at the docs though, that seems to only be the case for SSE. Should I be making it into a deferred instead?

danielcompton00:01:30

Are there any strategies for testing requests from the REPL? I’m not quite sure how to create a context for a request and then to call it against my app

malcolmsparks09:01:41

@danielcompton The security auth stuff is still a wip, sorry, it needs more docs - I'm currently working on oauth2 for a client so I should be able to visit this soon

malcolmsparks09:01:53

Yes, you should be able to pass a core.async channel from yada - but I've heard on this channel that people might have had trouble doing so - haven't got to the bottom of it.

malcolmsparks09:01:01

According to the manifold docs you should be able to do this

malcolmsparks09:01:12

But I haven't tested that it's still the case

dominicm10:01:55

I think manifold had a change. Where a channel is not a deferred, but only a stream. So I would guess yada would interpret that as SSE/Websockets instead of waiting for a response.

nha11:01:04

re: oauth, I am using this in my project, will clean a bit and make a PR: https://github.com/nha/yada/tree/feature/parametrize-gh-oauth-cookie-y2

dominicm14:01:30

I think the oauth is being hacked on right now

nha15:01:02

Good: I couldn’t have had a look before this evening anyway, so unless you think there is something useful there, I’ll just leave it to you

lmergen16:01:54

i have a yada resource, that should accept decimal as a path parameter

lmergen16:01:16

i would like yada to return a 400 error when a string has been provided instead

lmergen16:01:23

i know i can use bidi to match based on regex

lmergen16:01:31

but i would much rather use spec to do this

lmergen16:01:09

right now, if this happens, spec throws an error somewhere and a 500 is returned, which is semantically incorrect

lmergen16:01:50

what would be a good approach to do this ? i would almost think a yada/resource should have some way to be provided a spec, which is used to validate :parameters

lmergen16:01:59

i know that yada provides coercion, but i would prefer to have one spec system to “rule them all"

dominicm21:01:37

@lmergen you'd probably need to insert a new middleware which would filter spec exceptions and do the right thing. I think spec support is a direction for the future. Just not ready yet.