Răsfoiți Sursa

Create docs for device deletion route

Lee Morgan 2 luni în urmă
părinte
comite
dbe2f9270b
2 a modificat fișierele cu 47 adăugiri și 0 ștergeri
  1. 3 0
      docs/openapi.yaml
  2. 44 0
      docs/paths/device/delete.yaml

+ 3 - 0
docs/openapi.yaml

@@ -63,3 +63,6 @@ paths:
   /home/{home_id}/device:
     post:
       $ref: "./paths/device/create.yaml"
+  /home/{home_id}/device/{device_id}:
+    delete: 
+      $ref: "./paths/device/delete.yaml"

+ 44 - 0
docs/paths/device/delete.yaml

@@ -0,0 +1,44 @@
+operationId: deviceDelete
+summary: Delete
+security:
+  - UserAuth: []
+description: Delete a device
+tags: [Device]
+parameters:
+  - name: home_id
+    in: path
+    description: ID of home the device belongs to
+    required: true
+    schema:
+      type: string
+      format: uuid
+      example: 019e18e4-be63-7edc-8a9c-f11dfc0abe29
+  - name: device_id
+    in: path
+    description: ID of the device to delete
+    required: true
+    schema:
+      type: string
+      format: uuid
+      example: 019e18e5-66f7-7e23-b18e-42a3489798c6
+
+responses:
+  "200":
+    description: "Device deleted (always returns '{success: true}')"
+    content:
+      application/json:
+        schema:
+          type: object
+          properties:
+            success:
+              type: boolean
+  "400":
+    $ref: "#/components/responses/400"
+  "401":
+    $ref: "#/components/responses/401"
+  "403":
+    $ref: "#/components/responses/403"
+  "404":
+    $ref: "#/components/responses/404"
+  "500":
+    $ref: "#/components/responses/500"