Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Merged
merged 2 commits into from
Aug 6, 2024

Conversation

davidsarosap
Copy link
Contributor

…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"
}

@davidsarosap davidsarosap marked this pull request as ready for review August 1, 2024 15:24
@hborisov hborisov merged commit 0e625d2 into SAP:master Aug 6, 2024
3 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants