scim2
scim2 copied to clipboard
ReplaceOperation with an empty-array value is rejected unnecessarily
Problem behavior
The library rejects payloads that are valid according to RFC 7644, Sec. 3.5.2.3. Replace Operation. Specifically, it rejects Operations
whose value
is the empty array []
:
if(value == null || value.isNull() ||
((value.isArray() || value.isObject()) && value.size() == 0))
{
throw BadRequestException.invalidSyntax(
"value field must not be null or an empty container");
}
Why this is important Okta sends the following payload which fails to be deserialized:
{
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:PatchOp"
],
"Operations": [
{
"op": "replace",
"path": "members",
"value": []
}
]
}
Historical context The code doing this validation was merged in #26.
Suggested resolution
Change the check in PatchOperation.java
to:
if(value == null || value.isNull() ||
(value.isObject() && value.size() == 0))
{
throw BadRequestException.invalidSyntax(
"value field must not be null or an empty object");
}
Any chances of this being done anytime in the future?