-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathinspect.test.ts.snap
622 lines (592 loc) · 81 KB
/
inspect.test.ts.snap
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`rdme openapi inspect > feature reports > should generate a report for '@readme/oas-examples/3.0/json/readme.…' (w/ [ 'polymorphism' ]) 1`] = `
"
polymorphism:
· #/components/responses/authForbidden/content/application~1json/schema
· #/components/responses/authUnauthorized/content/application~1json/schema
· #/components/schemas/docSchemaPost
· #/components/schemas/error_APIKEY_EMPTY
· #/components/schemas/error_APIKEY_MISMATCH
· #/components/schemas/error_APIKEY_NOTFOUND
· #/components/schemas/error_APPLY_INVALID_EMAIL
· #/components/schemas/error_APPLY_INVALID_JOB
· #/components/schemas/error_APPLY_INVALID_NAME
· #/components/schemas/error_CATEGORY_INVALID
· #/components/schemas/error_CATEGORY_NOTFOUND
· #/components/schemas/error_CHANGELOG_INVALID
· #/components/schemas/error_CHANGELOG_NOTFOUND
· #/components/schemas/error_CUSTOMPAGE_INVALID
· #/components/schemas/error_CUSTOMPAGE_NOTFOUND
· #/components/schemas/error_DOC_INVALID
· #/components/schemas/error_DOC_NOTFOUND
· #/components/schemas/error_ENDPOINT_NOTFOUND
· #/components/schemas/error_INTERNAL_ERROR
· #/components/schemas/error_PROJECT_NEEDSSTAGING
· #/components/schemas/error_PROJECT_NOTFOUND
· #/components/schemas/error_RATE_LIMITED
· #/components/schemas/error_REGISTRY_INVALID
· #/components/schemas/error_REGISTRY_NOTFOUND
· #/components/schemas/error_SPEC_FILE_EMPTY
· #/components/schemas/error_SPEC_ID_DUPLICATE
· #/components/schemas/error_SPEC_ID_INVALID
· #/components/schemas/error_SPEC_INVALID
· #/components/schemas/error_SPEC_INVALID_SCHEMA
· #/components/schemas/error_SPEC_NOTFOUND
· #/components/schemas/error_SPEC_TIMEOUT
· #/components/schemas/error_SPEC_VERSION_NOTFOUND
· #/components/schemas/error_UNEXPECTED_ERROR
· #/components/schemas/error_VERSION_CANT_DEMOTE_STABLE
· #/components/schemas/error_VERSION_CANT_REMOVE_STABLE
· #/components/schemas/error_VERSION_DUPLICATE
· #/components/schemas/error_VERSION_EMPTY
· #/components/schemas/error_VERSION_FORK_EMPTY
· #/components/schemas/error_VERSION_FORK_NOTFOUND
· #/components/schemas/error_VERSION_INVALID
· #/components/schemas/error_VERSION_NOTFOUND
· #/paths/~1api-specification/post/responses/400/content/application~1json/schema
· #/paths/~1api-specification~1{id}/put/responses/400/content/application~1json/schema
· #/paths/~1categories/post/requestBody/content/application~1json/schema
· #/paths/~1version/post/responses/400/content/application~1json/schema"
`;
exports[`rdme openapi inspect > feature reports > should generate a report for '@readme/oas-examples/3.0/json/readme-…' (w/ [ 'readme' ]) 1`] = `
"
x-default: You do not use this.
x-readme.code-samples:
· #/paths/~1x-code-samples/get/x-code-samples
· #/paths/~1x-code-samples/post/x-readme/code-samples
x-readme.headers:
· #/paths/~1x-headers/patch/x-headers
· #/paths/~1x-headers/post/x-readme/headers
x-readme.explorer-enabled:
· #/paths/~1x-explorer-enabled/patch
· #/paths/~1x-explorer-enabled/post
x-readme.proxy-enabled:
· #/paths/~1x-proxy-enabled/patch
· #/paths/~1x-proxy-enabled/post
x-readme.samples-languages:
· node
· python
· shell
· swift"
`;
exports[`rdme openapi inspect > feature reports > should generate a report for '@readme/oas-examples/3.0/json/schema-…' (w/ [ 'additionalProperties', …(1) ]) 1`] = `
"
additionalProperties:
· #/components/schemas/BodyPart/properties/headers/additionalProperties
· #/components/schemas/BodyPart/properties/mediaType/properties/parameters/additionalProperties
· #/components/schemas/BodyPart/properties/parameterizedHeaders/additionalProperties
· #/components/schemas/ContentDisposition/properties/parameters/additionalProperties
· #/components/schemas/FormDataBodyPart/properties/headers/additionalProperties
· #/components/schemas/FormDataBodyPart/properties/mediaType/properties/parameters/additionalProperties
· #/components/schemas/FormDataBodyPart/properties/parameterizedHeaders/additionalProperties
· #/components/schemas/FormDataContentDisposition/properties/parameters/additionalProperties
· #/components/schemas/MultiPart/properties/headers/additionalProperties
· #/components/schemas/MultiPart/properties/mediaType/properties/parameters/additionalProperties
· #/components/schemas/MultiPart/properties/parameterizedHeaders/additionalProperties
· #/components/schemas/ParameterizedHeader/properties/parameters/additionalProperties
circularRefs:
· #/components/schemas/BodyPart/properties/parent
· #/components/schemas/MultiPart/properties/bodyParts/items
· #/components/schemas/MultiPart/properties/parent
· #/components/schemas/ZoneOffset/properties/rules
· #/components/schemas/ZoneOffsetTransition/properties/offsetAfter
· #/components/schemas/ZoneOffsetTransition/properties/offsetBefore
· #/components/schemas/ZoneRules/properties/transitions/items"
`;
exports[`rdme openapi inspect > feature reports > should generate a report for '@readme/oas-examples/3.0/json/schema-…' (w/ [ 'additionalProperties', …(2) ]) 1`] = `
"
additionalProperties:
· #/components/schemas/BodyPart/properties/headers/additionalProperties
· #/components/schemas/BodyPart/properties/mediaType/properties/parameters/additionalProperties
· #/components/schemas/BodyPart/properties/parameterizedHeaders/additionalProperties
· #/components/schemas/ContentDisposition/properties/parameters/additionalProperties
· #/components/schemas/FormDataBodyPart/properties/headers/additionalProperties
· #/components/schemas/FormDataBodyPart/properties/mediaType/properties/parameters/additionalProperties
· #/components/schemas/FormDataBodyPart/properties/parameterizedHeaders/additionalProperties
· #/components/schemas/FormDataContentDisposition/properties/parameters/additionalProperties
· #/components/schemas/MultiPart/properties/headers/additionalProperties
· #/components/schemas/MultiPart/properties/mediaType/properties/parameters/additionalProperties
· #/components/schemas/MultiPart/properties/parameterizedHeaders/additionalProperties
· #/components/schemas/ParameterizedHeader/properties/parameters/additionalProperties
circularRefs:
· #/components/schemas/BodyPart/properties/parent
· #/components/schemas/MultiPart/properties/bodyParts/items
· #/components/schemas/MultiPart/properties/parent
· #/components/schemas/ZoneOffset/properties/rules
· #/components/schemas/ZoneOffsetTransition/properties/offsetAfter
· #/components/schemas/ZoneOffsetTransition/properties/offsetBefore
· #/components/schemas/ZoneRules/properties/transitions/items
x-default: You do not use this.
x-readme.code-samples: You do not use this.
x-readme.headers: You do not use this.
x-readme.explorer-enabled: You do not use this.
x-readme.proxy-enabled: You do not use this.
x-readme.samples-languages: You do not use this."
`;
exports[`rdme openapi inspect > feature reports > should generate a report for '@readme/oas-examples/3.0/json/schema-…' (w/ [ 'circularRefs', 'readme' ]) 1`] = `
"
circularRefs:
· #/components/schemas/BodyPart/properties/parent
· #/components/schemas/MultiPart/properties/bodyParts/items
· #/components/schemas/MultiPart/properties/parent
· #/components/schemas/ZoneOffset/properties/rules
· #/components/schemas/ZoneOffsetTransition/properties/offsetAfter
· #/components/schemas/ZoneOffsetTransition/properties/offsetBefore
· #/components/schemas/ZoneRules/properties/transitions/items
x-default: You do not use this.
x-readme.code-samples: You do not use this.
x-readme.headers: You do not use this.
x-readme.explorer-enabled: You do not use this.
x-readme.proxy-enabled: You do not use this.
x-readme.samples-languages: You do not use this."
`;
exports[`rdme openapi inspect > feature reports > should generate a report for '@readme/oas-examples/3.1/json/train-t…' (w/ [ 'commonParameters' ]) 1`] = `
"
commonParameters:
· #/paths/~1bookings~1{bookingId}/parameters
· #/paths/~1bookings~1{bookingId}~1payment/parameters"
`;
exports[`rdme openapi inspect > full reports > should generate a report for @readme/oas-examples/3.0/json/petstore.json 1`] = `
"Here are some interesting things we found in your API definition. 🕵️
· You are using 4 media types throughout your API: application/json, application/x-www-form-urlencoded, application/xml, and multipart/form-data
· You have a total of 20 operations in your API.
· You are using 2 security types throughout your API: apiKey and oauth2
🌲 OpenAPI Features
┌────────────────────────────┬───────┬──────────────────────────────────────────────────────────────────────────────────┐
│ Feature │ Used? │ Description │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ additionalProperties │ 🟢 │ additionalProperties allows you to document dictionaries where the keys are │
│ │ │ user-supplied strings. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#schema- │
│ │ │ object │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ callbacks │ 🔴 │ Callbacks are asynchronous, out-of-band requests that your service will send to │
│ │ │ some other service in response to certain events. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4. │
│ │ │ md#callback-object │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ circularRefs │ 🔴 │ Circular references are $ref pointers that at some point in their lineage │
│ │ │ reference themselves. │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ commonParameters │ 🔴 │ Common parameters allow you to define parameters that are shared across multiple │
│ │ │ operations within your API. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#path- │
│ │ │ item-object │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ discriminators │ 🔴 │ With schemas that can be, or contain, different shapes, discriminators help you │
│ │ │ assist your users in identifying and determining the kind of shape they can │
│ │ │ supply or receive. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4. │
│ │ │ md#discriminator-object │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ links │ 🔴 │ Links allow you to define at call-time relationships to other operations within │
│ │ │ your API. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#link- │
│ │ │ object │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ style │ 🔴 │ Parameter serialization (style) allows you to describe how the parameter should │
│ │ │ be sent to your API. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4. │
│ │ │ md#parameter-style │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ polymorphism │ 🔴 │ Polymorphism (allOf, oneOf, and anyOf) allow you to describe schemas that may │
│ │ │ contain either many different shapes, or a single shape containing multiple │
│ │ │ different schemas. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#schema- │
│ │ │ object │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ serverVariables │ 🔴 │ Server variables allow to do user-supplied variable subsitituions within your │
│ │ │ API server URL. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#server- │
│ │ │ variable-object │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ webhooks │ 🔴 │ Webhooks allow you to describe out of band requests that may be initiated by │
│ │ │ your users. │
│ │ │ │
│ │ │ This feature is not available on OpenAPI v3.0. │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ xml │ 🟢 │ Any parameter and/or request body that accepts XML or responses that return XML │
│ │ │ payloads. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#xml- │
│ │ │ object │
└────────────────────────────┴───────┴──────────────────────────────────────────────────────────────────────────────────┘
🦉 ReadMe-Specific Features and Extensions
┌────────────────────────────┬───────┬──────────────────────────────────────────────────────────────────────────────────┐
│ Feature │ Used? │ Description │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ x-default │ 🔴 │ The x-default extension allows you to define static authentication credential │
│ │ │ defaults for OAuth 2 and API Key security types. │
│ │ │ │
│ │ │ https://docs.readme.com/main/docs/openapi-extensions#authentication-defaults │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ x-readme.code-samples │ 🔴 │ The x-readme.code-samples extension allows you to custom, create static code │
│ │ │ samples on your API documentation. │
│ │ │ │
│ │ │ https://docs.readme.com/main/docs/openapi-extensions#custom-code-samples │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ x-readme.headers │ 🔴 │ The x-readme.headers extension allows you define headers that should always be │
│ │ │ present on your API or a specific operation, as well as what its value should │
│ │ │ be. │
│ │ │ │
│ │ │ https://docs.readme.com/main/docs/openapi-extensions#static-headers │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ x-readme.explorer-enabled │ 🔴 │ The x-readme.explorer-enabled extension allows you to toggle your API │
│ │ │ documentation being interactive or not. │
│ │ │ │
│ │ │ https://docs.readme.com/main/docs/openapi-extensions#disable-the-api-explorer │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ x-readme.proxy-enabled │ 🔴 │ The x-readme.proxy-enabled extension allows you to toggle if API requests from │
│ │ │ API documentation should be routed through ReadMe's CORS Proxy. You should only │
│ │ │ need to use this if your API does not support CORS. │
│ │ │ │
│ │ │ https://docs.readme.com/main/docs/openapi-extensions#cors-proxy-enabled │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ x-readme.samples-languages │ 🔴 │ The x-readme.samples-languages extension allows you to toggle what languages are │
│ │ │ shown by default for code snippets in your API documentation. │
│ │ │ │
│ │ │ https://docs.readme.com/main/docs/openapi-extensions#code-sample-languages │
└────────────────────────────┴───────┴──────────────────────────────────────────────────────────────────────────────────┘
"
`;
exports[`rdme openapi inspect > full reports > should generate a report for @readme/oas-examples/3.0/json/readme.json 1`] = `
"Here are some interesting things we found in your API definition. 🕵️
· You are using 2 media types throughout your API: application/json and multipart/form-data
· You have a total of 36 operations in your API.
· You are using a single security type throughout your API: http
🌲 OpenAPI Features
┌────────────────────────────┬───────┬──────────────────────────────────────────────────────────────────────────────────┐
│ Feature │ Used? │ Description │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ additionalProperties │ 🟢 │ additionalProperties allows you to document dictionaries where the keys are │
│ │ │ user-supplied strings. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#schema- │
│ │ │ object │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ callbacks │ 🔴 │ Callbacks are asynchronous, out-of-band requests that your service will send to │
│ │ │ some other service in response to certain events. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4. │
│ │ │ md#callback-object │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ circularRefs │ 🔴 │ Circular references are $ref pointers that at some point in their lineage │
│ │ │ reference themselves. │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ commonParameters │ 🔴 │ Common parameters allow you to define parameters that are shared across multiple │
│ │ │ operations within your API. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#path- │
│ │ │ item-object │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ discriminators │ 🔴 │ With schemas that can be, or contain, different shapes, discriminators help you │
│ │ │ assist your users in identifying and determining the kind of shape they can │
│ │ │ supply or receive. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4. │
│ │ │ md#discriminator-object │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ links │ 🔴 │ Links allow you to define at call-time relationships to other operations within │
│ │ │ your API. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#link- │
│ │ │ object │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ style │ 🔴 │ Parameter serialization (style) allows you to describe how the parameter should │
│ │ │ be sent to your API. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4. │
│ │ │ md#parameter-style │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ polymorphism │ 🟢 │ Polymorphism (allOf, oneOf, and anyOf) allow you to describe schemas that may │
│ │ │ contain either many different shapes, or a single shape containing multiple │
│ │ │ different schemas. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#schema- │
│ │ │ object │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ serverVariables │ 🔴 │ Server variables allow to do user-supplied variable subsitituions within your │
│ │ │ API server URL. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#server- │
│ │ │ variable-object │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ webhooks │ 🔴 │ Webhooks allow you to describe out of band requests that may be initiated by │
│ │ │ your users. │
│ │ │ │
│ │ │ This feature is not available on OpenAPI v3.0. │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ xml │ 🔴 │ Any parameter and/or request body that accepts XML or responses that return XML │
│ │ │ payloads. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#xml- │
│ │ │ object │
└────────────────────────────┴───────┴──────────────────────────────────────────────────────────────────────────────────┘
🦉 ReadMe-Specific Features and Extensions
┌────────────────────────────┬───────┬──────────────────────────────────────────────────────────────────────────────────┐
│ Feature │ Used? │ Description │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ x-default │ 🔴 │ The x-default extension allows you to define static authentication credential │
│ │ │ defaults for OAuth 2 and API Key security types. │
│ │ │ │
│ │ │ https://docs.readme.com/main/docs/openapi-extensions#authentication-defaults │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ x-readme.code-samples │ 🔴 │ The x-readme.code-samples extension allows you to custom, create static code │
│ │ │ samples on your API documentation. │
│ │ │ │
│ │ │ https://docs.readme.com/main/docs/openapi-extensions#custom-code-samples │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ x-readme.headers │ 🔴 │ The x-readme.headers extension allows you define headers that should always be │
│ │ │ present on your API or a specific operation, as well as what its value should │
│ │ │ be. │
│ │ │ │
│ │ │ https://docs.readme.com/main/docs/openapi-extensions#static-headers │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ x-readme.explorer-enabled │ 🔴 │ The x-readme.explorer-enabled extension allows you to toggle your API │
│ │ │ documentation being interactive or not. │
│ │ │ │
│ │ │ https://docs.readme.com/main/docs/openapi-extensions#disable-the-api-explorer │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ x-readme.proxy-enabled │ 🔴 │ The x-readme.proxy-enabled extension allows you to toggle if API requests from │
│ │ │ API documentation should be routed through ReadMe's CORS Proxy. You should only │
│ │ │ need to use this if your API does not support CORS. │
│ │ │ │
│ │ │ https://docs.readme.com/main/docs/openapi-extensions#cors-proxy-enabled │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ x-readme.samples-languages │ 🔴 │ The x-readme.samples-languages extension allows you to toggle what languages are │
│ │ │ shown by default for code snippets in your API documentation. │
│ │ │ │
│ │ │ https://docs.readme.com/main/docs/openapi-extensions#code-sample-languages │
└────────────────────────────┴───────┴──────────────────────────────────────────────────────────────────────────────────┘
"
`;
exports[`rdme openapi inspect > full reports > should generate a report for @readme/oas-examples/3.0/json/readme-extensions.json 1`] = `
"Here are some interesting things we found in your API definition. 🕵️
· You are using a single media type throughout your API: application/json
· You have a total of 12 operations in your API.
· You are using a single security type throughout your API: oauth2
🌲 OpenAPI Features
┌────────────────────────────┬───────┬──────────────────────────────────────────────────────────────────────────────────┐
│ Feature │ Used? │ Description │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ additionalProperties │ 🔴 │ additionalProperties allows you to document dictionaries where the keys are │
│ │ │ user-supplied strings. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#schema- │
│ │ │ object │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ callbacks │ 🔴 │ Callbacks are asynchronous, out-of-band requests that your service will send to │
│ │ │ some other service in response to certain events. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4. │
│ │ │ md#callback-object │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ circularRefs │ 🔴 │ Circular references are $ref pointers that at some point in their lineage │
│ │ │ reference themselves. │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ commonParameters │ 🔴 │ Common parameters allow you to define parameters that are shared across multiple │
│ │ │ operations within your API. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#path- │
│ │ │ item-object │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ discriminators │ 🔴 │ With schemas that can be, or contain, different shapes, discriminators help you │
│ │ │ assist your users in identifying and determining the kind of shape they can │
│ │ │ supply or receive. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4. │
│ │ │ md#discriminator-object │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ links │ 🔴 │ Links allow you to define at call-time relationships to other operations within │
│ │ │ your API. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#link- │
│ │ │ object │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ style │ 🔴 │ Parameter serialization (style) allows you to describe how the parameter should │
│ │ │ be sent to your API. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4. │
│ │ │ md#parameter-style │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ polymorphism │ 🔴 │ Polymorphism (allOf, oneOf, and anyOf) allow you to describe schemas that may │
│ │ │ contain either many different shapes, or a single shape containing multiple │
│ │ │ different schemas. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#schema- │
│ │ │ object │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ serverVariables │ 🔴 │ Server variables allow to do user-supplied variable subsitituions within your │
│ │ │ API server URL. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#server- │
│ │ │ variable-object │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ webhooks │ 🔴 │ Webhooks allow you to describe out of band requests that may be initiated by │
│ │ │ your users. │
│ │ │ │
│ │ │ This feature is not available on OpenAPI v3.0. │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ xml │ 🔴 │ Any parameter and/or request body that accepts XML or responses that return XML │
│ │ │ payloads. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#xml- │
│ │ │ object │
└────────────────────────────┴───────┴──────────────────────────────────────────────────────────────────────────────────┘
🦉 ReadMe-Specific Features and Extensions
┌────────────────────────────┬───────┬──────────────────────────────────────────────────────────────────────────────────┐
│ Feature │ Used? │ Description │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ x-default │ 🔴 │ The x-default extension allows you to define static authentication credential │
│ │ │ defaults for OAuth 2 and API Key security types. │
│ │ │ │
│ │ │ https://docs.readme.com/main/docs/openapi-extensions#authentication-defaults │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ x-readme.code-samples │ 🟢 │ The x-readme.code-samples extension allows you to custom, create static code │
│ │ │ samples on your API documentation. │
│ │ │ │
│ │ │ https://docs.readme.com/main/docs/openapi-extensions#custom-code-samples │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ x-readme.headers │ 🟢 │ The x-readme.headers extension allows you define headers that should always be │
│ │ │ present on your API or a specific operation, as well as what its value should │
│ │ │ be. │
│ │ │ │
│ │ │ https://docs.readme.com/main/docs/openapi-extensions#static-headers │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ x-readme.explorer-enabled │ 🟢 │ The x-readme.explorer-enabled extension allows you to toggle your API │
│ │ │ documentation being interactive or not. │
│ │ │ │
│ │ │ https://docs.readme.com/main/docs/openapi-extensions#disable-the-api-explorer │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ x-readme.proxy-enabled │ 🟢 │ The x-readme.proxy-enabled extension allows you to toggle if API requests from │
│ │ │ API documentation should be routed through ReadMe's CORS Proxy. You should only │
│ │ │ need to use this if your API does not support CORS. │
│ │ │ │
│ │ │ https://docs.readme.com/main/docs/openapi-extensions#cors-proxy-enabled │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ x-readme.samples-languages │ 🟢 │ The x-readme.samples-languages extension allows you to toggle what languages are │
│ │ │ shown by default for code snippets in your API documentation. │
│ │ │ │
│ │ │ https://docs.readme.com/main/docs/openapi-extensions#code-sample-languages │
└────────────────────────────┴───────┴──────────────────────────────────────────────────────────────────────────────────┘
"
`;
exports[`rdme openapi inspect > full reports > should generate a report for @readme/oas-examples/3.1/json/train-travel.json 1`] = `
"Here are some interesting things we found in your API definition. 🕵️
· You are using 2 media types throughout your API: application/json and application/xml
· You have a total of 9 operations in your API.
· You are using a single security type throughout your API: oauth2
🌲 OpenAPI Features
┌────────────────────────────┬───────┬──────────────────────────────────────────────────────────────────────────────────┐
│ Feature │ Used? │ Description │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ additionalProperties │ 🔴 │ additionalProperties allows you to document dictionaries where the keys are │
│ │ │ user-supplied strings. │
│ │ │ │
│ │ │ https://json-schema.org/understanding-json-schema/reference/object. │
│ │ │ html#additional-properties │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ callbacks │ 🔴 │ Callbacks are asynchronous, out-of-band requests that your service will send to │
│ │ │ some other service in response to certain events. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1. │
│ │ │ md#callback-object │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ circularRefs │ 🔴 │ Circular references are $ref pointers that at some point in their lineage │
│ │ │ reference themselves. │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ commonParameters │ 🟢 │ Common parameters allow you to define parameters that are shared across multiple │
│ │ │ operations within your API. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#path- │
│ │ │ item-object │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ discriminators │ 🔴 │ With schemas that can be, or contain, different shapes, discriminators help you │
│ │ │ assist your users in identifying and determining the kind of shape they can │
│ │ │ supply or receive. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1. │
│ │ │ md#discriminator-object │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ links │ 🟢 │ Links allow you to define at call-time relationships to other operations within │
│ │ │ your API. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#link- │
│ │ │ object │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ style │ 🔴 │ Parameter serialization (style) allows you to describe how the parameter should │
│ │ │ be sent to your API. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1. │
│ │ │ md#parameter-style │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ polymorphism │ 🟢 │ Polymorphism (allOf, oneOf, and anyOf) allow you to describe schemas that may │
│ │ │ contain either many different shapes, or a single shape containing multiple │
│ │ │ different schemas. │
│ │ │ │
│ │ │ https://json-schema.org/understanding-json-schema/reference/combining.html │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ serverVariables │ 🔴 │ Server variables allow to do user-supplied variable subsitituions within your │
│ │ │ API server URL. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#server- │
│ │ │ variable-object │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ webhooks │ 🟢 │ Webhooks allow you to describe out of band requests that may be initiated by │
│ │ │ your users. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#user- │
│ │ │ content-oaswebhooks │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ xml │ 🟢 │ Any parameter and/or request body that accepts XML or responses that return XML │
│ │ │ payloads. │
│ │ │ │
│ │ │ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#xml- │
│ │ │ object │
└────────────────────────────┴───────┴──────────────────────────────────────────────────────────────────────────────────┘
🦉 ReadMe-Specific Features and Extensions
┌────────────────────────────┬───────┬──────────────────────────────────────────────────────────────────────────────────┐
│ Feature │ Used? │ Description │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ x-default │ 🔴 │ The x-default extension allows you to define static authentication credential │
│ │ │ defaults for OAuth 2 and API Key security types. │
│ │ │ │
│ │ │ https://docs.readme.com/main/docs/openapi-extensions#authentication-defaults │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ x-readme.code-samples │ 🔴 │ The x-readme.code-samples extension allows you to custom, create static code │
│ │ │ samples on your API documentation. │
│ │ │ │
│ │ │ https://docs.readme.com/main/docs/openapi-extensions#custom-code-samples │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ x-readme.headers │ 🔴 │ The x-readme.headers extension allows you define headers that should always be │
│ │ │ present on your API or a specific operation, as well as what its value should │
│ │ │ be. │
│ │ │ │
│ │ │ https://docs.readme.com/main/docs/openapi-extensions#static-headers │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ x-readme.explorer-enabled │ 🔴 │ The x-readme.explorer-enabled extension allows you to toggle your API │
│ │ │ documentation being interactive or not. │
│ │ │ │
│ │ │ https://docs.readme.com/main/docs/openapi-extensions#disable-the-api-explorer │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ x-readme.proxy-enabled │ 🔴 │ The x-readme.proxy-enabled extension allows you to toggle if API requests from │
│ │ │ API documentation should be routed through ReadMe's CORS Proxy. You should only │
│ │ │ need to use this if your API does not support CORS. │
│ │ │ │
│ │ │ https://docs.readme.com/main/docs/openapi-extensions#cors-proxy-enabled │
├────────────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────┤
│ x-readme.samples-languages │ 🔴 │ The x-readme.samples-languages extension allows you to toggle what languages are │
│ │ │ shown by default for code snippets in your API documentation. │
│ │ │ │
│ │ │ https://docs.readme.com/main/docs/openapi-extensions#code-sample-languages │
└────────────────────────────┴───────┴──────────────────────────────────────────────────────────────────────────────────┘
"
`;