katharsis-framework icon indicating copy to clipboard operation
katharsis-framework copied to clipboard

Client/Server content type management incoherent and not compliant with JSON API spec

Open gilles-gosuin opened this issue 7 years ago • 3 comments

We started using the Katharsis Client in our tests and noticed something weird when trying to handle errors and map them back to the original exception.

After some debugging, we realised the client refuses to handle the server response because of a content type header mismatch: in io.katharsis.client.internal.AbstractStub:90, it expects the content type to be exactly application/vnd.api+json, whereas the server returns application/vnd.api+json;charset=UTF-8, as set in io.katharsis.spring.KatharsisFilterV2:144.

In addition to being incoherent between the client and the server, this looks non-compliant with the spec, which is very strict about how clients and servers are supposed to behave regarding content negociation.

(We're using Katharsis 3.0.2)

gilles-gosuin avatar Jun 30 '17 14:06 gilles-gosuin

That certainly is not compliant to the spec. Could you give more information on the configuration of the framework for context?

hibaymj avatar Jul 01 '17 00:07 hibaymj

Take a look at the code I mentioned; these are hardcoded constants that are not influenced by the configuration.

This is a @SpringBootApplication with the @Import(KatharsisConfigV3.class) annotation.

gilles-gosuin avatar Jul 01 '17 00:07 gilles-gosuin

I think the pull request @ #449 should fix this issue also

ckarthik17 avatar Aug 29 '17 06:08 ckarthik17