I made these changes as missing TYPE attribute in the DATA node was causing a null pointer in ResourceConverter.createIdentifier. I ended up adding some extra validation š¤·āā
Shortlist of changes:
DATA node must be valid primary data:
a single resource object, a single resource identifier object, or null, for requests that target single resources
an array of resource objects, an array of resource identifier objects, or an empty array ([]), for requests that target resource collections
TYPE and ATTRIBUTES attributes now required for resource objects
null DATA not allowed in readDocumentCollection must be []
null DATA still fine for readDocument
enforcing node types on attributes (e.g. META must be a containerNode, TYPE must be a valueNode)
INCLUDED relationships must be an array of valid resource objects, or an empty array
RELATIONSHIPSDATA objects must be valid resource identifier objects, no exception thrown for invalid but they will be skipped along with any valid INCLUDED relationships objects (not sure if I should throw an exception here?)
I made these changes as missing
TYPE
attribute in theDATA
node was causing a null pointer inResourceConverter.createIdentifier
. I ended up adding some extra validation š¤·āāShortlist of changes:
DATA node must be valid primary data:
a single resource object, a single resource identifier object, or null, for requests that target single resources
an array of resource objects, an array of resource identifier objects, or an empty array ([]), for requests that target resource collections
TYPE
andATTRIBUTES
attributes now required forresource objects
null
DATA
not allowed inreadDocumentCollection
must be[]
null
DATA
still fine forreadDocument
enforcing node types on attributes (e.g.
META
must be acontainerNode
,TYPE
must be avalueNode
)INCLUDED
relationships must be an array of valid resource objects, or an empty arrayRELATIONSHIPS
DATA
objects must be valid resource identifier objects, no exception thrown for invalid but they will be skipped along with any validINCLUDED
relationships objects (not sure if I should throw an exception here?)