1 | {
|
2 | "$schema": "http://json-schema.org/draft-07/schema#",
|
3 | "definitions": {
|
4 | "request": {
|
5 | "type": "object",
|
6 | "required": ["url"],
|
7 | "additionalProperties": false,
|
8 | "properties": {
|
9 | "url": { "type": "string" },
|
10 | "method": {
|
11 | "type": "string",
|
12 | "pattern": "^GET$|^HEAD$|^POST$|^PUT$|^DELETE$|^CONNECT$|^OPTIONS$|^TRACE$|^PATCH$"
|
13 | }
|
14 | }
|
15 | },
|
16 |
|
17 | "header": {
|
18 | "type": "object",
|
19 | "required": [
|
20 | "name",
|
21 | "value"
|
22 | ],
|
23 | "additionalProperties": false,
|
24 | "properties": {
|
25 | "name": {
|
26 | "type": "string"
|
27 | },
|
28 | "value": {
|
29 | "type": "string"
|
30 | }
|
31 | }
|
32 | },
|
33 | "cookie": {
|
34 | "type": "object",
|
35 | "required": [
|
36 | "name",
|
37 | "value"
|
38 | ],
|
39 | "additionalProperties": false,
|
40 | "properties": {
|
41 | "name": {
|
42 | "type": "string"
|
43 | },
|
44 | "value": {
|
45 | "type": "string"
|
46 | },
|
47 | "path": {
|
48 | "type": "string"
|
49 | },
|
50 | "domain": {
|
51 | "type": "string"
|
52 | },
|
53 | "expires": {
|
54 | "type": "string",
|
55 | "format": "date-time"
|
56 | },
|
57 | "httpOnly": {
|
58 | "type": "boolean"
|
59 | },
|
60 | "secure": {
|
61 | "type": "boolean"
|
62 | }
|
63 | }
|
64 | },
|
65 | "response": {
|
66 | "type": "object",
|
67 | "required": ["status"],
|
68 | "additionalProperties": false,
|
69 | "properties": {
|
70 | "status": {
|
71 | "type": "integer",
|
72 | "minimum": 100,
|
73 | "exclusiveMaximum": 600
|
74 | },
|
75 | "headers": {
|
76 | "type": "array",
|
77 | "items": { "$ref": "#/definitions/header" }
|
78 | },
|
79 | "cookies": {
|
80 | "type": "array",
|
81 | "items": { "$ref": "#/definitions/cookie" }
|
82 | },
|
83 | "content": {
|
84 | "type": "object",
|
85 | "required": ["text"],
|
86 | "additionalProperties": false,
|
87 | "properties": {
|
88 | "text": {
|
89 | "type": "string"
|
90 | }
|
91 | }
|
92 | }
|
93 | }
|
94 | },
|
95 | "redirectResponse": {
|
96 | "type": "object",
|
97 | "required": ["redirectUrl"],
|
98 | "additionalProperties": false,
|
99 | "properties": {
|
100 | "redirectUrl": { "type": "string" }
|
101 | }
|
102 | },
|
103 | "passthroughResponse": {
|
104 | "type": "object",
|
105 | "required": ["passthrough"],
|
106 | "additionalProperties": false,
|
107 | "properties": {
|
108 | "passthrough": { "type": "boolean", "enum": [ true ] }
|
109 | }
|
110 | },
|
111 |
|
112 | "entry": {
|
113 | "type": "object",
|
114 | "required": ["request", "response"],
|
115 | "additionalProperties": false,
|
116 | "properties": {
|
117 | "request": { "$ref": "#/definitions/request" },
|
118 | "response": {
|
119 | "oneOf": [
|
120 | { "$ref": "#/definitions/response" },
|
121 | { "$ref": "#/definitions/redirectResponse" },
|
122 | { "$ref": "#/definitions/passthroughResponse" }
|
123 | ]
|
124 | }
|
125 | }
|
126 | }
|
127 | },
|
128 | "type": "object",
|
129 | "required": ["entries"],
|
130 | "properties": {
|
131 | "version": { "type": "string", "enum": ["1.2", "1.2.0"] },
|
132 | "creator": { "type": "string" },
|
133 | "entries": {
|
134 | "type": "array",
|
135 | "items": { "$ref": "#/definitions/entry" }
|
136 | }
|
137 | }
|
138 | }
|