Skip to content
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

Can't update metadata with patch #2950

Closed
5 of 6 tasks
woylie opened this issue Dec 14, 2022 · 1 comment · Fixed by #3103
Closed
5 of 6 tasks

Can't update metadata with patch #2950

woylie opened this issue Dec 14, 2022 · 1 comment · Fixed by #3103
Labels
bug Something is not working.

Comments

@woylie
Copy link
Contributor

woylie commented Dec 14, 2022

Preflight checklist

Describe the bug

Not sure whether it's a bug, or not supported (the HTTP API docs don't mention metadata patching not being supported, though), or whether I'm doing something wrong. I'm trying to update a single metadata_admin field via the identity patch endpoint, but depending on the JSON patch operation I use, I'm either getting an error or the metadata is set to NULL.

Reproducing the bug

  1. create an identity with metadata_admin set to {"state_detailed": "active"}
  2. PATCH /admin/identities/{id} with this request body:
[
  {
    "op": "replace",
    "path": "/state",
    "value": "inactive"
  },
  {
    "op": "add",
    "path": "/metadata_admin/state_detailed",
    "value": "suspended"
  }
]

This results in the error add operation does not apply: doc is missing path: \"/metadata_admin/state_detailed\": missing value.

On the other, when I run the request with this request body:

[
  {
    "op": "replace",
    "path": "/state",
    "value": "inactive"
  },
  {
    "op": "add",
    "path": "/metadata_admin",
    "value": {
      "state_detailed": "suspended"
    }
  }
]

I'm getting a success respone, but now metadata_admin is NULL in the database (same with replace).

Relevant log output

No response

Relevant configuration

No response

Version

0.11.0

On which operating system are you observing this issue?

macOS

In which environment are you deploying?

Docker Compose

Additional Context

No response

@quintilation
Copy link

is this patch released?
I believe I am still seeing this problem when running the quickstart docker images

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants