jsonapi-converter
jsonapi-converter copied to clipboard
ReadDocumentCollection without Id attribute returns a collection of the same object instance
We are implementing a batch POST api to create a collection of objects in s single request. The ids will be generated on the server. We have configured ResourceConverter.disableDeserializationOption(DeserializationFeature.REQUIRE_RESOURCE_ID)
For each element in the json array, the ResourceConverter returns the same object instance. Looks like it is caching the deserialized objects in a temporary cache, using a concatenation of the type value and id as the cache key. Since our ids are null, it uses just the type value as the cache key. Before deserializing each object, it checks the cache and finds the same object every time.
@jeffcjames this is indeed how caching is implemented at the moment. Will take a look as soon as i can.
This can be solved by using local identifier functionality.