katharsis-project / katharsis-framework

Katharsis adds powerful layer for RESTful endpoints providing implementenation of JSON:API standard
http://katharsis.io
Apache License 2.0
135 stars 65 forks source link

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

Open gilles-gosuin opened 7 years ago

gilles-gosuin commented 7 years ago

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)

hibaymj commented 7 years ago

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

gilles-gosuin commented 7 years ago

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.

ckarthik17 commented 7 years ago

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