Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- swagger: "2.0"
- info:
- version: 1.0.0
- title: "framebyfra.me"
- host: "localhost:4040"
- basePath: "/api/v1"
- schemes:
- - http
- securityDefinitions:
- AuthHeader:
- type: "apiKey"
- in: "header"
- name: "Authorization"
- paths:
- /auth/login:
- post:
- summary: Authenticates a user through username/password
- parameters:
- - name: "auth"
- in: "body"
- description: "User auth details"
- schema:
- type: "object"
- required:
- - "email"
- - "password"
- properties:
- email:
- type: "string"
- example: "email@example.com"
- password:
- type: "string"
- example: "example"
- consumes:
- - "application/json"
- produces:
- - "application/json"
- responses:
- 200:
- description: "User is logged in"
- schema:
- type: "object"
- properties:
- user:
- $ref: "#/definitions/User"
- token:
- type: "string"
- 403:
- description: "Incorrect email or password"
- /anim/{id}:
- parameters:
- - name: id
- in: path
- required: true
- type: string
- format: uuid
- get:
- summary: Gets an animation by ID
- responses:
- 200:
- description: OK
- schema:
- $ref: '#/definitions/Animation'
- post:
- summary: Modifies an animation by ID
- security:
- - AuthHeader: []
- responses:
- 200:
- description: OK
- schema:
- $ref: '#/definitions/Animation'
- 403:
- description: Forbidden
- delete:
- summary: Deletes an animation by ID
- description: >
- Deletes an animation by it's **ID**.
- Only works if at least one of these conditions are met:
- * [user that created it]
- * moderator
- * administrator
- security:
- - AuthHeader: []
- responses:
- 200:
- description: Animation was successfully deleted
- schema:
- $ref: '#/definitions/Animation'
- 403:
- description: >
- The user who called this does not have permission to delete the animation, this happens when all of these conditions are met:
- * user is not creator of the animation
- * user is not a moderator
- * user is not an administrator
- /user/{id}:
- parameters:
- - name: id
- in: path
- required: true
- type: string
- format: uuid
- get:
- summary: Gets a user by ID
- responses:
- 200:
- description: OK
- definitions:
- User:
- description: "Only the user it belongs to can see this"
- required:
- - username
- - displayname
- - roles
- properties:
- email:
- type: "string"
- example: "email@example.com"
- format: email
- username:
- type: "string"
- example: "example-username"
- displayname:
- type: "string"
- default: "same as username"
- createdAt:
- type: "string"
- example: "2018-10-25 22:55:32.868"
- format: "date-time"
- roles:
- $ref: '#/definitions/Roles'
- Animation:
- description: "An animation uploaded by a user"
- type: object
- required:
- - id
- - creator
- - framerate
- - start
- - end
- - keyframes
- properties:
- id:
- type: string
- format: uuid
- name:
- type: string
- example: "My Animation"
- description:
- type: string
- example: "Check out my new animation"
- creator:
- type: string
- format: uuid
- framerate:
- type: number
- example: 24
- start:
- type: integer
- example: 0
- end:
- type: integer
- example: 0
- keyframes:
- minItems: 1
- type: array
- items:
- type: object
- properties:
- frame:
- type: integer
- example: 3
- media-ref:
- type: string
- format: uuid
- example: f2ac0f4c-d8c9-11e8-9f8b-f2801f1b9fd1
- tags:
- type: array
- items:
- type: string
- Roles:
- type: array
- uniqueItems: true
- items:
- type: string
- enum:
- - admin
- - moderator
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement