diff --git a/app/api/resources/device.py b/app/api/resources/device.py index 51a3eec..499fd9a 100644 --- a/app/api/resources/device.py +++ b/app/api/resources/device.py @@ -45,7 +45,7 @@ class RecordingsQuerySchema(Schema): orders = fields.Raw() -class DeviceDocumentationSchema(BaseResourceSchema): +class DeviceDocumentationSchema(BaseTimestampedResourceSchema): device_id = fields.Integer(dump_only=True) text = fields.String(required=True) diff --git a/app/api/resources/swagger/get_device_documentation_spec.yaml b/app/api/resources/swagger/get_device_documentation_spec.yaml new file mode 100644 index 0000000..306ce0e --- /dev/null +++ b/app/api/resources/swagger/get_device_documentation_spec.yaml @@ -0,0 +1,17 @@ +Gets a device documentation +--- +tags: + - Device + - Docs +parameters: + - in: path + name: device_id + required: true + type: integer + description: Id of the device +responses: + 200: + description: Success + schema: + $ref: '#/definitions/DeviceDocumentation' + diff --git a/app/api/resources/swagger/update_device_documentation_spec.yaml b/app/api/resources/swagger/update_device_documentation_spec.yaml new file mode 100644 index 0000000..ed68732 --- /dev/null +++ b/app/api/resources/swagger/update_device_documentation_spec.yaml @@ -0,0 +1,26 @@ +Updates a device documentation +--- +tags: + - Device + - Docs +parameters: + - in: path + name: device_id + required: true + type: integer + description: Id of the device + - in: body + name: body + required: true + schema: + $ref: '#/definitions/DeviceDocumentation' +responses: + 200: + description: Success + schema: + type: object + required: + - content + properties: + content: + $ref: '#/definitions/DeviceDocumentation' diff --git a/app/swagger/template.yaml b/app/swagger/template.yaml index 5371f1b..62d58ec 100644 --- a/app/swagger/template.yaml +++ b/app/swagger/template.yaml @@ -233,6 +233,25 @@ definitions: modified_at: $ref: '#/definitions/datetime' + DeviceDocumentation: + type: object + required: + - device_id + - text + - created_at + - modified_at + properties: + device_id: + $ref: '#/definitions/id' + text: + type: string + description: Text of documentation + example: This device is used for ... + created_at: + $ref: '#/definitions/datetime' + modified_at: + $ref: '#/definitions/datetime' + DeviceShareTokenCreation: type: object required: