-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathopen-api.json
99 lines (99 loc) · 2.59 KB
/
open-api.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
{
"openapi": "3.0.0",
"info": {
"title": "Garden Schema Data Formats",
"version": "2.0.0-alpha",
"license": {
"name": "MIT",
"url": "https://github.com/vanilla/garden-schema/blob/master/LICENSE.md"
}
},
"paths": {
"/validation-error": {
"get": {
"responses": {
"200": {
"description": "Get a sample validation error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidationError"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"ValidationError": {
"description": "Contains error information when a schema fails to validate.",
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "The main error message."
},
"code": {
"type": "integer",
"description": "The maximum error code.",
"default": 400
},
"errors": {
"title": "Field Errors",
"description": "A mapping of field references to errors.",
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "object",
"properties": {
"message": {
"description": "A human-readable error message.",
"type": "string"
},
"error": {
"description": "A string code for the specific validation error meant for consumption by code.",
"type": "string"
},
"code": {
"description": "An HTTP-style error code for the error.",
"type": "integer"
}
},
"required": ["message", "error"],
"example": {
"message": "The value should be at least 10 characters long.",
"error": "minLength",
"code": 400
}
}
}
}
},
"required": ["message", "code", "errors"],
"example": {
"message": "Validation failed.",
"code": 400,
"errors": {
"booleans": [
{ "message": "The value is not a valid boolean.", "error": "type" }
],
"strings": [
{ "message": "The value is not a valid string.", "error": "type" },
{ "message": "The value should be at least 5 characters long.", "error": "minLength" },
{ "message": "The value is 4 characters too long.", "error": "maxLength" },
{ "message": "The value doesn't match the required pattern.", "error": "pattern" }
],
"objects": [
{ "message": "The value is not a valid object.", "error": "type" },
{ "message": "Property is required.", "error": "required" }
]
}
}
}
}
}
}