Closed jsteinbrunner closed 4 years ago
I don't use this library anymore. We have switched to https://github.com/kamikat/moshi-jsonapi. 😉
@Kevinrob Any library which requires you to extend your model classes must be avoided like plague
@jasminb I wanted to follow up to get your thoughts. I'm happy to submit a PR with this change, but wanted to see if you agreed with this behavior before doing so.
@Kevinrob Any library which requires you to extend your model classes must be avoided like plague
Yeah, it's a good point 😀 But jackson library is a pain for Android application (performance, size, etc...).
@jsteinbrunner Please correct me if I'm wrong, you are saying that you have a case where client encounters completely unknown relationship field and the lib fails to ignore it?
@jasminb I'm embarrassed to admit that I may have created this issue when there isn't actually a problem. We identified this workflow, had seen the issue in the past on an earlier version, and looking through the code, I made a bad assumption that it still existed.
I apologize for not doing my due diligence and verifying the problem existed by writing a test against the latest version. I am unable to write a test now that reproduces the issue, and can see in the code why it now works. I will close this issue and if I discover something new in the future, I will let you know.
@jsteinbrunner no problem at all.
Hello @jasminb,
The library has 2 deserialization features that allow for missing types in
included
properties andrelationships
properties.ALLOW_UNKNOWN_INCLUSIONS
- When set to true, it silently ignores unknown types found in includesALLOW_UNKNOWN_TYPE_IN_RELATIONSHIP
- When set to true, ignores unknown types found in relationships, but only if the class attribute is an interface. This code was added specifically to handle supporting polymorphic relationships and allowing for new implementations to be added in a backwards compatible way.However, we have run into scenarios in our project where a POST/PATCH to an endpoint has side effects and we return these in the response. In some cases, we may side load an affected resource type that is not understood on the client (if it was recently added).
What are your thoughts on removing the
isInterface
check at https://github.com/jasminb/jsonapi-converter/blob/develop/src/main/java/com/github/jasminb/jsonapi/ResourceConverter.java#L513 so the behavior is consistent withALLOW_UNKNOWN_INCLUSIONS
?CC: @Kevinrob