Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- swagger: "2.0"
- info:
- version: "0.0.1"
- title: Demo app
- # during dev, should point to your local machine
- host: localhost:3000
- # basePath prefixes all resource paths
- basePath: /
- #
- schemes:
- # tip: remove http to make production-grade
- - http
- # format of bodies a client can send (Content-Type)
- consumes:
- - application/json
- # format of the responses to the client (Accepts)
- produces:
- - application/json
- securityDefinitions:
- api_key:
- type: apiKey
- in: query
- name: api_key
- paths:
- /users/register:
- # binds a127 app logic to a route
- x-swagger-router-controller: users
- post:
- description: Register a new user
- # used as the method name of the controller
- operationId: register
- parameters:
- - in: body
- name: body
- description: The user data to register
- required: true
- schema:
- $ref: '#/definitions/RegisterUser'
- responses:
- "200":
- description: Success
- schema:
- # a pointer to a definition
- $ref: "#/definitions/BasicResponse"
- # responses may fall through to errors
- default:
- description: Error
- schema:
- $ref: "#/definitions/BasicResponse"
- /users/authenticate:
- # binds a127 app logic to a route
- x-swagger-router-controller: users
- post:
- description: Retrieve JWT token for user
- # used as the method name of the controller
- operationId: authenticate
- parameters:
- - in: body
- name: body
- description: The user data to authenticate with
- required: true
- schema:
- $ref: '#/definitions/AuthenticateUser'
- responses:
- "200":
- description: Success
- schema:
- # a pointer to a definition
- $ref: "#/definitions/AuthenticateResponse"
- # responses may fall through to errors
- default:
- description: Error
- schema:
- $ref: "#/definitions/BasicResponse"
- /users/heartbeat:
- # binds a127 app logic to a route
- x-swagger-router-controller: users
- post:
- security:
- - api_key: [ ]
- description: Update the users checkin time
- # used as the method name of the controller
- operationId: heartbeat
- parameters:
- - in: body
- name: body
- description: The user data to update
- required: true
- schema:
- $ref: '#/definitions/User'
- responses:
- "200":
- description: Success
- schema:
- $ref: "#/definitions/BasicResponse"
- # responses may fall through to errors
- default:
- description: Error
- schema:
- $ref: "#/definitions/BasicResponse"
- /logs/addLog:
- # binds a127 app logic to a route
- x-swagger-router-controller: logs
- post:
- security:
- - api_key: [ ]
- description: Log an action
- # used as the method name of the controller
- operationId: addLog
- parameters:
- - in: body
- name: body
- description: The action data to log
- required: true
- schema:
- $ref: '#/definitions/ActionLog'
- responses:
- "200":
- description: Success
- schema:
- $ref: "#/definitions/BasicResponse"
- # responses may fall through to errors
- default:
- description: Error
- schema:
- $ref: "#/definitions/BasicResponse"
- /ping:
- x-swagger-router-controller: ping
- post:
- security:
- - api_key: [ ]
- description: Returns 'Pong' to the authenticated caller
- # used as the method name of the controller
- operationId: ping
- parameters:
- - in: body
- name: body
- description: The user
- required: true
- schema:
- $ref: '#/definitions/User'
- responses:
- "200":
- description: Success
- schema:
- # a pointer to a definition
- $ref: "#/definitions/BasicResponse"
- # responses may fall through to errors
- default:
- description: Error
- schema:
- $ref: "#/definitions/BasicResponse"
- /swagger:
- x-swagger-pipe: swagger_raw
- # complex objects have schema definitions
- definitions:
- User:
- required:
- - email
- properties:
- email:
- type: string
- ActionLog:
- required:
- - action
- - email
- properties:
- email:
- type: string
- action:
- type: string
- time:
- type: string
- trigger:
- type: string
- AuthenticateUser:
- required:
- - email
- - password
- properties:
- email:
- type: string
- password:
- type: string
- RegisterUser:
- required:
- - email
- - phone
- - password
- properties:
- email:
- type: string
- password:
- type: string
- phone:
- type: string
- BasicResponse:
- required:
- - message
- properties:
- message:
- type: string
- AuthenticateResponse:
- required:
- - token
- properties:
- token:
- type: string
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement