Fork me on GitHub
#ring-swagger
<
2016-03-12
>
mikecarter18:03:40

this may be more of a Compojure question however, does anyone know of a way to handle optional URL file extensions?

mikecarter18:03:57

so /jobs and /jobs.json are both valid?

lmergen18:03:02

this is definitely a Compojure question, but let me see

lmergen18:03:18

I personally think that this opens up a can of worms

lmergen18:03:28

what if someone requests .json, but has Accept-Encoding: XML ?

mikecarter18:03:02

my API only serves JSON however, one of the clients is a Rails site running ActiveResource and that requests .json extensions in the URLs

mikecarter18:03:51

aha! just found that you can remove the file extensions from the URL in rails

mikecarter18:03:53

problem solved simple_smile

lmergen22:03:26

that would me my approach too, use middleware to transform a .json extension to a content-encoding simple_smile