Skip to content

Conversation

@davidsarosap
Copy link
Contributor

Responding with 404 when updating an immutable attribute of a non-exi… (#235)

…sting resource

Currently when doing a Patch of an immutable attribute of a non-existing
resource the status code is 400.
But it should be a 404, because the validation of the body should happen
after the validation of the path.

Summary:
PATCH /Groups/nonexisting

{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:PatchOp"
  ],
  "Operations": [
    {
      "op": "remove",
      "path": "displayName",
      "value": "aName"
    }
  ]
}

Current response:

{
  "status": "400",
  "scimType": "invalidValue",
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:Error"
  ],
  "detail": "Attribute with name urn:ietf:params:scim:schemas:core:2.0:Group:displayName is required and cannot not be removed"
}

After patch applied:

{
  "status": "404",
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:Error"
  ],
  "detail": "HTTP 404 Not Found"
}

SAP#235)

…sting resource

Currently when doing a Patch of an immutable attribute of a non-existing
resource the status code is 400.
But it should be a 404, because the validation of the body should happen
after the validation of the path.

Summary:
PATCH /Groups/nonexisting
```
{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:PatchOp"
  ],
  "Operations": [
    {
      "op": "remove",
      "path": "displayName",
      "value": "aName"
    }
  ]
}
```

Current response:
```
{
  "status": "400",
  "scimType": "invalidValue",
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:Error"
  ],
  "detail": "Attribute with name urn:ietf:params:scim:schemas:core:2.0:Group:displayName is required and cannot not be removed"
}
```

After patch applied:
```
{
  "status": "404",
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:Error"
  ],
  "detail": "HTTP 404 Not Found"
}
```
@hborisov hborisov merged commit 32655dd into SAP:scimono-jakarta-branch Oct 2, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants