Debian Codegraph @

fixtures/yaml/search.yaml

raw
1 swagger: '2.0'
2
3 info:
4 version: "1.0.0"
5 title: Simple Search API
6 description: |
7 A very simple api description that makes a x-www-form-urlencoded only API to submit searches.
8
9 produces:
10 - application/json
11
12 consumes:
13 - application/json
14
15 paths:
16 /search:
17 post:
18 operationId: search
19 summary: searches tasks
20 description: searches the task titles and descriptions for a match
21 consumes:
22 - application/x-www-form-urlencoded
23 parameters:
24 - name: q
25 in: formData
26 type: string
27 description: the search string
28 required: true
29 /tasks:
30 get:
31 operationId: getTasks
32 summary: Gets Task objects.
33 description: |
34 Optional query param of **size** determines
35 size of returned array
36 tags:
37 - tasks
38 parameters:
39 - name: size
40 in: query
41 description: Size of task list
42 type: integer
43 format: int32
44 default: 20
45 - name: completed
46 in: query
47 description: when true shows completed tasks
48 type: boolean
49
50 responses:
51 default:
52 description: Generic Error
53 200:
54 description: Successful response
55 headers:
56 X-Rate-Limit:
57 type: integer
58 format: int32
59 X-Rate-Limit-Remaining:
60 type: integer
61 format: int32
62 default: 42
63 X-Rate-Limit-Reset:
64 type: integer
65 format: int32
66 default: "1449875311"
67 X-Rate-Limit-Reset-Human:
68 type: string
69 default: 3 days
70 X-Rate-Limit-Reset-Human-Number:
71 type: string
72 default: 3
73 Access-Control-Allow-Origin:
74 type: string
75 default: "*"
76 schema:
77 type: array
78 items:
79 $ref: "#/definitions/Task"
80 post:
81 operationId: createTask
82 summary: Creates a 'Task' object.
83 description: |
84 Validates the content property for length etc.
85 parameters:
86 - name: body
87 in: body
88 schema:
89 $ref: "#/definitions/Task"
90 tags:
91 - tasks
92 responses:
93 default:
94 description: Generic Error
95 201:
96 description: Task Created
97
98 /tasks/{id}:
99 parameters:
100 - name: id
101 in: path
102 type: integer
103 format: int32
104 description: The id of the task
105 required: true
106 minimum: 1
107 put:
108 operationId: updateTask
109 summary: updates a task.
110 description: |
111 Validates the content property for length etc.
112 tags:
113 - tasks
114 parameters:
115 - name: body
116 in: body
117 description: the updated task
118 schema:
119 $ref: "#/definitions/Task"
120 responses:
121 default:
122 description: Generic Error
123 200:
124 description: Task updated
125 schema:
126 $ref: "#/definitions/Task"
127 delete:
128 operationId: deleteTask
129 summary: deletes a task
130 description: |
131 Deleting a task is irrevocable.
132 tags:
133 - tasks
134 responses:
135 default:
136 description: Generic Error
137 204:
138 description: Task Deleted
139
140
141 definitions:
142 Task:
143 title: A Task object
144 description: |
145 This describes a task. Tasks require a content property to be set.
146 required:
147 - content
148 type: object
149 properties:
150 id:
151 title: the unique id of the task
152 description: |
153 This id property is autogenerated when a task is created.
154 type: integer
155 format: int64
156 readOnly: true
157 content:
158 title: The content of the task
159 description: |
160 Task content can contain [GFM](https://help.github.com/articles/github-flavored-markdown/).
161 type: string
162 minLength: 5
163 completed:
164 title: when true this task is completed
165 type: boolean
166 creditcard:
167 title: the credit card format usage
168 type: string
169 format: creditcard
170 createdAt:
171 title: task creation time
172 type: string
173 format: date-time
174 readOnly: true