scim2 icon indicating copy to clipboard operation
scim2 copied to clipboard

The ListResponse's Resources attribute should be conditionally required

Open tsvetelin-petrov opened this issue 1 year ago • 1 comments

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

tsvetelin-petrov avatar Oct 02 '24 14:10 tsvetelin-petrov

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.

kqarryzada avatar Oct 03 '24 19:10 kqarryzada

We've just committed a change to fix this behavior, and it should be available in the next release.

kqarryzada avatar Nov 19 '24 21:11 kqarryzada

This feature is now available in the 3.2.0 release.

kqarryzada avatar Dec 04 '24 19:12 kqarryzada