generated from sv-tools/go-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.schema.json
78 lines (78 loc) · 2.48 KB
/
config.schema.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
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/sv-tools/mock-http-server/main/config.schema.json",
"title": "Mock HTTP Server Config Schema",
"description": "Schema to validate the config of the Mock HTTP Server",
"type": "object",
"properties": {
"port": {
"description": "The http port for the server",
"default": 8080,
"type": "integer"
},
"request_id_header": {
"description": "Name of an HTTP header for Request Id",
"default": "X-Request-Id",
"type": "string"
},
"routes": {
"description": "The list of routes",
"type": "array",
"items": {
"type": "object",
"properties": {
"pattern": {
"description": "An url pattern",
"default": "/",
"type": "string"
},
"responses": {
"description": "List of the responses",
"type": "array",
"items": {
"type": "object",
"properties": {
"code": {
"description": "The response Status Code",
"default": 200,
"type": "integer"
},
"headers": {
"description": "The response headers in form of name and list of values",
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
},
"body": {
"description": "The response body as text",
"type": "string"
},
"file": {
"description": "A path to a file to be used as response body",
"type": "string"
},
"is_json": {
"description": "A flag to automatically add the `Content-Type: application/json` response header",
"default": false,
"type": "boolean"
},
"repeat": {
"description": "the number of repeats. Infinity if no set. Zero to skip. Or an exact number of repeats.",
"type": "integer"
}
}
},
"minItems": 1
}
},
"required": ["responses"]
},
"minItems": 1
}
},
"required": ["routes"]
}