Repository navigation
Expand file tree
/
Copy pathopenapi.json
More file actions
3139 lines (3139 loc) · 127 KB
/
Copy pathopenapi.json
File metadata and controls
3139 lines (3139 loc) · 127 KB
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
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"openapi": "3.1.1",
"info": {
"title": "RequestBench corpus",
"version": "000a1fe0e7d7",
"description": "Generated from the corpus in tests/ by orchestrator/openapi.ts. Do not edit it. Run npm run spec after changing a test or a payload. npm test fails while this file is out of date.\n\nIt is the same for every framework. Each operation is what one or more tests send. Its summary names the tests, and its description gives each test's file and quotes its about.\n\nEvery body the corpus compares is a payload. The harness copies tests/payloads/ into the container and names the directory in RB_PAYLOADS. Load every file before /health answers 200, keep the parsed objects in the framework's own types, and serialise them on every request. Compute nothing ahead of a request.\n\nAn example on each body names the payload it is, and holds no value. When the payload is a committed file, the example links to it, such as items.large to tests/payloads/items.large.json. That file is the exact answer. A computed answer, such as a row, a rendered page or the bind answer, has no file. Its example names the payloads it is computed from, and tests/payloads/index.ts computes it.\n\nA value written {run.name} is drawn once per run and never given to the framework. A handler binds it as the type its schema gives and writes it back in an echo object beside the payload's own fields.\n\nx-rb-serial is the Unix time in milliseconds the handler ran at, a bar, and a part no other run of a handler serving the port writes, such as `1790000000000|42`. A process that serves alone can count its runs, and one of several workers adds its process id or writes a random number. A stored answer replayed from a cache carries the value it was stored with, and a cache keeps an answer for 30 seconds.\n\nAn answer of 400 or above carries the framework's own error body, which has to be non-empty JSON. The corpus reads a refusal only through the framework's frameworks/<language>/<name>/client-exception/index.ts. That declaration gives four statuses, which this document writes as 4XX and names by field: rejected, malformed, notFound and wrongMethod. It also says whether a rejection names every bad field or only the first.\n\nA path's own description names any request sent there that no route may answer.\n\nA framework configures the bearer token, the CORS policy on /cors, and its cache's lifetime and vary headers where it usually configures them. tests/README.md states the values.\n\nThe harness passes PORT and RB_HOST. /health and /__meta are the contract's own and are not tests."
},
"servers": [
{
"url": "http://localhost:{port}",
"description": "A target binds 8080 in a container, and PORT as a host process.",
"variables": {
"port": {
"default": "8080"
}
}
}
],
"tags": [
{
"name": "authorized",
"description": "The framework's own authorization mechanism, with the crypto left out.\n\nComparable across every framework. The token differs from the accepted one by its last character, so the denial arm walks the same string and measures the plumbing rather than a length check."
},
{
"name": "baseline",
"description": "The dispatch floor, with nothing serialised.\n\nComparable across every framework. It is the row the rest are read against rather than a measurement of anything on its own: a framework that is slow here is slow everywhere."
},
{
"name": "body",
"description": "The parser and the validator, with size crossed against validation.\n\nComparable across every framework. Bind parses without validating, so validate minus bind is the validator alone rather than the validator plus the parse."
},
{
"name": "cache",
"description": "The framework's response cache: the handler skipped and a stored answer replayed, keyed by a path segment and by request header, and kept for 30 seconds.\n\nComparable across stores rather than across frameworks. Several frameworks ship no response cache and run a package chosen for them, so a ranking that carried these rows would be ranking the package."
},
{
"name": "compressed",
"description": "Outbound gzip: the wiring declining, the wiring working, and the small-body threshold.\n\nComparable across every framework. The identity rows carry the middleware installed and refusing, so subtracting them from the gzip rows leaves the compression itself."
},
{
"name": "cors",
"description": "The framework's own CORS feature, attached to /cors with the one policy every framework configures itself: a preflight the feature answers alone, and the real request it lets through.\n\nComparable across every framework. The policy names its origin, because with * the feature compares nothing, and an API that sends credentials cannot use *. A framework whose feature can only cover the whole application runs it on every request, and says so in its README."
},
{
"name": "errors",
"description": "A router miss, a handler's miss, a method the route does not have, and a parser failure.\n\nComparable across every framework, on the status and on whether the answer carries a body at all. Not on the body's shape, which is the framework's own contract."
},
{
"name": "etag",
"description": "The framework's own conditional-request machinery: the validator it computes over the body, and the 304 it answers.\n\nComparable across every framework at one body size. Not across sizes: the small row hashes a row and the large row hashes fourteen hundred, and the ratio between them is a hash rate."
},
{
"name": "forms",
"description": "Request bodies that are not JSON: a urlencoded form and a multipart upload, each bound through the framework's own form support.\n\nComparable across every framework. The urlencoded row answers what query.many answers, so the pair differs only in where the eight fields came from."
},
{
"name": "headers",
"description": "The request header map at five headers and at thirty, left unread and with three of them bound and echoed.\n\nComparable across every framework. The unread rows hold the count, so the bound rows minus them is the binding rather than the materialising."
},
{
"name": "items",
"description": "Every method on one resource, over the rows of the large item payload: a row read, its headers alone, and four writes that answer as if they had written.\n\nComparable across every framework. Each row sends one row-sized body or none and answers one row or nothing, so the methods differ in what the framework does with the request rather than in how much it serialises. A measured row may not leave the server changed, so the writes store nothing and no framework's store is what is measured."
},
{
"name": "json",
"description": "Serialising a body the framework already holds, across three size regimes.\n\nComparable across every framework at one size, and across the three sizes as a set. The small row against the large one is what separates a framework with a fast codec from one with a fast request path."
},
{
"name": "middleware",
"description": "Per-layer dispatch cost at zero, four and sixteen no-op layers.\n\nComparable across every framework. Every layer calls the next and does nothing else, so the slope between the three is the framework's per-layer cost and nothing else."
},
{
"name": "parameters",
"description": "Router captures, with segment depth held constant, each bound as an integer and echoed.\n\nComparable across every framework. The static row holds the depth, so the capture rows minus it is the router capturing rather than the router matching."
},
{
"name": "query",
"description": "Query string parsing, percent-decoding and coercion, with the values echoed and put to no other use.\n\nComparable across every framework. Eight parameters on the many row, because eight is what a real search endpoint carries: a page and a size, a sort, a text term and four filters."
},
{
"name": "sse",
"description": "Server-sent events: a text/event-stream response written event by event through the framework's own support for it.\n\nComparable across every framework. A framework with no support of its own writes the events by hand, and says so in its README. The events carry stream.ndjson's rows, so the difference from it is the event framing."
},
{
"name": "static",
"description": "The framework's static-file feature, serving committed files from the payload directory.\n\nComparable across every framework. The files are items.small.json, items.medium.json and items.large.json, so read against the json row of the same size the difference is the file served against the same rows serialised."
},
{
"name": "stream",
"description": "A response written in parts as it is produced, rather than serialised whole and sent with its length.\n\nComparable across every framework. The rows are items.medium's, so the difference from json.medium is the streaming path and a write per row."
},
{
"name": "template",
"description": "Server-side rendering of the same model the json family serialises.\n\nComparable across template engines rather than across frameworks. Rendering is partly the engine's work, so a ranking that carried these rows would be measuring one engine against another."
}
],
"paths": {
"/__meta": {
"get": {
"operationId": "getMeta",
"summary": "What ran",
"description": "Not measured and not checked. Every key is recorded on the result row. The runner reads framework, version, runtime and adapter for its summary line, and bootMs for the boot report.",
"responses": {
"200": {
"description": "A JSON object.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"framework": {
"type": "string"
},
"version": {
"type": "string"
},
"runtime": {
"type": "string"
},
"adapter": {
"type": "string"
},
"bootMs": {
"type": "number"
}
}
}
}
}
}
}
}
},
"/authorized/small": {
"get": {
"operationId": "getAuthorizedSmall",
"summary": "authorized.allowed, authorized.denied",
"description": "**authorized.allowed** (tests/authorized/allowed.ts). A bearer token the framework's own authorization mechanism has to check before the handler runs. Read against json.small, the difference is the check and the plumbing that carries it, not the crypto, which this family leaves out. It sends `authorization: Bearer 5a7cc77ed0dcb825806b6f872026c317`.\n\n**authorized.denied** (tests/authorized/denied.ts). The same endpoint refusing. The token differs from the accepted one by its last character, so the comparison walks the whole string and this row measures the refusal path rather than a length check. It sends `authorization: Bearer 5a7cc77ed0dcb825806b6f872026c310`.",
"tags": [
"authorized"
],
"security": [
{
"bearer": []
}
],
"responses": {
"200": {
"description": "authorized.allowed: the body is `items.small`.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/payloadSmall"
},
"examples": {
"items.small": {
"summary": "items.small",
"description": "Compared as parsed JSON, so key order and how a number is written do not matter.",
"externalValue": "../tests/payloads/items.small.json"
}
}
}
}
},
"403": {
"description": "The framework's own error body, which has to be non-empty JSON.\n\nauthorized.denied: any error body.",
"content": {
"application/json": {}
}
}
}
}
},
"/body/bind/large": {
"post": {
"operationId": "postBodyBindLarge",
"summary": "body.bind_large",
"description": "**body.bind_large** (tests/body/bind-large.ts). A body parsed and bound without being validated, at about 40 KB. The answer carries a count of the leaves it found, which is what says the request was parsed rather than piped to the response. Read against body.bind_medium, the difference is the parser and the binder at scale.",
"tags": [
"body"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/orderRequest"
},
"examples": {
"order.large": {
"summary": "order.large",
"description": "body.bind_large sends it.",
"externalValue": "../tests/payloads/order.large.json"
}
}
}
}
},
"responses": {
"200": {
"description": "body.bind_large: the body is `bind.large`.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/bindEcho"
},
"examples": {
"bind.large": {
"summary": "bind.large",
"description": "Computed from `order.large`, with no file of its own. Compared as parsed JSON, so key order and how a number is written do not matter."
}
}
}
}
}
}
}
},
"/body/bind/medium": {
"post": {
"operationId": "postBodyBindMedium",
"summary": "body.bind_medium",
"description": "**body.bind_medium** (tests/body/bind-medium.ts). A body parsed and bound without being validated. The answer carries a count of the leaves it found, which is what says the request was parsed rather than piped to the response. This is what the validate row of the same size is subtracted from.",
"tags": [
"body"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/orderRequest"
},
"examples": {
"order.medium": {
"summary": "order.medium",
"description": "body.bind_medium sends it.",
"externalValue": "../tests/payloads/order.medium.json"
}
}
}
}
},
"responses": {
"200": {
"description": "body.bind_medium: the body is `bind.medium`.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/bindEcho"
},
"examples": {
"bind.medium": {
"summary": "bind.medium",
"description": "Computed from `order.medium`, with no file of its own. Compared as parsed JSON, so key order and how a number is written do not matter."
}
}
}
}
}
}
}
},
"/body/bind/small": {
"post": {
"operationId": "postBodyBindSmall",
"summary": "body.bind_small",
"description": "**body.bind_small** (tests/body/bind-small.ts). A body parsed and bound without being validated. The answer carries a count of the leaves it found, which is what says the request was parsed rather than piped to the response. This is what the validate row of the same size is subtracted from.",
"tags": [
"body"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/orderRequest"
},
"examples": {
"order.small": {
"summary": "order.small",
"description": "body.bind_small sends it.",
"externalValue": "../tests/payloads/order.small.json"
}
}
}
}
},
"responses": {
"200": {
"description": "body.bind_small: the body is `bind.small`.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/bindEcho"
},
"examples": {
"bind.small": {
"summary": "bind.small",
"description": "Computed from `order.small`, with no file of its own. Compared as parsed JSON, so key order and how a number is written do not matter."
}
}
}
}
}
}
}
},
"/body/validate/first-error": {
"post": {
"operationId": "postBodyValidateFirstError",
"summary": "body.rejected_first",
"description": "**body.rejected_first** (tests/body/rejected-first.ts). The same body against a route that stops at the first bad field. Read against body.rejected_all, the difference is the two error contracts: one walks the whole object and one gives up, and the second is doing less work.",
"tags": [
"body"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"examples": {
"order.invalid": {
"summary": "order.invalid",
"description": "body.rejected_first sends it and expects it refused.",
"externalValue": "../tests/payloads/order.invalid.json"
}
}
}
}
},
"responses": {
"4XX": {
"description": "The framework's own error body, which has to be non-empty JSON. Each test below names its status by the field in the framework's client-exception/index.ts.\n\nbody.rejected_first: the rejected status, naming customerId.",
"content": {
"application/json": {}
}
}
}
}
},
"/body/validate/large": {
"post": {
"operationId": "postBodyValidateLarge",
"summary": "body.validate_large",
"description": "**body.validate_large** (tests/body/validate-large.ts). The same body checked against a schema before the handler sees it, and answered exactly as the bind row answers it. Read against body.bind_large, the difference is the validator alone rather than the validator plus the parse.",
"tags": [
"body"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/orderRequest"
},
"examples": {
"order.large": {
"summary": "order.large",
"description": "body.validate_large sends it.",
"externalValue": "../tests/payloads/order.large.json"
}
}
}
}
},
"responses": {
"200": {
"description": "body.validate_large: the body is `bind.large`.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/bindEcho"
},
"examples": {
"bind.large": {
"summary": "bind.large",
"description": "Computed from `order.large`, with no file of its own. Compared as parsed JSON, so key order and how a number is written do not matter."
}
}
}
}
}
}
}
},
"/body/validate/medium": {
"post": {
"operationId": "postBodyValidateMedium",
"summary": "body.validate_medium",
"description": "**body.validate_medium** (tests/body/validate-medium.ts). The same body checked against a schema before the handler sees it, and answered exactly as the bind row answers it. Read against body.bind_medium, the difference is the validator alone rather than the validator plus the parse.",
"tags": [
"body"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/orderRequest"
},
"examples": {
"order.medium": {
"summary": "order.medium",
"description": "body.validate_medium sends it.",
"externalValue": "../tests/payloads/order.medium.json"
}
}
}
}
},
"responses": {
"200": {
"description": "body.validate_medium: the body is `bind.medium`.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/bindEcho"
},
"examples": {
"bind.medium": {
"summary": "bind.medium",
"description": "Computed from `order.medium`, with no file of its own. Compared as parsed JSON, so key order and how a number is written do not matter."
}
}
}
}
}
}
}
},
"/body/validate/small": {
"post": {
"operationId": "postBodyValidateSmall",
"summary": "body.rejected_all, body.validate_small, errors.malformed",
"description": "**body.rejected_all** (tests/body/rejected-all.ts). Three fields wrong in one body. What a rejection looks like is the framework's own contract, so the status and the field paths are read through its exceptions declaration and this test never sees an error body.\n\n**body.validate_small** (tests/body/validate-small.ts). The same body checked against a schema before the handler sees it, and answered exactly as the bind row answers it. Read against body.bind_small, the difference is the validator alone rather than the validator plus the parse.\n\n**errors.malformed** (tests/errors/malformed.ts). A body that is not JSON at all. Read against body.rejected_all, the difference is the parser failing rather than the validator refusing, which is often not even the same status inside one framework.",
"tags": [
"body",
"errors"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/orderRequest"
},
"examples": {
"order.invalid": {
"summary": "order.invalid",
"description": "body.rejected_all sends it and expects it refused.",
"externalValue": "../tests/payloads/order.invalid.json"
},
"order.small": {
"summary": "order.small",
"description": "body.validate_small sends it.",
"externalValue": "../tests/payloads/order.small.json"
}
}
}
}
},
"responses": {
"200": {
"description": "body.validate_small: the body is `bind.small`.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/bindEcho"
},
"examples": {
"bind.small": {
"summary": "bind.small",
"description": "Computed from `order.small`, with no file of its own. Compared as parsed JSON, so key order and how a number is written do not matter."
}
}
}
}
},
"4XX": {
"description": "The framework's own error body, which has to be non-empty JSON. Each test below names its status by the field in the framework's client-exception/index.ts.\n\nbody.rejected_all: the rejected status, naming customerId, status and lines, or one of them where the declaration says reports `\"first\"`.\n\nerrors.malformed: the malformed status, because `{\"customerId\": 1, \"lines\": [` is not JSON.",
"content": {
"application/json": {}
}
}
}
}
},
"/cache/large/{key}": {
"get": {
"operationId": "getCacheLargeKey",
"summary": "cache.large",
"description": "**cache.large** (tests/cache/large.ts). The handler skipped and a stored answer written back, under one of four keys the path names. Read against json.large, the difference is the store answering instead of the framework, which is why this row asserts the serial repeated rather than changed.",
"tags": [
"cache"
],
"parameters": [
{
"name": "key",
"in": "path",
"required": true,
"description": "The key the answer is stored under, drawn per request from `k1`, `k2`, `k3` and `k4`.",
"schema": {
"type": "string",
"enum": [
"k1",
"k2",
"k3",
"k4"
]
}
}
],
"responses": {
"200": {
"description": "cache.large: the body is `items.large`, x-rb-serial repeats.",
"headers": {
"x-rb-serial": {
"required": true,
"description": "The value the stored answer was written with. Every later request for the same cache key has to repeat it until the answer expires. Checked by cache.large.",
"schema": {
"type": "string",
"pattern": "^\\d+\\|[^|\\s]+$"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/payloadLarge"
},
"examples": {
"items.large": {
"summary": "items.large",
"description": "Compared as parsed JSON, so key order and how a number is written do not matter.",
"externalValue": "../tests/payloads/items.large.json"
}
}
}
}
}
}
}
},
"/cache/medium/{key}": {
"get": {
"operationId": "getCacheMediumKey",
"summary": "cache.medium",
"description": "**cache.medium** (tests/cache/medium.ts). The handler skipped and a stored answer written back, under one of four keys the path names. Read against json.medium, the difference is the store answering instead of the framework, which is why this row asserts the serial repeated rather than changed.",
"tags": [
"cache"
],
"parameters": [
{
"name": "key",
"in": "path",
"required": true,
"description": "The key the answer is stored under, drawn per request from `k1`, `k2`, `k3` and `k4`.",
"schema": {
"type": "string",
"enum": [
"k1",
"k2",
"k3",
"k4"
]
}
}
],
"responses": {
"200": {
"description": "cache.medium: the body is `items.medium`, x-rb-serial repeats.",
"headers": {
"x-rb-serial": {
"required": true,
"description": "The value the stored answer was written with. Every later request for the same cache key has to repeat it until the answer expires. Checked by cache.medium.",
"schema": {
"type": "string",
"pattern": "^\\d+\\|[^|\\s]+$"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/payloadMedium"
},
"examples": {
"items.medium": {
"summary": "items.medium",
"description": "Compared as parsed JSON, so key order and how a number is written do not matter.",
"externalValue": "../tests/payloads/items.medium.json"
}
}
}
}
}
}
}
},
"/cache/small/{key}": {
"get": {
"operationId": "getCacheSmallKey",
"summary": "cache.small",
"description": "**cache.small** (tests/cache/small.ts). The handler skipped and a stored answer written back, under one of four keys the path names. Read against json.small, the difference is the store answering instead of the framework, which is why this row asserts the serial repeated rather than changed.",
"tags": [
"cache"
],
"parameters": [
{
"name": "key",
"in": "path",
"required": true,
"description": "The key the answer is stored under, drawn per request from `k1`, `k2`, `k3` and `k4`.",
"schema": {
"type": "string",
"enum": [
"k1",
"k2",
"k3",
"k4"
]
}
}
],
"responses": {
"200": {
"description": "cache.small: the body is `items.small`, x-rb-serial repeats.",
"headers": {
"x-rb-serial": {
"required": true,
"description": "The value the stored answer was written with. Every later request for the same cache key has to repeat it until the answer expires. Checked by cache.small.",
"schema": {
"type": "string",
"pattern": "^\\d+\\|[^|\\s]+$"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/payloadSmall"
},
"examples": {
"items.small": {
"summary": "items.small",
"description": "Compared as parsed JSON, so key order and how a number is written do not matter.",
"externalValue": "../tests/payloads/items.small.json"
}
}
}
}
}
}
}
},
"/cache/vary/many/{key}": {
"get": {
"operationId": "getCacheVaryManyKey",
"summary": "cache.vary_many",
"description": "**cache.vary_many** (tests/cache/vary-many.ts). The same thing keyed on three headers instead of one. Read against cache.vary_one, the difference is thirty-two distinct keys where there were eight, which is what a store has to be sized against rather than what it costs to read. It sends `x-rb-channel` set per request to `web` or `app`, `x-rb-region` set per request to `eu` or `us` and `x-rb-tenant` set per request to `alpha` or `beta`.",
"tags": [
"cache"
],
"parameters": [
{
"name": "key",
"in": "path",
"required": true,
"description": "The key the answer is stored under, drawn per request from `k1`, `k2`, `k3` and `k4`.",
"schema": {
"type": "string",
"enum": [
"k1",
"k2",
"k3",
"k4"
]
}
}
],
"responses": {
"200": {
"description": "cache.vary_many: the body is `items.small`, x-rb-serial repeats.",
"headers": {
"x-rb-serial": {
"required": true,
"description": "The value the stored answer was written with. Every later request for the same cache key has to repeat it until the answer expires. Checked by cache.vary_many.",
"schema": {
"type": "string",
"pattern": "^\\d+\\|[^|\\s]+$"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/payloadSmall"
},
"examples": {
"items.small": {
"summary": "items.small",
"description": "Compared as parsed JSON, so key order and how a number is written do not matter.",
"externalValue": "../tests/payloads/items.small.json"
}
}
}
}
}
}
}
},
"/cache/vary/one/{key}": {
"get": {
"operationId": "getCacheVaryOneKey",
"summary": "cache.vary_one",
"description": "**cache.vary_one** (tests/cache/vary-one.ts). The stored answer keyed by a request header as well as by the path. One header with two values, picked per instance, so a store that ignores the vary header holds four entries where the plan sent eight keys. It sends `x-rb-tenant` set per request to `alpha` or `beta`.",
"tags": [
"cache"
],
"parameters": [
{
"name": "key",
"in": "path",
"required": true,
"description": "The key the answer is stored under, drawn per request from `k1`, `k2`, `k3` and `k4`.",
"schema": {
"type": "string",
"enum": [
"k1",
"k2",
"k3",
"k4"
]
}
}
],
"responses": {
"200": {
"description": "cache.vary_one: the body is `items.small`, x-rb-serial repeats.",
"headers": {
"x-rb-serial": {
"required": true,
"description": "The value the stored answer was written with. Every later request for the same cache key has to repeat it until the answer expires. Checked by cache.vary_one.",
"schema": {
"type": "string",
"pattern": "^\\d+\\|[^|\\s]+$"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/payloadSmall"
},
"examples": {
"items.small": {
"summary": "items.small",
"description": "Compared as parsed JSON, so key order and how a number is written do not matter.",
"externalValue": "../tests/payloads/items.small.json"
}
}
}
}
}
}
}
},
"/compressed/large": {
"get": {
"operationId": "getCompressedLarge",
"summary": "compressed.gzip_large, compressed.identity_large",
"description": "**compressed.gzip_large** (tests/compressed/gzip-large.ts). The middleware compressing a body large enough to be worth it. Read against compressed.identity_large, the difference is the compression and nothing else, because both rows carry the same wiring. It sends `accept-encoding: gzip` and `cache-control: no-cache`.\n\n**compressed.identity_large** (tests/compressed/identity-large.ts). The compression middleware installed and declining. The client asks for identity, so nothing is compressed and what this row carries is the cost of the wiring being in the path at all. It is what the gzip arm is subtracted from. It sends `accept-encoding: identity` and `cache-control: no-cache`.",
"tags": [
"compressed"
],
"responses": {
"200": {
"description": "compressed.gzip_large: the body is `items.large`, gzip-encoded, x-rb-serial is new.\n\ncompressed.identity_large: the body is `items.large`, with no content coding, x-rb-serial is new.",
"headers": {
"content-encoding": {
"required": false,
"description": "Checked by compressed.gzip_large.",
"schema": {
"type": "string",
"const": "gzip"
}
},
"x-rb-serial": {
"required": true,
"description": "The Unix time in milliseconds the handler ran at, a bar, and a part no other run of a handler serving the port writes. It has to differ from every value an earlier answer carried. Checked by compressed.gzip_large and compressed.identity_large.",
"schema": {
"type": "string",
"pattern": "^\\d+\\|[^|\\s]+$"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/payloadLarge"
},
"examples": {
"items.large": {
"summary": "items.large",
"description": "Compared as parsed JSON, so key order and how a number is written do not matter.",
"externalValue": "../tests/payloads/items.large.json"
}
}
}
}
}
}
}
},
"/compressed/small": {
"get": {
"operationId": "getCompressedSmall",
"summary": "compressed.gzip_small, compressed.identity_small",
"description": "**compressed.gzip_small** (tests/compressed/gzip-small.ts). The middleware actually asked to compress, on a body too small to benefit. Whether a framework bothers is the point, so this row does not assert that the answer came back compressed; it asserts the answer is right either way. It sends `accept-encoding: gzip` and `cache-control: no-cache`.\n\n**compressed.identity_small** (tests/compressed/identity-small.ts). The compression middleware installed and declining. The client asks for identity, so nothing is compressed and what this row carries is the cost of the wiring being in the path at all. It is what the gzip arm is subtracted from. It sends `accept-encoding: identity` and `cache-control: no-cache`.",
"tags": [
"compressed"
],
"responses": {
"200": {
"description": "compressed.gzip_small: the body is `items.small`, x-rb-serial is new.\n\ncompressed.identity_small: the body is `items.small`, with no content coding, x-rb-serial is new.",
"headers": {
"x-rb-serial": {
"required": true,
"description": "The Unix time in milliseconds the handler ran at, a bar, and a part no other run of a handler serving the port writes. It has to differ from every value an earlier answer carried. Checked by compressed.gzip_small and compressed.identity_small.",
"schema": {
"type": "string",
"pattern": "^\\d+\\|[^|\\s]+$"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/payloadSmall"
},
"examples": {
"items.small": {
"summary": "items.small",
"description": "Compared as parsed JSON, so key order and how a number is written do not matter.",
"externalValue": "../tests/payloads/items.small.json"
}
}
}
}
}
}
}
},
"/cors/small": {
"get": {
"operationId": "getCorsSmall",
"summary": "cors.request, cors.vary",
"description": "**cors.request** (tests/cors/request.ts). The cross-origin request itself, with the origin and the custom header the preflight asked about. The feature adds its header and lets the request through to the handler. Read against json.small, the difference is the policy checked on a request that passes it. It sends `origin: https://shop.example.com` and `x-rb-tenant: {run.tenant}`.\n\n**cors.vary** (tests/cors/vary.ts, a validation test that is not measured). The real response carries Vary: Origin. A policy that names its origin answers differently per origin, so a cache in front of the framework has to key on it. It sends `origin: https://shop.example.com` and `x-rb-tenant: {run.tenant}`.",
"tags": [
"cors"
],
"responses": {
"200": {
"description": "cors.request: the body is `items.small`, x-rb-serial is new.\n\ncors.vary: any body.",
"headers": {
"access-control-allow-origin": {
"required": true,
"description": "Checked by cors.request.",
"schema": {
"type": "string",
"const": "https://shop.example.com"
}
},
"x-rb-serial": {
"required": true,
"description": "The Unix time in milliseconds the handler ran at, a bar, and a part no other run of a handler serving the port writes. It has to differ from every value an earlier answer carried. Checked by cors.request.",
"schema": {
"type": "string",
"pattern": "^\\d+\\|[^|\\s]+$"
}
},
"vary": {
"required": true,
"description": "It matches `/(^|,)\\s*origin\\s*(,|$)/i`. Checked by cors.vary.",
"schema": {
"type": "string"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/payloadSmall"
},
"examples": {
"items.small": {
"summary": "items.small",
"description": "Compared as parsed JSON, so key order and how a number is written do not matter.",
"externalValue": "../tests/payloads/items.small.json"
}
}
}
}
}
}
},
"options": {
"operationId": "optionsCorsSmall",
"summary": "cors.disallowed, cors.preflight",
"description": "**cors.disallowed** (tests/cors/disallowed.ts, a validation test that is not measured). A preflight from an origin the policy does not name gets no access-control-allow-origin, which is what stops the browser. The status is not checked, because frameworks differ on it. It sends `origin: https://elsewhere.example.net`, `access-control-request-method: GET` and `access-control-request-headers: x-rb-tenant`.\n\n**cors.preflight** (tests/cors/preflight.ts). The question a browser asks before a cross-origin request with a custom header, answered by the CORS feature before any handler runs. The handler on this route writes x-rb-serial, so its absence shows the feature answered alone. 200 and 204 are both accepted, because the Fetch standard takes any 2xx and frameworks split. Read against baseline.plaintext, the difference is the policy being matched. It sends `origin: https://shop.example.com`, `access-control-request-method: GET` and `access-control-request-headers: x-rb-tenant`.",
"tags": [
"cors"
],
"responses": {
"200": {
"description": "cors.preflight: 200 or 204, no x-rb-serial.",
"headers": {
"access-control-allow-origin": {
"required": true,
"description": "Checked by cors.preflight.",
"schema": {
"type": "string",
"const": "https://shop.example.com"
}
},
"access-control-allow-headers": {
"required": true,
"description": "It matches `/(^|,)\\s*x-rb-tenant\\s*(,|$)/i`. Checked by cors.preflight.",
"schema": {
"type": "string"
}
},
"access-control-max-age": {
"required": true,
"description": "Checked by cors.preflight.",
"schema": {
"type": "string",
"const": "600"
}
}
}
},
"204": {
"description": "cors.preflight: 200 or 204, no x-rb-serial.",
"headers": {
"access-control-allow-origin": {
"required": true,
"description": "Checked by cors.preflight.",
"schema": {
"type": "string",
"const": "https://shop.example.com"
}
},
"access-control-allow-headers": {
"required": true,
"description": "It matches `/(^|,)\\s*x-rb-tenant\\s*(,|$)/i`. Checked by cors.preflight.",
"schema": {
"type": "string"
}
},
"access-control-max-age": {
"required": true,
"description": "Checked by cors.preflight.",
"schema": {
"type": "string",
"const": "600"
}
}
}
},
"default": {
"description": "cors.disallowed: no access-control-allow-origin."
}
}
}
},
"/errors/unmatched": {
"summary": "errors.unmatched",
"description": "**errors.unmatched** (tests/errors/unmatched.ts) sends GET here, and no route matches the path. The router answers with the notFound status in the framework's client-exception/index.ts, and the framework's own error body. A path no route matches, which is the router's own miss rather than a handler's decision. A framework that walks its whole route table before giving up pays for it here and nowhere else."
},
"/etag/large": {
"get": {
"operationId": "getEtagLarge",
"summary": "etag.large, etag.match_large, etag.stale_large",
"description": "**etag.large** (tests/etag/large.ts). The framework hashing the body it is about to send and writing the validator it computed onto the response. Read against json.large, the difference is the hash and the header. The tag is the framework's own, so no two of them agree on it.\n\n**etag.match_large** (tests/etag/match-large.ts). The only row that cannot be sent until the framework has answered a different one: the validator is the framework's to produce. A 304 saves the write and nothing else, because the body is built and hashed before anything is compared. It sends `if-none-match` set to the etag the first GET answered.\n\n**etag.stale_large** (tests/etag/stale-large.ts). A conditional request whose validator does not match, answered in full. Read against etag.match_large, the difference is the write the 304 saved, and read against etag.large it is the comparison that failed. It sends `if-none-match: \"0000000000000000\"`.",
"tags": [
"etag"
],
"responses": {
"200": {
"description": "etag.large: the body is `items.large`, x-rb-serial is new.\n\netag.stale_large: the body is `items.large`, x-rb-serial is new.",
"headers": {
"etag": {
"required": true,
"description": "Checked by etag.large.",
"schema": {
"type": "string"
}
},
"x-rb-serial": {