-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace op with value of empty object results in circular reference #489
Comments
Hey @blairlunceford thanks for your report, I will release a version |
Hi @thomaspoignant, I've encountered some weird behavior due to this fix. When I put value = {} it always it force the output to be
In this case, what I believe is, the correct behavior is to merge the empty object to the original one |
@leonardo-speranzon can you open an issue dedicated to this? |
I've opened the issue, I will try to make a PR in the next days |
Describe the bug
We've seen Azure AD SCIM send replace operations with an empty object in the
value
field:They sometimes send this operation when there isn't a multi-valued attribute of that type. When this happens, the
scim-patch
library applies the update in a way that introduces a circular reference to the resource object. This causes errors when we callJSON.stringify
on the resource object.To Reproduce
Expected behavior
We would expect operations to be applied to resources in a way that doesn't introduce a circular reference in the object. Though, admittedly, this update is a bit strange from Azure AD SCIM (the value should be a string here I believe, and this only seems to happen with an empty object).
Additional context
We wanted to flag this in the upstream library. We're currently looking at workarounds on our end to either edit the resource before sending it to the library, or checking for circular references when we get the resource from the library.
The text was updated successfully, but these errors were encountered: