The ListResponse's Resources attribute should be conditionally required
Describe the bug Considering the RFC specification, the Resources field of ListResponse is required only if the "totalResults" is non-zero (https://datatracker.ietf.org/doc/html/rfc7644#section-3.4.2). In the current implementation (https://github.com/pingidentity/scim2/blob/master/scim2-sdk-common/src/main/java/com/unboundid/scim2/common/messages/ListResponse.java#L74), the "Resources" attribute is marked as required, and if a response with no resources is received, a deserialization exception is thrown.
To Reproduce Deserialize a ListResponse with no resources.
Expected behavior The Resources attribute is to be required only if the "totalResults" is non-zero, or to be marked as optional and the validation is to be expected from the consumer of the class.
Additional context
- Java version: 17
- SCIM 2 SDK version: 2.3.7
Hi @tsvetelin-petrov, I agree that the SCIM SDK should not fail to deserialize responses in this case. I plan to take a look at this in the coming weeks.
We've just committed a change to fix this behavior, and it should be available in the next release.
This feature is now available in the 3.2.0 release.