| 1 | // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html |
| 2 | |
| 3 | exports[`HttpApi > original tests > OpenAPI spec > fixture 1`] = ` |
| 4 | { |
| 5 | "components": { |
| 6 | "schemas": { |
| 7 | "ComponentsSchema": { |
| 8 | "additionalProperties": false, |
| 9 | "properties": { |
| 10 | "contentType": { |
| 11 | "type": "string", |
| 12 | }, |
| 13 | "length": { |
| 14 | "type": "integer", |
| 15 | }, |
| 16 | }, |
| 17 | "required": [ |
| 18 | "contentType", |
| 19 | "length", |
| 20 | ], |
| 21 | "type": "object", |
| 22 | }, |
| 23 | "GroupEncoded": { |
| 24 | "additionalProperties": false, |
| 25 | "properties": { |
| 26 | "id": { |
| 27 | "type": "integer", |
| 28 | }, |
| 29 | "name": { |
| 30 | "type": "string", |
| 31 | }, |
| 32 | }, |
| 33 | "required": [ |
| 34 | "id", |
| 35 | "name", |
| 36 | ], |
| 37 | "type": "object", |
| 38 | }, |
| 39 | "NoStatusErrorEncoded": { |
| 40 | "additionalProperties": false, |
| 41 | "properties": { |
| 42 | "_tag": { |
| 43 | "enum": [ |
| 44 | "NoStatusError", |
| 45 | ], |
| 46 | "type": "string", |
| 47 | }, |
| 48 | }, |
| 49 | "required": [ |
| 50 | "_tag", |
| 51 | ], |
| 52 | "type": "object", |
| 53 | }, |
| 54 | "UserEncoded": { |
| 55 | "additionalProperties": false, |
| 56 | "properties": { |
| 57 | "createdAt": { |
| 58 | "type": "string", |
| 59 | }, |
| 60 | "id": { |
| 61 | "type": "integer", |
| 62 | }, |
| 63 | "name": { |
| 64 | "type": "string", |
| 65 | }, |
| 66 | "uuid": { |
| 67 | "anyOf": [ |
| 68 | { |
| 69 | "type": "string", |
| 70 | }, |
| 71 | { |
| 72 | "type": "null", |
| 73 | }, |
| 74 | ], |
| 75 | }, |
| 76 | }, |
| 77 | "required": [ |
| 78 | "id", |
| 79 | "name", |
| 80 | "createdAt", |
| 81 | ], |
| 82 | "type": "object", |
| 83 | }, |
| 84 | "UserErrorEncoded": { |
| 85 | "additionalProperties": false, |
| 86 | "properties": { |
| 87 | "_tag": { |
| 88 | "enum": [ |
| 89 | "UserError", |
| 90 | ], |
| 91 | "type": "string", |
| 92 | }, |
| 93 | }, |
| 94 | "required": [ |
| 95 | "_tag", |
| 96 | ], |
| 97 | "type": "object", |
| 98 | }, |
| 99 | }, |
| 100 | "securitySchemes": { |
| 101 | "cookie": { |
| 102 | "in": "cookie", |
| 103 | "name": "token", |
| 104 | "type": "apiKey", |
| 105 | }, |
| 106 | }, |
| 107 | }, |
| 108 | "info": { |
| 109 | "summary": "test api summary", |
| 110 | "title": "API", |
| 111 | "version": "0.0.1", |
| 112 | }, |
| 113 | "openapi": "3.1.0", |
| 114 | "paths": { |
| 115 | "/groups": { |
| 116 | "post": { |
| 117 | "operationId": "groups.create", |
| 118 | "parameters": [], |
| 119 | "requestBody": { |
| 120 | "content": { |
| 121 | "application/json": { |
| 122 | "schema": { |
| 123 | "additionalProperties": false, |
| 124 | "properties": { |
| 125 | "name": { |
| 126 | "type": "string", |
| 127 | }, |
| 128 | }, |
| 129 | "required": [ |
| 130 | "name", |
| 131 | ], |
| 132 | "type": "object", |
| 133 | }, |
| 134 | }, |
| 135 | "application/x-www-form-urlencoded": { |
| 136 | "schema": { |
| 137 | "additionalProperties": false, |
| 138 | "properties": { |
| 139 | "foo": { |
| 140 | "type": "string", |
| 141 | }, |
| 142 | }, |
| 143 | "required": [ |
| 144 | "foo", |
| 145 | ], |
| 146 | "type": "object", |
| 147 | }, |
| 148 | }, |
| 149 | "multipart/form-data": { |
| 150 | "schema": { |
| 151 | "additionalProperties": false, |
| 152 | "properties": { |
| 153 | "name": { |
| 154 | "type": "string", |
| 155 | }, |
| 156 | }, |
| 157 | "required": [ |
| 158 | "name", |
| 159 | ], |
| 160 | "type": "object", |
| 161 | }, |
| 162 | }, |
| 163 | }, |
| 164 | "required": true, |
| 165 | }, |
| 166 | "responses": { |
| 167 | "200": { |
| 168 | "content": { |
| 169 | "application/json": { |
| 170 | "schema": { |
| 171 | "$ref": "#/components/schemas/GroupEncoded", |
| 172 | }, |
| 173 | }, |
| 174 | }, |
| 175 | "description": "Group", |
| 176 | }, |
| 177 | }, |
| 178 | "security": [], |
| 179 | "tags": [ |
| 180 | "groups", |
| 181 | ], |
| 182 | }, |
| 183 | }, |
| 184 | "/groups/handle/{id}": { |
| 185 | "post": { |
| 186 | "operationId": "groups.handle", |
| 187 | "parameters": [ |
| 188 | { |
| 189 | "in": "path", |
| 190 | "name": "id", |
| 191 | "required": true, |
| 192 | "schema": { |
| 193 | "type": "string", |
| 194 | }, |
| 195 | }, |
| 196 | ], |
| 197 | "requestBody": { |
| 198 | "content": { |
| 199 | "application/json": { |
| 200 | "schema": { |
| 201 | "additionalProperties": false, |
| 202 | "properties": { |
| 203 | "name": { |
| 204 | "type": "string", |
| 205 | }, |
| 206 | }, |
| 207 | "required": [ |
| 208 | "name", |
| 209 | ], |
| 210 | "type": "object", |
| 211 | }, |
| 212 | }, |
| 213 | }, |
| 214 | "required": true, |
| 215 | }, |
| 216 | "responses": { |
| 217 | "200": { |
| 218 | "content": { |
| 219 | "application/json": { |
| 220 | "schema": { |
| 221 | "additionalProperties": false, |
| 222 | "properties": { |
| 223 | "id": { |
| 224 | "type": "number", |
| 225 | }, |
| 226 | "name": { |
| 227 | "type": "string", |
| 228 | }, |
| 229 | }, |
| 230 | "required": [ |
| 231 | "id", |
| 232 | "name", |
| 233 | ], |
| 234 | "type": "object", |
| 235 | }, |
| 236 | }, |
| 237 | }, |
| 238 | "description": "Success", |
| 239 | }, |
| 240 | }, |
| 241 | "security": [], |
| 242 | "tags": [ |
| 243 | "groups", |
| 244 | ], |
| 245 | }, |
| 246 | }, |
| 247 | "/groups/handleraw/{id}": { |
| 248 | "post": { |
| 249 | "operationId": "groups.handleRaw", |
| 250 | "parameters": [ |
| 251 | { |
| 252 | "in": "path", |
| 253 | "name": "id", |
| 254 | "required": true, |
| 255 | "schema": { |
| 256 | "type": "string", |
| 257 | }, |
| 258 | }, |
| 259 | ], |
| 260 | "requestBody": { |
| 261 | "content": { |
| 262 | "application/json": { |
| 263 | "schema": { |
| 264 | "additionalProperties": false, |
| 265 | "properties": { |
| 266 | "name": { |
| 267 | "type": "string", |
| 268 | }, |
| 269 | }, |
| 270 | "required": [ |
| 271 | "name", |
| 272 | ], |
| 273 | "type": "object", |
| 274 | }, |
| 275 | }, |
| 276 | }, |
| 277 | "required": true, |
| 278 | }, |
| 279 | "responses": { |
| 280 | "200": { |
| 281 | "content": { |
| 282 | "application/json": { |
| 283 | "schema": { |
| 284 | "additionalProperties": false, |
| 285 | "properties": { |
| 286 | "id": { |
| 287 | "type": "number", |
| 288 | }, |
| 289 | "name": { |
| 290 | "type": "string", |
| 291 | }, |
| 292 | }, |
| 293 | "required": [ |
| 294 | "id", |
| 295 | "name", |
| 296 | ], |
| 297 | "type": "object", |
| 298 | }, |
| 299 | }, |
| 300 | }, |
| 301 | "description": "Success", |
| 302 | }, |
| 303 | }, |
| 304 | "security": [], |
| 305 | "tags": [ |
| 306 | "groups", |
| 307 | ], |
| 308 | }, |
| 309 | }, |
| 310 | "/groups/{id}": { |
| 311 | "get": { |
| 312 | "operationId": "groups.findById", |
| 313 | "parameters": [ |
| 314 | { |
| 315 | "in": "path", |
| 316 | "name": "id", |
| 317 | "required": true, |
| 318 | "schema": { |
| 319 | "type": "string", |
| 320 | }, |
| 321 | }, |
| 322 | ], |
| 323 | "responses": { |
| 324 | "200": { |
| 325 | "content": { |
| 326 | "application/json": { |
| 327 | "schema": { |
| 328 | "$ref": "#/components/schemas/GroupEncoded", |
| 329 | }, |
| 330 | }, |
| 331 | }, |
| 332 | "description": "Group", |
| 333 | }, |
| 334 | "418": { |
| 335 | "description": "GroupError", |
| 336 | }, |
| 337 | }, |
| 338 | "security": [], |
| 339 | "tags": [ |
| 340 | "groups", |
| 341 | ], |
| 342 | }, |
| 343 | }, |
| 344 | "/healthz": { |
| 345 | "get": { |
| 346 | "operationId": "healthz", |
| 347 | "parameters": [], |
| 348 | "responses": { |
| 349 | "204": { |
| 350 | "description": "Empty", |
| 351 | }, |
| 352 | }, |
| 353 | "security": [], |
| 354 | "tags": [ |
| 355 | "root", |
| 356 | ], |
| 357 | }, |
| 358 | }, |
| 359 | "/users": { |
| 360 | "get": { |
| 361 | "deprecated": true, |
| 362 | "operationId": "listUsers", |
| 363 | "parameters": [ |
| 364 | { |
| 365 | "in": "header", |
| 366 | "name": "page", |
| 367 | "required": false, |
| 368 | "schema": { |
| 369 | "pattern": "^[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?$", |
| 370 | "type": "string", |
| 371 | }, |
| 372 | }, |
| 373 | { |
| 374 | "in": "query", |
| 375 | "name": "query", |
| 376 | "required": false, |
| 377 | "schema": { |
| 378 | "anyOf": [ |
| 379 | { |
| 380 | "type": "string", |
| 381 | }, |
| 382 | { |
| 383 | "type": "null", |
| 384 | }, |
| 385 | ], |
| 386 | "description": "search query", |
| 387 | }, |
| 388 | }, |
| 389 | ], |
| 390 | "responses": { |
| 391 | "200": { |
| 392 | "content": { |
| 393 | "application/json": { |
| 394 | "schema": { |
| 395 | "items": { |
| 396 | "$ref": "#/components/schemas/UserEncoded", |
| 397 | }, |
| 398 | "type": "array", |
| 399 | }, |
| 400 | }, |
| 401 | }, |
| 402 | "description": "Success", |
| 403 | }, |
| 404 | "500": { |
| 405 | "content": { |
| 406 | "application/json": { |
| 407 | "schema": { |
| 408 | "$ref": "#/components/schemas/NoStatusErrorEncoded", |
| 409 | }, |
| 410 | }, |
| 411 | }, |
| 412 | "description": "NoStatusError", |
| 413 | }, |
| 414 | }, |
| 415 | "security": [ |
| 416 | { |
| 417 | "cookie": [], |
| 418 | }, |
| 419 | ], |
| 420 | "summary": "test summary", |
| 421 | "tags": [ |
| 422 | "Users API", |
| 423 | ], |
| 424 | }, |
| 425 | "post": { |
| 426 | "operationId": "users.create", |
| 427 | "parameters": [ |
| 428 | { |
| 429 | "in": "query", |
| 430 | "name": "id", |
| 431 | "required": true, |
| 432 | "schema": { |
| 433 | "pattern": "^[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?$", |
| 434 | "type": "string", |
| 435 | }, |
| 436 | }, |
| 437 | ], |
| 438 | "requestBody": { |
| 439 | "content": { |
| 440 | "application/json": { |
| 441 | "schema": { |
| 442 | "additionalProperties": false, |
| 443 | "properties": { |
| 444 | "name": { |
| 445 | "type": "string", |
| 446 | }, |
| 447 | "uuid": { |
| 448 | "anyOf": [ |
| 449 | { |
| 450 | "type": "string", |
| 451 | }, |
| 452 | { |
| 453 | "type": "null", |
| 454 | }, |
| 455 | ], |
| 456 | }, |
| 457 | }, |
| 458 | "required": [ |
| 459 | "name", |
| 460 | ], |
| 461 | "type": "object", |
| 462 | }, |
| 463 | }, |
| 464 | }, |
| 465 | "required": true, |
| 466 | }, |
| 467 | "responses": { |
| 468 | "200": { |
| 469 | "content": { |
| 470 | "application/json": { |
| 471 | "schema": { |
| 472 | "$ref": "#/components/schemas/UserEncoded", |
| 473 | }, |
| 474 | }, |
| 475 | }, |
| 476 | "description": "Some description for User", |
| 477 | }, |
| 478 | "400": { |
| 479 | "content": { |
| 480 | "application/json": { |
| 481 | "schema": { |
| 482 | "$ref": "#/components/schemas/UserErrorEncoded", |
| 483 | }, |
| 484 | }, |
| 485 | }, |
| 486 | "description": "UserError", |
| 487 | }, |
| 488 | }, |
| 489 | "security": [ |
| 490 | { |
| 491 | "cookie": [], |
| 492 | }, |
| 493 | ], |
| 494 | "tags": [ |
| 495 | "Users API", |
| 496 | ], |
| 497 | }, |
| 498 | }, |
| 499 | "/users/upload/{0}": { |
| 500 | "post": { |
| 501 | "operationId": "users.upload", |
| 502 | "parameters": [ |
| 503 | { |
| 504 | "in": "path", |
| 505 | "name": "0", |
| 506 | "required": true, |
| 507 | "schema": { |
| 508 | "anyOf": [ |
| 509 | { |
| 510 | "type": "string", |
| 511 | }, |
| 512 | { |
| 513 | "type": "null", |
| 514 | }, |
| 515 | ], |
| 516 | }, |
| 517 | }, |
| 518 | ], |
| 519 | "requestBody": { |
| 520 | "content": { |
| 521 | "multipart/form-data": { |
| 522 | "schema": { |
| 523 | "additionalProperties": false, |
| 524 | "properties": { |
| 525 | "file": { |
| 526 | "format": "binary", |
| 527 | "type": "string", |
| 528 | }, |
| 529 | }, |
| 530 | "required": [ |
| 531 | "file", |
| 532 | ], |
| 533 | "type": "object", |
| 534 | }, |
| 535 | }, |
| 536 | }, |
| 537 | "required": true, |
| 538 | }, |
| 539 | "responses": { |
| 540 | "200": { |
| 541 | "content": { |
| 542 | "application/json": { |
| 543 | "schema": { |
| 544 | "additionalProperties": false, |
| 545 | "properties": { |
| 546 | "contentType": { |
| 547 | "type": "string", |
| 548 | }, |
| 549 | "length": { |
| 550 | "type": "integer", |
| 551 | }, |
| 552 | }, |
| 553 | "required": [ |
| 554 | "contentType", |
| 555 | "length", |
| 556 | ], |
| 557 | "type": "object", |
| 558 | }, |
| 559 | }, |
| 560 | }, |
| 561 | "description": "Success", |
| 562 | }, |
| 563 | }, |
| 564 | "security": [ |
| 565 | { |
| 566 | "cookie": [], |
| 567 | }, |
| 568 | ], |
| 569 | "tags": [ |
| 570 | "Users API", |
| 571 | ], |
| 572 | }, |
| 573 | }, |
| 574 | "/users/uploadstream": { |
| 575 | "post": { |
| 576 | "operationId": "users.uploadStream", |
| 577 | "parameters": [], |
| 578 | "requestBody": { |
| 579 | "content": { |
| 580 | "multipart/form-data": { |
| 581 | "schema": { |
| 582 | "additionalProperties": false, |
| 583 | "properties": { |
| 584 | "file": { |
| 585 | "format": "binary", |
| 586 | "type": "string", |
| 587 | }, |
| 588 | }, |
| 589 | "required": [ |
| 590 | "file", |
| 591 | ], |
| 592 | "type": "object", |
| 593 | }, |
| 594 | }, |
| 595 | }, |
| 596 | "required": true, |
| 597 | }, |
| 598 | "responses": { |
| 599 | "200": { |
| 600 | "content": { |
| 601 | "application/json": { |
| 602 | "schema": { |
| 603 | "additionalProperties": false, |
| 604 | "properties": { |
| 605 | "contentType": { |
| 606 | "type": "string", |
| 607 | }, |
| 608 | "length": { |
| 609 | "type": "integer", |
| 610 | }, |
| 611 | }, |
| 612 | "required": [ |
| 613 | "contentType", |
| 614 | "length", |
| 615 | ], |
| 616 | "type": "object", |
| 617 | }, |
| 618 | }, |
| 619 | }, |
| 620 | "description": "Success", |
| 621 | }, |
| 622 | }, |
| 623 | "security": [ |
| 624 | { |
| 625 | "cookie": [], |
| 626 | }, |
| 627 | ], |
| 628 | "tags": [ |
| 629 | "Users API", |
| 630 | ], |
| 631 | }, |
| 632 | }, |
| 633 | "/users/{id}": { |
| 634 | "get": { |
| 635 | "operationId": "users.findById", |
| 636 | "parameters": [ |
| 637 | { |
| 638 | "in": "path", |
| 639 | "name": "id", |
| 640 | "required": true, |
| 641 | "schema": { |
| 642 | "pattern": "^[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?$", |
| 643 | "type": "string", |
| 644 | }, |
| 645 | }, |
| 646 | ], |
| 647 | "responses": { |
| 648 | "200": { |
| 649 | "content": { |
| 650 | "application/json": { |
| 651 | "schema": { |
| 652 | "$ref": "#/components/schemas/UserEncoded", |
| 653 | }, |
| 654 | }, |
| 655 | }, |
| 656 | "description": "Some description for User", |
| 657 | }, |
| 658 | "400": { |
| 659 | "content": { |
| 660 | "application/json": { |
| 661 | "schema": { |
| 662 | "$ref": "#/components/schemas/UserErrorEncoded", |
| 663 | }, |
| 664 | }, |
| 665 | }, |
| 666 | "description": "UserError", |
| 667 | }, |
| 668 | }, |
| 669 | "security": [ |
| 670 | { |
| 671 | "cookie": [], |
| 672 | }, |
| 673 | ], |
| 674 | "tags": [ |
| 675 | "Users API", |
| 676 | ], |
| 677 | }, |
| 678 | }, |
| 679 | }, |
| 680 | "security": [], |
| 681 | "tags": [ |
| 682 | { |
| 683 | "name": "groups", |
| 684 | }, |
| 685 | { |
| 686 | "name": "Users API", |
| 687 | }, |
| 688 | { |
| 689 | "name": "root", |
| 690 | }, |
| 691 | { |
| 692 | "name": "Tag from OpenApi.Transform annotation", |
| 693 | }, |
| 694 | ], |
| 695 | } |
| 696 | `; |