Fork me on GitHub
#yada
<
2016-01-28
>
imre12:01:30

does anyone have experience using :sub-resource in yada resource definitions?

malcolmsparks17:01:58

have a look at the file directory stuff that's behind (yada dir)

malcolmsparks17:01:46

the point with sub-resources is that sometimes you don't know up-front what the resource model is - perhaps you don't know until the request is made

malcolmsparks17:01:15

the directory contents can change, so you need to wait until the request arrives (I also extract the path-info from the request for this)

malcolmsparks17:01:31

different 'types' of files have different possible representations etc.

imre17:01:38

so if I get it right, the :sub-resource fn should return a resource model instead of a ring-ish response, right?

jethroksy17:01:46

by (yada dir) do you mean (yada "/public") for example?

malcolmsparks17:01:30

@jethroksy: I mean (yada ( "/public")), sorry if I am being pedantic and that's what you mean. (yada "/public") will turn that java.io.String to a handler

jethroksy17:01:18

I meant no offence

jethroksy17:01:53

its just that I'm not very familiar with the api as it is now, and I don't want to be misunderstanding things