You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the Request-URI does not
point to an existing resource, the server MAY create a new resource,
depending on the patch document type (whether it can logically modify
a null resource) and permissions, etc.
So it would also make sense to create a Thing when e.g. doing a PATCH /api/2/things/<thingId> when this thing is not yet existing.
Using If-Match: * header it still would be possible to only update already existing things.
This would of course only make sense when "patching" a complete thing, so on path /.
The already existing ModifyToCreateThingTransformer could be enhanced to also handle MergeThing commands and transform to CreateThing if the thing is not yet existing.
The text was updated successfully, but these errors were encountered:
thjaeckle
changed the title
When sending a MergeThing command, it should also be possible to implicitly convert to "Create Thing" if thing is not yet existing
When PATCHing a Thing, it should also be possible to implicitly convert to "Create Thing" if thing is not yet existing
Apr 13, 2023
…t exist
* enhanced ModifyToCreateThingTransformer to also handle "MergeThing" in addition to "ModifyThing"
* adjusted ThingsRoute to also support using "_policy" and "_copyPolicyFrom"
Signed-off-by: Thomas Jäckle <thomas.jaeckle@beyonnex.io>
The RFC for HTTP PATCH states that:
So it would also make sense to create a Thing when e.g. doing a
PATCH /api/2/things/<thingId>
when this thing is not yet existing.Using
If-Match: *
header it still would be possible to only update already existing things.This would of course only make sense when "patching" a complete thing, so on path
/
.The already existing
ModifyToCreateThingTransformer
could be enhanced to also handleMergeThing
commands and transform toCreateThing
if the thing is not yet existing.The text was updated successfully, but these errors were encountered: