-
Notifications
You must be signed in to change notification settings - Fork 1
/
swagger.json
126 lines (126 loc) · 3.84 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
{
"swagger": "2.0",
"info": {
"title": "Node API",
"description": "Template API project for Node.js",
"version": "1.0.0"
},
"basePath": "/api/node",
"consumes": ["application/json"],
"produces": ["application/json"],
"paths": {
"/_checkAPIkey": {
"get": {
"tags": ["system"],
"operationId": "checkAPIkey",
"summary": "Test authentication setup",
"description": "Secured test endpoint which can be used to validate that a client has a working authentication setup\n\n_(System.checkAPIKey)_",
"parameters": [],
"responses": {
"200": {
"description": "The given authentication is **accepted**"
},
"401": {
"description": "This endpoint is secured - **credentials are missing or invalid**."
},
"default": {
"description": "Unexpected response - internal error"
}
},
"security": [{ "api_key": ["read"] }]
}
},
"/v1/data/{id}": {
"get": {
"tags": ["data"],
"operationId": "getDataById",
"summary": "Data with ID",
"description": "Returns the earlier stored data-object with the given ID.\n\n_(Sample.getData)_\n\n",
"parameters": [{ "$ref": "#/parameters/DataId" }],
"responses": {
"200": {
"description": "The requested data",
"schema": { "$ref": "#/definitions/DataObject" }
},
"401": {
"description": "This endpoint is secured - **credentials are missing or invalid**."
},
"404": {
"description": "No data found for given ID",
"schema": {
"type": "object",
"properties": { "message": { "type": "string", "example": "document not found" } }
}
},
"default": {
"description": "Unexpected response - internal error"
}
},
"security": [{ "api_key": ["read"] }]
},
"post": {
"tags": ["data"],
"operationId": "postDataById",
"summary": "Store data",
"description": "Saves the given data-object, overwriting any old data with the same ID.\n\n_(Sample.postData)_",
"parameters": [{ "$ref": "#/parameters/DataId" }, { "$ref": "#/parameters/DataObject" }],
"responses": {
"200": {
"description": "The stored data object",
"schema": { "$ref": "#/definitions/DataObject" }
},
"400": {
"description": "Invalid request",
"schema": {
"type": "object",
"properties": {
"message": { "type": "string", "example": "Sample validation failed: name: Name is required." }
}
}
},
"401": {
"description": "This endpoint is secured - **credentials are missing or invalid**."
},
"default": {
"description": "Unexpected response - internal error"
}
},
"security": [{ "api_key": ["write"] }]
}
}
},
"securityDefinitions": {
"api_key": {
"type": "apiKey",
"name": "api_key",
"in": "header"
}
},
"parameters": {
"DataId": {
"in": "path",
"description": "ID of data object, e.g. \"123\"",
"name": "id",
"required": true,
"type": "string"
},
"DataObject": {
"in": "body",
"description": "Data to save with given ID",
"name": "data",
"required": true,
"schema": {
"type": "object",
"properties": { "name": { "type": "string", "example": "John Doe" } }
}
}
},
"definitions": {
"DataObject": {
"properties": {
"id": { "type": "string", "example": "123" },
"name": { "type": "string", "example": "John Doe" }
}
}
}
}