145 lines
3.3 KiB
YAML
145 lines
3.3 KiB
YAML
swagger: '2.0'
|
|
info:
|
|
description: "gerald - feedback application server"
|
|
version: 0.0.1
|
|
title: gerald
|
|
|
|
basePath: /
|
|
consumes:
|
|
- application/json
|
|
produces:
|
|
- application/json
|
|
|
|
paths:
|
|
/feedback:
|
|
post:
|
|
summary: "Create a feedback"
|
|
tags:
|
|
- "feedback"
|
|
description: "Create a feedback"
|
|
operationId: "createFeedback"
|
|
parameters:
|
|
- in: body
|
|
name: body
|
|
description: "Feedback object that needs to be created"
|
|
required: true
|
|
schema:
|
|
$ref: "#/definitions/Feedback"
|
|
- in: query
|
|
name: session_uuid
|
|
description: "Session UUID"
|
|
required: true
|
|
type: string
|
|
responses:
|
|
200:
|
|
description: "successful operation"
|
|
403:
|
|
description: "Forbidden"
|
|
|
|
/feedback/{feedback_uuid}/vote:
|
|
post:
|
|
summary: "Upvote a feedback"
|
|
tags:
|
|
- "feedback"
|
|
description: "Upvote a feedback"
|
|
operationId: "upvoteFeedback"
|
|
parameters:
|
|
- in: path
|
|
name: feedback_uuid
|
|
description: "Feedback UUID"
|
|
required: true
|
|
type: string
|
|
- in: query
|
|
name: session_uuid
|
|
description: "Session UUID"
|
|
required: true
|
|
type: string
|
|
- in: query
|
|
type: string
|
|
name: action
|
|
enum:
|
|
- "upvote"
|
|
- "downvote"
|
|
required: true
|
|
responses:
|
|
200:
|
|
description: "successful operation"
|
|
403:
|
|
description: "Forbidden"
|
|
|
|
|
|
/feedbacks:
|
|
get:
|
|
summary: "Get all feedbacks"
|
|
tags:
|
|
- "feedback"
|
|
description: "Get all feedbacks"
|
|
operationId: "getFeedbacks"
|
|
parameters:
|
|
- in: query
|
|
name: session_uuid
|
|
description: "Session UUID"
|
|
required: true
|
|
type: string
|
|
responses:
|
|
200:
|
|
description: "successful operation"
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: "#/definitions/Feedback"
|
|
403:
|
|
description: "Forbidden"
|
|
|
|
/feedbacks/{project_id}:
|
|
get:
|
|
summary: "Get all feedbacks for a project"
|
|
tags:
|
|
- "feedback"
|
|
description: "Get all feedbacks for a project"
|
|
operationId: "getFeedbacksForProject"
|
|
parameters:
|
|
- in: path
|
|
name: project_id
|
|
description: "Project id"
|
|
required: true
|
|
type: string
|
|
responses:
|
|
200:
|
|
description: "successful operation"
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: "#/definitions/Feedback"
|
|
403:
|
|
description: "Forbidden"
|
|
|
|
definitions:
|
|
Feedback:
|
|
type: object
|
|
properties:
|
|
feedback_uuid:
|
|
type: string
|
|
session_uuid:
|
|
type: string
|
|
user_id:
|
|
type: string
|
|
description: to have more context about the user
|
|
project_id:
|
|
type: string
|
|
description: to have more context about the project
|
|
type:
|
|
type: string
|
|
enum:
|
|
- feature
|
|
- feedback
|
|
- support
|
|
text:
|
|
type: string
|
|
upvoted:
|
|
type: boolean
|
|
upvotes:
|
|
type: integer
|
|
created_at:
|
|
type: string
|
|
format: date-time |