university-final-iot-backend/app/swagger/template.yaml

177 lines
3.3 KiB
YAML
Raw Normal View History

2018-05-07 14:13:07 +00:00
---
servers:
- url: https://final-iot-backend.herokuapp.com/
description: Heroku deployed app for testing
basePath: ""
definitions:
username:
type: string
description: User's name in the system
default: testusername
2018-05-08 14:45:09 +00:00
id:
type: integer
description: ID
default: 1
datetime:
type: string
description: Time
2018-09-17 22:51:26 +00:00
devicetypename:
type: string
description: Name of device type
default: STANDARD
2018-05-08 14:45:09 +00:00
devicename:
type: string
description: Name of device
default: My device
devicetype:
type: int
description: Type of device
default: 1
2018-05-07 14:13:07 +00:00
email:
type: string
format: email
description: User's registered email
default: user@test.com
password:
type: string
format: password
description: User's password
default: TestPassword1234
status:
type: string
description: Status of request
message:
type: string
description: Descriptive message
Credentials:
type: object
required:
- username
- password
properties:
username:
$ref: '#/definitions/username'
password:
$ref: '#/definitions/password'
User:
type: object
required:
- username
- password
- email
properties:
username:
$ref: '#/definitions/username'
password:
$ref: '#/definitions/password'
email:
$ref: '#/definitions/email'
2018-05-08 14:45:09 +00:00
Recording:
type: object
required:
- recorded_at
- record_type
- record_value
properties:
recorded_at:
$ref: '#/definitions/datetime'
record_type:
$ref: '#/definitions/id'
record_value:
type: string
description: Value of the recording
default: '25 degrees'
2018-09-17 22:51:26 +00:00
DeviceType:
type: object
required:
- id
- name
properties:
id:
$ref: '#/definitions/id'
name:
$ref: '#/definitions/devicetypename'
2018-05-08 14:45:09 +00:00
Device:
type: object
required:
- id
- name
2018-09-17 22:51:26 +00:00
- device_type
2018-05-08 14:45:09 +00:00
properties:
id:
$ref: '#/definitions/id'
name:
$ref: '#/definitions/devicename'
2018-09-17 22:51:26 +00:00
device_type:
$ref: '#/definitions/DeviceType'
2018-05-08 14:45:09 +00:00
UnauthorizedError:
type: object
required:
- status
- message
properties:
status:
$ref: '#/definitions/status'
default: error
message:
$ref: '#/definitions/message'
default: Unauthorized
2018-05-07 14:13:07 +00:00
Error:
type: object
required:
- status
- message
properties:
status:
$ref: '#/definitions/status'
default: error
message:
$ref: '#/definitions/message'
default: Error message
securityDefinitions:
Bearer:
type: apiKey
name: Authorization
in: header
description: |
For accessing the API a valid JWT token must be passed in all the queries in
the 'Authorization' header as Bearer token.
A valid JWT token is generated by the API and returned as answer of a call
to the route /login giving a valid user & password.
The following syntax must be used in the 'Authorization' header :
Bearer xxxxxx.yyyyyyy.zzzzzz
security:
- Bearer: []
2018-05-07 14:13:07 +00:00
info:
description: Python (Flask) backend for IoT sysyem made for master's degree final project
title: IoT Backend
version: 0.0.1
swagger: '2.0'