Skip to content

[SCIM] Patch Add operation for multiple fields to addresses causes each field to be added separately. #808

@JesseDeH

Description

@JesseDeH

When performing a Patch with multiple values for a single address object, each value is stored as a separate entry in the addresses list.

See for an example the below Patch operation with the result.
Unfortunately, the example is the way that the SCIM implementation within Entra ID is sending the patches in this case, so I am not able to change the way that the operations are sent to the endpoint.

PatchOp

{
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:PatchOp"
    ],
    "Operations": [
        {
            "op": "Add",
            "path": "addresses[type eq \"work\"].streetAddress",
            "value": "Street"
        },
        {
            "op": "Add",
            "path": "addresses[type eq \"work\"].locality",
            "value": "Locality"
        },
        {
            "op": "Add",
            "path": "addresses[type eq \"work\"].region",
            "value": "Region"
        },
        {
            "op": "Add",
            "path": "addresses[type eq \"work\"].postalCode",
            "value": "PostalCode"
        },
        {
            "op": "Add",
            "path": "addresses[type eq \"work\"].country",
            "value": "Country"
        }
    ]
}

Resulting Address object

    "addresses": [
        {
            "streetAddress": "Street",
            "type": "work"
        },
        {
            "locality": "Locality",
            "type": "work"
        },
        {
            "region": "Region",
            "type": "work"
        },
        {
            "postalCode": "PostalCode",
            "type": "work"
        },
        {
            "country": "Country",
            "type": "work"
        }
    ]

I would expect in this case that the operation returns the address as a single object.

    "addresses": [
        {
            "streetAddress": "Street",
            "locality": "Locality",
            "region": "Region",
            "postalCode": "PostalCode",
            "country": "Country",
            "type": "work"
        }
    ]

Metadata

Metadata

Labels

bugSomething isn't working

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions