forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.yaml
120 lines (120 loc) · 2.87 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
swagger: '2.0'
info:
version: '1.0'
title: "mad"
description: Polls is a simple API allowing consumers to view polls and vote in them.
license:
name: MIT
url: https://github.com/apiaryio/polls-api/blob/master/LICENSE
host: polls.apiblueprint.org
basePath: /
schemes:
- http
consumes:
- application/json
produces:
- application/json
paths:
/questions:
x-summary: Questions Collection
get:
summary: List All Questions
responses:
200:
description: Successful Response
schema:
type: array
items:
$ref: '#/definitions/Question'
examples:
application/json:
- question: Favourite programming language?
published_at: '2015-08-05T08:40:51.620Z'
choices:
- choice: Swift
votes: 2048
- choice: Python
votes: 1024
- choice: Objective-C
votes: 512
- choice: Ruby
votes: 256
post:
description: >-
You may create your own question using this action. It takes a JSON
object containing a question and a collection of answers in the
form 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'
examples:
application/json:
question: Favourite programming language?
published_at: '2015-08-05T08:40:51.620Z'
choices:
- choice: Swift
votes: 0
- choice: Python
votes: 0
- choice: Objective-C
votes: 0
- choice: Ruby
votes: 0
definitions:
Question:
title: Question
type: object
properties:
question:
type: string
published_at:
type: string
choices:
type: array
items:
$ref: '#/definitions/Choice'
required:
- question
- published_at
- choices
Choice:
title: Choice
type: object
properties:
votes:
type: integer
format: int32
choice:
type: string
required:
- votes
- choice
QuestionRequest:
title: Question Request
type: object
properties:
question:
type: string
choices:
type: array
items:
type: string
required:
- question
- choices
example:
question: Favourite programming language?
choices:
- Swift
- Python
- Objective-C
- Ruby