-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.json
135 lines (133 loc) · 3.3 KB
/
swagger.json
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
{
"swagger": "2.0",
"info": {
"title": "Marvel Superheroes Basic API",
"version": "1.0",
"description": "A simple expressJS API which connects to the Marvel Developer's API",
"license": {
"name": "MIT",
"url": "https://opensource.org/licenses/MIT"
}
},
"host": "localhost:8080",
"basePath": "/",
"tags": [
{
"name": "Characters",
"description": "API for Marvel characters"
}
],
"schemes": [
"http"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/characters": {
"get": {
"tags": [
"Characters"
],
"summary": "Returns a list of all Marvel Characters",
"parameters": [
{
"name": "page",
"in": "query",
"required": false,
"description": "Desired page of results. If not specified defaults to 1"
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/definitions/Characters"
}
}
}
}
}
}
},
"/characters/{characterId}": {
"get": {
"tags": ["Specific Character"],
"summary": "Fetches the details of a specific Marvel Character",
"parameters": [
{
"name": "characterId",
"in": "path",
"required": true,
"description": "Numeric ID of the Marvel Character"
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/definitions/Specific-Character"
}
}
}
},
"404": {
"description": "Error: Not Found"
}
}
}
}
},
"definitions": {
"Characters": {
"properties": {
"total": {
"type": "integer",
"description": "Total number of characters in the Marvel database"
},
"limit": {
"type": "integer",
"description": "Specified limit of characters queried per page. This can be changed in the .env file. Marvel only allows max of 100 characters per request. So make sure you don't specify more than 100 in the .env file"
},
"characterIds": {
"type": "array",
"description": "An array of each character's numeric ID's",
"items": {
"type": "integer"
}
},
"page": {
"type": "integer",
"description": "Page you want to query."
},
"totalPages": {
"type": "integer",
"description": "Total number of pages you can query."
}
}
},
"Specific-Character": {
"properties": {
"id": {
"type": "integer",
"description": "Numeric ID of the Marvel Character"
},
"name": {
"type": "string",
"description": "Name of the Marvel Character"
},
"description": {
"type": "string",
"description": "A backstory of this character."
}
}
}
}
}