jsonapi-converter icon indicating copy to clipboard operation
jsonapi-converter copied to clipboard

Potential fix for Issue #30

Open emetsger opened this issue 8 years ago • 1 comments

emetsger avatar Jun 24 '16 02:06 emetsger

This PR is a little lacking, but it does fix the unit test.

The PR is lacking because in the absence of a resource linkage, it will invoke ObjectMapper.readTree(byte[]) to determine the cardinality before invoking readDocument[Collection]. The result of readTree(byte[]) is discarded. Of course, readTree(byte[]) will be invoked again, on the same content, inside of readDocument[Collection].

So this PR results in an extra call to readTree when resolving relationships that do not have resource linkages. Maybe somehow the result could be cached, and re-used. I'm not sure if the ResourceCache accommodates that use case or not.

emetsger avatar Jun 24 '16 02:06 emetsger