소스 검색

Create schema for devices

Lee Morgan 2 달 전
부모
커밋
baf3bb33c2
2개의 변경된 파일22개의 추가작업 그리고 0개의 파일을 삭제
  1. 20 0
      docs/components/schemas/device.yaml
  2. 2 0
      docs/openapi.yaml

+ 20 - 0
docs/components/schemas/device.yaml

@@ -0,0 +1,20 @@
+type: object
+properties:
+  id:
+    type: string
+    format: uuid
+    description: Unique ID of the user (v7)
+    example: 019e13e5-db74-73b8-8554-16e0d3cf31b5
+  home_id:
+    type: string
+    format: uuid
+    description: Unique ID of the home the device belongs to
+    example: 019e13e7-16a7-7614-a5c1-f655790c6464
+  name:
+    type: string
+    description: Name of device from Zigbee2MQTT
+    example: bedroom_north
+  description:
+    type: string
+    description: A description of the device
+    example: Northern bedroom light switch

+ 2 - 0
docs/openapi.yaml

@@ -18,6 +18,8 @@ components:
       $ref: "./components/schemas/user.yaml"
     Home:
       $ref: "./components/schemas/home.yaml"
+    Device:
+      $ref: "./components/schemas/device.yaml"
   responses:
     "400":
       $ref: "./components/responses/400.yaml"