This repository has been archived by the owner on Nov 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathswagger.yaml
181 lines (179 loc) · 4.47 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
swagger: '2.0'
info:
version: '1.0'
title: Polls
description: Polls is a simple web service that allows consumers to view polls and vote in them.
license:
name: MIT
url: http://github.com/apiaryio/polls-api/blob/master/LICENSE
host: polls.apiblueprint.org
basePath: /
schemes:
- https
consumes:
- application/json
produces:
- application/json
paths:
/:
x-summary: Polls API Root
x-description: This resource does not have any attributes. Instead it offers the initial API affordances in the form of the links in the JSON body.\nIt is recommend to follow the “url” link values or Link headers to get to resources instead of constructing your own URLs to keep your client decoupled from implementation details.
get:
description: ""
summary: Retrieve the Entry Point
parameters: []
responses:
200:
description: ""
schema:
type: object
properties:
questions_url:
type: string
required:
- questions_url
/questions/{question_id}:
x-summary: Question
x-description: >-
A Question object has the following attributes.
- question
- published_at
- url
- choices (an array of Choice objects).
parameters:
- name: question_id
in: path
required: true
type: number
format: int32
description: ID of the Question in form of an integer
enum:
- 1
get:
tags:
- Question
description: ""
summary: View a question detail
responses:
200:
description: ""
schema:
$ref: '#/definitions/Question'
/questions/{question_id}/choices/{choice_id}:
x-summary: Choice
parameters:
- name: question_id
in: path
required: true
type: number
format: int32
description: ID of the Question in form of an integer
enum:
- 1
- name: choice_id
in: path
required: true
type: number
format: int32
description: ID of the Choice in form of an integer
enum:
- 1
post:
tags:
- Question
description: This action allows you to vote on a question's choice.
summary: Vote on a Choice
responses:
201:
description: ""
schema:
$ref: '#/definitions/Choice'
/questions:
x-summary: Questions collection
x-description: Again, instead of constructing the URLs for the next page. It is **highly** recommended that you follow the `next` link header in the response.
parameters:
- name: page
in: query
required: false
type: number
format: int32
description: The page of questions to return
get:
tags:
- Question
description: ""
summary: List all questions
responses:
200:
description: ""
schema:
type: array
items:
$ref: '#/definitions/Question'
post:
tags:
- Question
description: >-
You can create your own question using this action. It takes a JSON dictionary containing a question and a collection of answers in the form of choices.
- question (string) - The question
- choices (array[string]) - A collection of choices.
summary: Create a new question
parameters:
- name: body
in: body
required: true
schema:
$ref: '#/definitions/QuestionRequest'
responses:
201:
description: ""
schema:
$ref: '#/definitions/Question'
definitions:
Question:
title: Question
type: object
properties:
question:
type: string
published_at:
type: string
url:
type: string
choices:
type: array
items:
$ref: '#/definitions/Choice'
required:
- question
- published_at
- url
- choices
Choice:
title: Choice
type: object
properties:
url:
type: string
votes:
type: integer
format: int32
choice:
type: string
required:
- url
- votes
- choice
QuestionRequest:
title: Question Request
type: object
properties:
question:
type: string
choices:
type: array
items:
type: string
required:
- question
- choices