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

Using wildcard in "put-metadata" header for PATCH / MergeThing command adds the metadata also for non-affected fields #1790

Open
thjaeckle opened this issue Oct 31, 2023 · 4 comments
Labels

Comments

@thjaeckle
Copy link
Member

When e.g. using the following put-metadata header:

[{"key":"*/createdAt","value": "now!"}]

On a HTTP request:

PATCH /api/2/things/my:thing-1

E.g. sending the payload:

{
  "attributes": {
    "only-one": 2
  }
}

Will also lead to all existing fields in the Thing getting the metadata, e.g. as in:

{
  "_metadata": {
    "thingId": {
        "createdAt": "now!"
    },
    "policyId": {
        "createdAt": "now!"
    },
    "attributes": {
        "only-one": {
            "createdAt": "now!"
        }
    }
  }
}

That is unexpected and should instead only modify the metadata of the provided fields to "PATCH".

@thjaeckle thjaeckle added the bug label Oct 31, 2023
@sejal-bansal
Copy link

@thjaeckle I would like to work on this issue. Could you please assign it to me?

@thjaeckle
Copy link
Member Author

@sejal-bansal cool, thanks
This however is probably not trivial to fix, I would assume.

@thjaeckle
Copy link
Member Author

@sejal-bansal any update here? Do you work on this or shall I unassign the issue again?

@kulta4

This comment was marked as off-topic.

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

No branches or pull requests

3 participants