Skip to content

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

@thjaeckle

Description

@thjaeckle

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".

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions