-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.yaml
141 lines (128 loc) · 3.45 KB
/
swagger.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
swagger: '2.0'
info:
title: Pinspiration Comments API
description: Manage comments on Pinspiration pins
version: "1.0.0"
host: the-real-pinspiration.herokuapp.com
schemes:
- https
basePath: /api/v1
produces:
- application/json
paths:
/comments:
get:
summary: All Comments for a pin
description:
The Comments path displays all comments for a given pin, with the user ID of the user who posted the comment and the content of the comment.
parameters:
- name: pin_id
in: query
description: Pin that comments are shown for
required: true
type: number
format:
- name: api_key
in: query
description: The registered user's API key
required: true
type: string
format:
responses:
200:
description: All comments for a pin
schema:
type: array
items: hash
$ref: '#/definitions/Comment'
post:
summary: Add a new comment to a pin
description:
Add a new comment to the pin specified in the query.
parameters:
- name: pin_id
in: query
description: Pin that comments are shown for
required: true
type: number
format:
- name: api_key
in: query
description: The registered user's API key
required: true
type: string
format:
- name: content
in: body
description: The desired content for the new comment
required: true
type: text
format:
responses:
200:
description: Successfully added a new comment
schema:
type: array
items: hash
$ref: '#/definitions/Comment'
put:
summary: Edit a comment
description:
Edit a comment made by user tied to API key.
parameters:
- name: id
in: params
description: Comment id
required: true
type: number
format:
- name: api_key
in: query
description: The registered user's API key, user must match the comment's user.
required: true
type: string
format:
responses:
200:
description: Successfully edited comment
schema:
type: array
items: hash
$ref: '#/definitions/Comment'
delete:
summary: Delete a comment
description:
Edit a comment made by user tied to API key.
parameters:
- name: id
in: params
description: Comment id
required: true
type: number
format:
- name: api_key
in: query
description: The registered user's API key, user must match the comment's user.
required: true
type: string
format:
responses:
200:
description: Successfully edited comment
schema:
type: array
items: hash
$ref: '#/definitions/Comment'
definitions:
Comment:
type: object
properties:
pin_id:
type: integer
description: Identifier for the pin the comment belongs to.
user_id:
type: integer
description: Identifier for the user the comment belongs to.
content:
type: string
description: The content of the comment.