Fork me on GitHub
#liberator
<
2015-07-16
>
malcolmsparks20:07:23

I've been working on a new conneg namespace for yada, but in such a way it could be used by Liberator, as @ordnungswidrig and I discussed at euroclojure this year

malcolmsparks20:07:02

the idea is that you specify a vector of maps, each map defines a 'cross-product' of possible representations

malcolmsparks20:07:24

that way, you could offer Japanese in Shift_JIS, but only on GETs

malcolmsparks20:07:08

while restricting English to UTF-8 and US-ASCII, unless there's an error, when you can renegotiate and provide errors in html, or json

malcolmsparks20:07:28

i.e. the sort of flexibility Apache has

malcolmsparks20:07:10

I'd be very interested in any initial impressions and other feedback

malcolmsparks20:07:36

I haven't done langs or transfer encodings yet, but they're very possible in this design

malcolmsparks20:07:36

also, representation options are properly sorted in priority order as per the HTTP specs, as per the old TODO in the original conneg.clj

malcolmsparks20:07:58

I'm happy to spin it off into its own project if necessary, or redo it totally, but I needed something with more features than conneg.clj was providing

ordnungswidrig21:07:24

I thought about doing the same. The backside is that liberator is bound to an implementation model that does step-by-step negotiation on media-type, language, charset and encoding. I’ve started refactoring liberator’s conneg namespace and still have not found a way to provide a combined conneg as you described while still being backward compatible.