Fork me on GitHub

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?


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


@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


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.


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


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


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.


re: oauth, I am using this in my project, will clean a bit and make a PR:


I think the oauth is being hacked on right now


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


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


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


i know i can use bidi to match based on regex


but i would much rather use spec to do this


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


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


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


@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.