doc-detective-common 3.0.0-dev.0 → 3.0.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -101,18 +101,19 @@
101
101
  "default": ["markdown", "asciidoc", "html", "xml"],
102
102
  "anyOf": [
103
103
  {
104
- "$comment": "Custom mode: Define your own file types with full control.",
105
104
  "type": "array",
106
105
  "minItems": 1,
107
106
  "items": {
108
107
  "anyOf": [
109
108
  {
110
109
  "$comment": "Simple mode: Reference predefined templates by name.",
110
+ "title": "Predefined",
111
111
  "type": "string",
112
112
  "enum": ["markdown", "asciidoc", "html", "xml"]
113
113
  },
114
114
  {
115
115
  "$comment": "Custom mode: Extend predefined templates or write whole new ones.",
116
+ "title": "Custom",
116
117
  "type": "object",
117
118
  "required": ["extensions"],
118
119
  "properties": {
@@ -145,22 +146,27 @@
145
146
  }
146
147
  },
147
148
  {
149
+ "title": "Executable",
148
150
  "$comment": "Executable mode: Convert executable inputs directly into tests.",
149
- "extensions": {
150
- "description": "File extensions to use with type.",
151
- "anyOf": [
152
- {
153
- "$ref": "#/components/schemas/stringOrArray"
154
- }
155
- ]
156
- },
157
- "runShell": {
158
- "description": "`runShell` step to perform for this file type. Use $1 as a placeholder for the file path.",
159
- "anyOf": [
160
- {
161
- "$ref": "runShell_v3.schema.json#"
162
- }
163
- ]
151
+ "type": "object",
152
+ "required": ["extensions"],
153
+ "properties": {
154
+ "extensions": {
155
+ "description": "File extensions to use with type.",
156
+ "anyOf": [
157
+ {
158
+ "$ref": "#/components/schemas/stringOrArray"
159
+ }
160
+ ]
161
+ },
162
+ "runShell": {
163
+ "description": "`runShell` step to perform for this file type. Use $1 as a placeholder for the file path.",
164
+ "anyOf": [
165
+ {
166
+ "$ref": "runShell_v3.schema.json#"
167
+ }
168
+ ]
169
+ }
164
170
  }
165
171
  }
166
172
  ]
@@ -319,17 +325,6 @@
319
325
  }
320
326
  }
321
327
  ]
322
- },
323
- "markupToInclude": {
324
- "description": "Markup types to include when performing this operation. If no markup types are specified, the operation includes all markup types as defined in `fileTypes`.",
325
- "type": "array",
326
- "items": {
327
- "oneOf": [
328
- {
329
- "type": "string"
330
- }
331
- ]
332
- }
333
328
  }
334
329
  }
335
330
  },
@@ -3,9 +3,16 @@
3
3
  "type": "object",
4
4
  "description": "A context in which to perform tests. If no contexts are specified but a context is required by one or more tests, Doc Detective attempts to identify a supported context in the current environment and run tests against it. For example, if a browser isn't specified but is required by steps in the test, Doc Detective will search for and use a supported browser available in the current environment.",
5
5
  "additionalProperties": false,
6
+ "dynamicDefaults": {
7
+ "contextId": "uuid"
8
+ },
6
9
  "properties": {
10
+ "contextId": {
11
+ "type": "string",
12
+ "description": "Unique identifier for the context."
13
+ },
7
14
  "platforms": {
8
- "description": "Supported platforms for the application.",
15
+ "description": "Platforms to run tests on.",
9
16
  "anyOf": [
10
17
  {
11
18
  "$ref": "#/components/schemas/platform"
@@ -18,21 +25,22 @@
18
25
  }
19
26
  ]
20
27
  },
21
- "chrome": {
22
- "$ref": "#/components/schemas/browser"
23
- },
24
- "firefox": {
25
- "$ref": "#/components/schemas/browser"
26
- },
27
- "safari": {
28
- "allOf": [
28
+ "browsers": {
29
+ "description": "Browsers to run tests on.",
30
+ "anyOf": [
31
+ {
32
+ "$ref": "#/components/schemas/browserName"
33
+ },
29
34
  {
30
35
  "$ref": "#/components/schemas/browser"
31
36
  },
32
37
  {
33
- "type": "object",
34
- "not": {
35
- "required": ["driverPath"]
38
+ "type": "array",
39
+ "items": {
40
+ "anyOf": [
41
+ { "$ref": "#/components/schemas/browserName" },
42
+ { "$ref": "#/components/schemas/browser" }
43
+ ]
36
44
  }
37
45
  }
38
46
  ]
@@ -44,24 +52,27 @@
44
52
  "type": "string",
45
53
  "enum": ["linux", "mac", "windows"]
46
54
  },
55
+ "browserName": {
56
+ "type": "string",
57
+ "description": "Name of the browser.",
58
+ "enum": ["chrome", "firefox", "safari", "webkit"],
59
+ "$comment": "`safari` is just a shortcut for `webkit`. Included for visibility and to reduce questions."
60
+ },
47
61
  "browser": {
48
62
  "type": "object",
49
63
  "description": "Browser configuration.",
64
+ "required": ["name"],
50
65
  "additionalProperties": false,
51
66
  "properties": {
52
- "executablePath": {
53
- "type": "string",
54
- "description": "Path to the browser executable. If not specified, defaults to the system default."
55
- },
56
- "driverPath": {
57
- "type": "string",
58
- "description": "Path to the browser driver. If not specified, defaults to internally managed dependencies."
67
+ "name": {
68
+ "$ref": "#/components/schemas/browserName"
59
69
  },
60
70
  "headless": {
61
71
  "type": "boolean",
62
- "description": "If `true`, runs the browser in headless mode."
72
+ "description": "If `true`, runs the browser in headless mode.",
73
+ "default": true
63
74
  },
64
- "dimensions": {
75
+ "window": {
65
76
  "type": "object",
66
77
  "description": "Browser dimensions.",
67
78
  "additionalProperties": false,
@@ -97,67 +108,80 @@
97
108
  },
98
109
  "examples": [
99
110
  {
100
- "chrome": {
101
- "headless": true
102
- }
111
+ "platforms": "linux",
112
+ "browsers": "chrome"
113
+ },
114
+ {
115
+ "platforms": ["windows", "mac", "linux"],
116
+ "browsers": ["chrome", "firefox", "webkit"]
103
117
  },
104
118
  {
105
- "chrome": {
106
- "executablePath": "/usr/bin/google-chrome",
119
+ "browsers": {
120
+ "name": "chrome",
107
121
  "headless": true
108
- },
109
- "firefox": {
110
- "executablePath": "/usr/bin/firefox",
111
- "driverPath": "/usr/local/bin/geckodriver"
112
122
  }
113
123
  },
124
+ {
125
+ "browsers": [
126
+ {
127
+ "name": "chrome",
128
+ "headless": true
129
+ },
130
+ {
131
+ "name": "firefox"
132
+ }
133
+ ]
134
+ },
114
135
  {
115
136
  "platforms": ["mac", "linux"],
116
- "chrome": {
137
+ "browsers": {
138
+ "name": "chrome",
117
139
  "headless": true
118
140
  }
119
141
  },
120
142
  {
121
143
  "platforms": ["windows", "mac", "linux"],
122
- "chrome": {
123
- "executablePath": "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
124
- "driverPath": "C:\\WebDrivers\\chromedriver.exe",
125
- "headless": true,
126
- "dimensions": {
127
- "width": 1920,
128
- "height": 1080
144
+ "browsers": [
145
+ {
146
+ "name": "chrome",
147
+ "headless": true,
148
+ "window": {
149
+ "width": 1920,
150
+ "height": 1080
151
+ },
152
+ "viewport": {
153
+ "width": 1600,
154
+ "height": 900
155
+ }
129
156
  },
130
- "viewport": {
131
- "width": 1600,
132
- "height": 900
133
- }
134
- },
135
- "firefox": {
136
- "executablePath": "/usr/bin/firefox",
137
- "driverPath": "/usr/local/bin/geckodriver",
138
- "dimensions": {
139
- "width": 1366,
140
- "height": 768
141
- }
142
- },
143
- "safari": {
144
- "executablePath": "/Applications/Safari.app/Contents/MacOS/Safari",
145
- "headless": false,
146
- "viewport": {
147
- "width": 1440,
148
- "height": 900
157
+ {
158
+ "name": "firefox",
159
+ "window": {
160
+ "width": 1366,
161
+ "height": 768
162
+ }
163
+ },
164
+ {
165
+ "name": "webkit",
166
+ "headless": false,
167
+ "viewport": {
168
+ "width": 1440,
169
+ "height": 900
170
+ }
149
171
  }
150
- }
172
+ ]
151
173
  },
152
174
  {
153
175
  "platforms": "mac",
154
- "safari": {
155
- "executablePath": "/Applications/Safari.app/Contents/MacOS/Safari",
156
- "dimensions": {
157
- "width": 1280,
158
- "height": 800
176
+ "browsers": [
177
+ {
178
+ "name": "safari",
179
+ "window": {
180
+ "width": 1280,
181
+ "height": 800
182
+ }
159
183
  }
160
- }
184
+ ]
161
185
  }
162
186
  ]
163
187
  }
@@ -69,7 +69,7 @@
69
69
  }
70
70
  ]
71
71
  },
72
- "default": [200]
72
+ "default": [200, 201]
73
73
  },
74
74
  "method": {
75
75
  "type": "string",
@@ -85,6 +85,7 @@
85
85
  },
86
86
  "request": {
87
87
  "type": "object",
88
+ "additionalProperties": false,
88
89
  "properties": {
89
90
  "headers": {
90
91
  "description": "Headers to include in the HTTP request, in key/value format.",
@@ -93,14 +94,14 @@
93
94
  "properties": {},
94
95
  "default": {}
95
96
  },
96
- "params": {
97
+ "parameters": {
97
98
  "description": "URL parameters to include in the HTTP request, in key/value format.",
98
99
  "type": "object",
99
100
  "additionalProperties": true,
100
101
  "default": {},
101
102
  "properties": {}
102
103
  },
103
- "data": {
104
+ "body": {
104
105
  "description": "JSON object to include as the body of the HTTP request.",
105
106
  "anyOf": [
106
107
  {
@@ -108,6 +109,10 @@
108
109
  "additionalProperties": true,
109
110
  "properties": {}
110
111
  },
112
+ {
113
+ "type": "array",
114
+ "items": {}
115
+ },
111
116
  {
112
117
  "type": "string"
113
118
  }
@@ -118,6 +123,7 @@
118
123
  },
119
124
  "response": {
120
125
  "type": "object",
126
+ "additionalProperties": false,
121
127
  "properties": {
122
128
  "headers": {
123
129
  "description": "Headers expected in the response, in key/value format. If one or more `responseHeaders` entries aren't present in the response, the step fails.",
@@ -126,7 +132,7 @@
126
132
  "properties": {},
127
133
  "default": {}
128
134
  },
129
- "data": {
135
+ "body": {
130
136
  "description": "JSON object expected in the response. If one or more key/value pairs aren't present in the response, the step fails.",
131
137
  "anyOf": [
132
138
  {
@@ -134,6 +140,10 @@
134
140
  "additionalProperties": true,
135
141
  "properties": {}
136
142
  },
143
+ {
144
+ "type": "array",
145
+ "items": {}
146
+ },
137
147
  {
138
148
  "type": "string"
139
149
  }
@@ -166,7 +176,7 @@
166
176
  "type": "string",
167
177
  "description": "If `true`, overwrites the existing output at `path` if it exists.\nIf `aboveVariation`, overwrites the existing output at `path` if the difference between the new output and the existing output is greater than `maxVariation`.",
168
178
  "enum": ["true", "false", "aboveVariation"],
169
- "default": "false"
179
+ "default": "aboveVariation"
170
180
  }
171
181
  }
172
182
  }
@@ -215,7 +225,7 @@
215
225
  "headers": {
216
226
  "header": "value"
217
227
  },
218
- "params": {
228
+ "parameters": {
219
229
  "param": "value"
220
230
  }
221
231
  },
@@ -255,11 +265,11 @@
255
265
  },
256
266
  {
257
267
  "openApi": {
258
- "descriptionName": "Reqres",
268
+ "name": "Reqres",
259
269
  "operationId": "getUserById"
260
270
  },
261
271
  "request": {
262
- "params": {
272
+ "parameters": {
263
273
  "id": 123
264
274
  }
265
275
  }
@@ -270,7 +280,7 @@
270
280
  "operationId": "getUserById"
271
281
  },
272
282
  "request": {
273
- "params": {
283
+ "parameters": {
274
284
  "id": 123
275
285
  }
276
286
  }
@@ -7,7 +7,7 @@
7
7
  "description": "OpenAPI description and configuration.",
8
8
  "additionalProperties": false,
9
9
  "properties": {
10
- "descriptionName": {
10
+ "name": {
11
11
  "type": "string",
12
12
  "description": "Name of the OpenAPI description, as defined in your configuration."
13
13
  },
@@ -71,7 +71,7 @@
71
71
  "descriptionPath": "https://petstore.swagger.io/v2/swagger.json"
72
72
  },
73
73
  {
74
- "descriptionName": "Reqres",
74
+ "name": "Reqres",
75
75
  "operationId": "getUserById"
76
76
  },
77
77
  {
@@ -52,13 +52,10 @@
52
52
  "specId": "Do all the things! - Spec",
53
53
  "runOn": [
54
54
  {
55
- "platforms": [
56
- "windows",
57
- "mac"
58
- ],
59
- "firefox": {
60
- "executablePath": "/usr/bin/firefox",
61
- "dimensions": {},
55
+ "platforms": ["windows", "mac"],
56
+ "browsers": {
57
+ "name": "firefox",
58
+ "window": {},
62
59
  "viewport": {}
63
60
  }
64
61
  }
@@ -69,14 +66,8 @@
69
66
  "description": "This test includes nearly every property across all actions.",
70
67
  "runOn": [
71
68
  {
72
- "platforms": [
73
- "linux"
74
- ],
75
- "firefox": {
76
- "executablePath": "/usr/bin/firefox",
77
- "dimensions": {},
78
- "viewport": {}
79
- }
69
+ "platforms": "linux",
70
+ "browsers": "firefox"
80
71
  }
81
72
  ],
82
73
  "steps": [
@@ -86,9 +77,7 @@
86
77
  {
87
78
  "runShell": {
88
79
  "command": "echo",
89
- "args": [
90
- "$USER"
91
- ],
80
+ "args": ["$USER"],
92
81
  "maxVariation": 0,
93
82
  "overwrite": "aboveVariation"
94
83
  },
@@ -115,10 +104,7 @@
115
104
  "job": "leader"
116
105
  }
117
106
  },
118
- "statusCodes": [
119
- 200,
120
- 201
121
- ],
107
+ "statusCodes": [200, 201],
122
108
  "maxVariation": 0,
123
109
  "overwrite": "aboveVariation"
124
110
  },
@@ -137,18 +123,14 @@
137
123
  "moveTo": true,
138
124
  "click": true,
139
125
  "type": {
140
- "keys": [
141
- "shorthair cat"
142
- ]
126
+ "keys": ["shorthair cat"]
143
127
  }
144
128
  },
145
129
  "variables": {}
146
130
  },
147
131
  {
148
132
  "type": {
149
- "keys": [
150
- "$ENTER$"
151
- ]
133
+ "keys": ["$ENTER$"]
152
134
  }
153
135
  },
154
136
  {
@@ -168,7 +150,7 @@
168
150
  {
169
151
  "descriptionPath": "https://www.acme.com/openapi.json",
170
152
  "server": "https://api.acme.com",
171
- "descriptionName": "Acme"
153
+ "name": "Acme"
172
154
  }
173
155
  ],
174
156
  "tests": [
@@ -183,7 +165,7 @@
183
165
  "exampleKey": ""
184
166
  },
185
167
  "request": {
186
- "params": {
168
+ "parameters": {
187
169
  "id": 123
188
170
  }
189
171
  },
@@ -44,7 +44,7 @@
44
44
  "not": {
45
45
  "required": ["operationId"]
46
46
  },
47
- "required": ["descriptionName", "descriptionPath"]
47
+ "required": ["name", "descriptionPath"]
48
48
  }
49
49
  ]
50
50
  }
@@ -105,9 +105,9 @@
105
105
  "runOn": [
106
106
  {
107
107
  "platforms": ["linux"],
108
- "firefox": {
109
- "executablePath": "/usr/bin/firefox",
110
- "dimensions": {},
108
+ "browsers": {
109
+ "name": "firefox",
110
+ "window": {},
111
111
  "viewport": {}
112
112
  }
113
113
  }
@@ -193,7 +193,7 @@
193
193
  "validateAgainstSchema": "both",
194
194
  "useExample": "none",
195
195
  "exampleKey": "",
196
- "descriptionName": "Acme"
196
+ "name": "Acme"
197
197
  }
198
198
  ],
199
199
  "steps": [
@@ -206,7 +206,7 @@
206
206
  "exampleKey": ""
207
207
  },
208
208
  "request": {
209
- "params": {
209
+ "parameters": {
210
210
  "id": 123
211
211
  }
212
212
  },