-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.yaml
64 lines (62 loc) · 1.39 KB
/
openapi.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
openapi: 3.0.0
info:
version: 1.0.0
title: JSON Placeholder API
description: See https://jsonplaceholder.typicode.com/
paths:
/posts:
get:
description: Returns all posts
tags: ["Posts"]
operationId: "getPosts"
responses:
"200":
description: Successful response
content:
"application/json":
schema:
$ref: "#/components/schemas/PostsList"
/posts/{id}:
get:
description: Returns a post by id
tags: ["Posts"]
operationId: "getPost"
parameters:
- name: id
in: path
required: true
description: The user id.
schema:
type: integer
format: int64
responses:
"200":
description: Successful response
content:
"application/json":
schema:
$ref: "#/components/schemas/Post"
"404":
description: Post not found
components:
schemas:
PostsList:
"type": "array"
"items":
$ref: "#/components/schemas/Post"
Post:
"type": "object"
"required":
- "id"
- "userId"
- "title"
- "completed"
"properties":
id:
type: "integer"
userId:
type: "integer"
title:
type: "string"
completed:
type: "string"