Skip to content

Document collection always throw error while using readCollections #244

@PNat01

Description

@PNat01

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions