You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the above code always throws a exception while reading a collection of document. It erros out during validation in this method
It calls ValidationUtils.ensureValidDocument(ObjectMapper mapper, JsonNode resourceNode) which throws an error at the snipped of code
if (!hasData && !hasMeta) {
throw new InvalidJsonApiResourceException();
}
My json has a data array field
sample
{"data":[{"id":"3f33589e-1d1d-46f7-aff8-94be3252a1ea","type":"xxx",...},{"id":"3f33589e-1d1d-46f7-aff8-94be3252a1ea","type":"xxx",...}]}
Please help asap.
Thanks in advance.
The text was updated successfully, but these errors were encountered:
Did you try debugging the validation logic? Please try to set a break point before validation error is thrown and check if resourceNode has data attribute. Code that does the check is pretty simple and the only obvious reason for the error that you are seeing is that the resourceNode does not have meta nor data nodes.
JSONAPIDocument<List> jsonApiDocumentCollection =
converter.readDocumentCollection(data, clazz);
the above code always throws a exception while reading a collection of document. It erros out during validation in this method
It calls ValidationUtils.ensureValidDocument(ObjectMapper mapper, JsonNode resourceNode) which throws an error at the snipped of code
if (!hasData && !hasMeta) {
throw new InvalidJsonApiResourceException();
}
My json has a data array field
sample
{"data":[{"id":"3f33589e-1d1d-46f7-aff8-94be3252a1ea","type":"xxx",...},{"id":"3f33589e-1d1d-46f7-aff8-94be3252a1ea","type":"xxx",...}]}
Please help asap.
Thanks in advance.
The text was updated successfully, but these errors were encountered: