wso2 / charon

120 stars 162 forks source link

Fixed empty value object issue inside v2 role patch operation #395

Closed PasinduYeshan closed 10 months ago

PasinduYeshan commented 10 months ago

This PR addresses an issue in the current API implementation where a PATCH request with an empty "value" object within the "Operations" array is resulting in a 500 Internal Server Error.

curl --location --request PATCH 'https://localhost:9443/scim2/v2/Roles/c3445ed2-a6a9-466b-9796-1094b160770a' \
--header 'Content-Type: application/scim+json' \
--header 'Accept: application/scim+json' \
--header 'Authorization: Basic YWRtaW46YWRtaW4=' \
--header 'Cookie: atbv=7701cee0-00fb-4a32-8d5a-ae677f76808c' \
--data '{
    "Operations": [
        {
            "op": "replace",
            "value": {
            }
        }
    ],
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:PatchOp"
    ]
}'

We have modified this behavior to return a 400 Bad Request error instead.

Related Issue

dewniMW commented 10 months ago

@PasinduYeshan can you add the git issue?