From c65b026906c7b2f2770b559c3434cc227993a632 Mon Sep 17 00:00:00 2001 From: Ben Francis Date: Thu, 22 Apr 2021 18:17:41 +0100 Subject: [PATCH 1/3] Rename actions to match properties and events --- directory.td.json | 38 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/directory.td.json b/directory.td.json index 657a02d1..3db31469 100644 --- a/directory.td.json +++ b/directory.td.json @@ -53,10 +53,12 @@ "security": "combo_sc", "base": "https://tdd.example.com", "actions": { - "createTD": { + "createThing": { + "@type": "CreateThingAction", "description": "Create a Thing Description", "uriVariables": { "id": { + "@type": "ThingID", "title": "Thing Description ID", "type": "string", "format": "iri-reference" @@ -64,7 +66,7 @@ }, "forms": [ { - "href": "/td/{id}", + "href": "/things/{id}", "htv:methodName": "PUT", "contentType": "application/td+json", "response": { @@ -81,14 +83,14 @@ "scopes": "write" }, { - "href": "/td", + "href": "/things", "htv:methodName": "POST", "contentType": "application/td+json", "response": { "description": "Success response", "htv:headers": [ { - "description": "System-generated UUID (version 4) URN", + "description": "System-generated URI", "htv:fieldName": "Location", "htv:fieldValue": "" } @@ -106,10 +108,11 @@ } ] }, - "updateTD": { + "updateThing": { "description": "Update a Thing Description", "uriVariables": { "id": { + "@type": "ThingID", "title": "Thing Description ID", "type": "string", "format": "iri-reference" @@ -117,7 +120,7 @@ }, "forms": [ { - "href": "/td/{id}", + "href": "/things/{id}", "htv:methodName": "PUT", "contentType": "application/td+json", "response": { @@ -132,21 +135,9 @@ } ], "scopes": "write" - } - ] - }, - "updatePartialTD": { - "description": "Update parts of a Thing Description", - "uriVariables": { - "id": { - "title": "Thing Description ID", - "type": "string", - "format": "iri-reference" - } - }, - "forms": [ + }, { - "href": "/td/{id}", + "href": "/things/{id}", "htv:methodName": "PATCH", "contentType": "application/merge-patch+json", "response": { @@ -169,10 +160,11 @@ } ] }, - "deleteTD": { + "deleteThing": { "description": "Delete a Thing Description", "uriVariables": { "id": { + "@type": "ThingID", "title": "Thing Description ID", "type": "string", "format": "iri-reference" @@ -180,7 +172,7 @@ }, "forms": [ { - "href": "/td/{id}", + "href": "/things/{id}", "htv:methodName": "DELETE", "response": { "description": "Success response", @@ -428,4 +420,4 @@ ] } } -} \ No newline at end of file +} From a161a7391dad7d698d9542ea20252dee91df0b85 Mon Sep 17 00:00:00 2001 From: Ben Francis Date: Thu, 22 Apr 2021 20:23:19 +0100 Subject: [PATCH 2/3] Address review comments --- directory.td.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/directory.td.json b/directory.td.json index 3db31469..db5b5e8e 100644 --- a/directory.td.json +++ b/directory.td.json @@ -91,8 +91,7 @@ "htv:headers": [ { "description": "System-generated URI", - "htv:fieldName": "Location", - "htv:fieldValue": "" + "htv:fieldName": "Location" } ], "htv:statusCodeValue": 201 @@ -109,6 +108,7 @@ ] }, "updateThing": { + "@type": "UpdateThingAction", "description": "Update a Thing Description", "uriVariables": { "id": { @@ -161,6 +161,7 @@ ] }, "deleteThing": { + "@type": "DeleteThingAction", "description": "Delete a Thing Description", "uriVariables": { "id": { From 96cd40ff4c65271d15566aa0e7cb9d7d633d445a Mon Sep 17 00:00:00 2001 From: Ben Francis Date: Tue, 18 May 2021 15:17:15 +0100 Subject: [PATCH 3/3] Re-separate update and partial update --- directory.td.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/directory.td.json b/directory.td.json index db5b5e8e..2e1f92fa 100644 --- a/directory.td.json +++ b/directory.td.json @@ -136,6 +136,20 @@ ], "scopes": "write" }, + ] + }, + "partialUpdateThing": { + "@type": "PartialUpdateThingAction", + "description": "Update a Thing Description", + "uriVariables": { + "id": { + "@type": "ThingID", + "title": "Thing Description ID", + "type": "string", + "format": "iri-reference" + } + }, + "forms": [ { "href": "/things/{id}", "htv:methodName": "PATCH",