featherbed icon indicating copy to clipboard operation
featherbed copied to clipboard

Documentation for handling alternative accept headers

Open igorlev opened this issue 7 years ago • 2 comments

Featherbed currently ships with an existing typelevel specification of a JSON encoder for an "application/json" content type.

It would be helpful to include some documentation for handling alternative specifications such as "application/vnd.somevendor+json; version=1" (as opposed to non-JSON content type encodings such as "text/xml").

igorlev avatar Mar 13 '17 14:03 igorlev

@igorlev I'm actually not sure that could be supported as-is right now - currently we extract the base content type (without the ; arguments, in that case application/vnd.somevender+json and that's the content type that's used.

I'd welcome a PR for it, though!

jeremyrsmith avatar Mar 13 '17 15:03 jeremyrsmith

Hmm, just noticed that the extracted content-type (used for decoder matching) does in fact drop the ;version=1 portion.

I might be missing something, but is there already documentation for adding the alternate content-type while still reusing the same circe JSON decoder?

As I understand more of the code base might try contributing the fix for the version drop.

igorlev avatar Mar 13 '17 15:03 igorlev