Add swagger docs for device documentation route

develop
Ensar Sarajčić 2018-11-04 15:07:34 +01:00
parent 5b35d17f59
commit af5aa5e092
4 changed files with 63 additions and 1 deletions

View File

@ -45,7 +45,7 @@ class RecordingsQuerySchema(Schema):
orders = fields.Raw() orders = fields.Raw()
class DeviceDocumentationSchema(BaseResourceSchema): class DeviceDocumentationSchema(BaseTimestampedResourceSchema):
device_id = fields.Integer(dump_only=True) device_id = fields.Integer(dump_only=True)
text = fields.String(required=True) text = fields.String(required=True)

View File

@ -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'

View File

@ -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'

View File

@ -233,6 +233,25 @@ definitions:
modified_at: modified_at:
$ref: '#/definitions/datetime' $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: DeviceShareTokenCreation:
type: object type: object
required: required: