fork of hey-api/openapi-ts because I need some additional things
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #734 from hey-api/fix/types-export-service-types

fix: generate service types when types are enabled, even if services are disabled

authored by

Lubos and committed by
GitHub
0a314083 099fb26e

+3210 -885
+5
.changeset/great-planets-kick.md
··· 1 + --- 2 + '@hey-api/openapi-ts': patch 3 + --- 4 + 5 + fix: generate service types when types are enabled, even if services are disabled
+1 -3
packages/openapi-ts/src/utils/write/types.ts
··· 528 528 processModel({ client, model, onNode }); 529 529 } 530 530 531 - if (files.services && client.services.length) { 532 - processServiceTypes({ client, onNode }); 533 - } 531 + processServiceTypes({ client, onNode }); 534 532 };
+774
packages/openapi-ts/test/__snapshots__/test/generated/v3_date/types.gen.ts.snap
··· 13 13 patternWithSingleQuotes?: string; 14 14 patternWithNewline?: string; 15 15 patternWithBacktick?: string; 16 + }; 17 + 18 + export type PostServiceWithEmptyTagData = { 19 + requestBody: ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly; 20 + }; 21 + 22 + export type PostServiceWithEmptyTagResponse = ModelWithReadOnlyAndWriteOnly; 23 + 24 + export type ApiVversionOdataControllerCountResponse = Model_From_Zendesk; 25 + 26 + export type DeleteFooData = { 27 + /** 28 + * bar in method 29 + */ 30 + barParam: string; 31 + /** 32 + * foo in method 33 + */ 34 + fooParam: string; 35 + /** 36 + * Parameter with illegal characters 37 + */ 38 + xFooBar: ModelWithString; 39 + }; 40 + 41 + export type CallWithDescriptionsData = { 42 + /** 43 + * Testing backticks in string: `backticks` and ```multiple backticks``` should work 44 + */ 45 + parameterWithBackticks?: unknown; 46 + /** 47 + * Testing multiline comments in string: First line 48 + * Second line 49 + * 50 + * Fourth line 51 + */ 52 + parameterWithBreaks?: unknown; 53 + /** 54 + * Testing expression placeholders in string: ${expression} should work 55 + */ 56 + parameterWithExpressionPlaceholders?: unknown; 57 + /** 58 + * Testing quotes in string: 'single quote''' and "double quotes""" should work 59 + */ 60 + parameterWithQuotes?: unknown; 61 + /** 62 + * Testing reserved characters in string: * inline * and ** inline ** should work 63 + */ 64 + parameterWithReservedCharacters?: unknown; 65 + /** 66 + * Testing slashes in string: \backwards\\\ and /forwards/// should work 67 + */ 68 + parameterWithSlashes?: unknown; 69 + }; 70 + 71 + export type DeprecatedCallData = { 72 + /** 73 + * This parameter is deprecated 74 + * @deprecated 75 + */ 76 + parameter: DeprecatedModel | null; 77 + }; 78 + 79 + export type CallWithParametersData = { 80 + fooAllOfEnum: ModelWithNestedArrayEnumsDataFoo; 81 + fooRefEnum?: ModelWithNestedArrayEnumsDataFoo; 82 + /** 83 + * This is the parameter that goes into the cookie 84 + */ 85 + parameterCookie: string | null; 86 + /** 87 + * This is the parameter that goes into the form data 88 + */ 89 + parameterForm: string | null; 90 + /** 91 + * This is the parameter that goes into the header 92 + */ 93 + parameterHeader: string | null; 94 + /** 95 + * This is the parameter that goes into the path 96 + */ 97 + parameterPath: string | null; 98 + /** 99 + * This is the parameter that goes into the query params 100 + */ 101 + parameterQuery: string | null; 102 + /** 103 + * This is the parameter that goes into the body 104 + */ 105 + requestBody: ModelWithString | null; 106 + }; 107 + 108 + export type CallWithWeirdParameterNamesData = { 109 + /** 110 + * This is the parameter with a reserved keyword 111 + */ 112 + _default?: string; 113 + /** 114 + * This is the parameter that goes into the cookie 115 + */ 116 + parameterCookie: string | null; 117 + /** 118 + * This is the parameter that goes into the request form data 119 + */ 120 + parameterForm: string | null; 121 + /** 122 + * This is the parameter that goes into the request header 123 + */ 124 + parameterHeader: string | null; 125 + /** 126 + * This is the parameter that goes into the path 127 + */ 128 + parameterPath1?: string; 129 + /** 130 + * This is the parameter that goes into the path 131 + */ 132 + parameterPath2?: string; 133 + /** 134 + * This is the parameter that goes into the path 135 + */ 136 + parameterPath3?: string; 137 + /** 138 + * This is the parameter that goes into the request query params 139 + */ 140 + parameterQuery: string | null; 141 + /** 142 + * This is the parameter that goes into the body 143 + */ 144 + requestBody: ModelWithString | null; 145 + }; 146 + 147 + export type GetCallWithOptionalParamData = { 148 + /** 149 + * This is an optional parameter 150 + */ 151 + parameter?: string; 152 + /** 153 + * This is a required parameter 154 + */ 155 + requestBody: ModelWithOneOfEnum; 156 + }; 157 + 158 + export type PostCallWithOptionalParamData = { 159 + /** 160 + * This is a required parameter 161 + */ 162 + parameter: Pageable; 163 + /** 164 + * This is an optional parameter 165 + */ 166 + requestBody?: ModelWithString; 167 + }; 168 + 169 + export type PostApiRequestBodyData = { 170 + /** 171 + * A reusable request body 172 + */ 173 + foo?: ModelWithString; 174 + /** 175 + * This is a reusable parameter 176 + */ 177 + parameter?: string; 178 + }; 179 + 180 + export type PostApiFormDataData = { 181 + /** 182 + * A reusable request body 183 + */ 184 + formData?: ModelWithString; 185 + /** 186 + * This is a reusable parameter 187 + */ 188 + parameter?: string; 189 + }; 190 + 191 + export type CallWithDefaultParametersData = { 192 + /** 193 + * This is a simple boolean with default value 194 + */ 195 + parameterBoolean?: boolean | null; 196 + /** 197 + * This is a simple enum with default value 198 + */ 199 + parameterEnum?: 'Success' | 'Warning' | 'Error'; 200 + /** 201 + * This is a simple model with default value 202 + */ 203 + parameterModel?: ModelWithString | null; 204 + /** 205 + * This is a simple number with default value 206 + */ 207 + parameterNumber?: number | null; 208 + /** 209 + * This is a simple string with default value 210 + */ 211 + parameterString?: string | null; 212 + }; 213 + 214 + export type CallWithDefaultOptionalParametersData = { 215 + /** 216 + * This is a simple boolean that is optional with default value 217 + */ 218 + parameterBoolean?: boolean; 219 + /** 220 + * This is a simple enum that is optional with default value 221 + */ 222 + parameterEnum?: 'Success' | 'Warning' | 'Error'; 223 + /** 224 + * This is a simple model that is optional with default value 225 + */ 226 + parameterModel?: ModelWithString; 227 + /** 228 + * This is a simple number that is optional with default value 229 + */ 230 + parameterNumber?: number; 231 + /** 232 + * This is a simple string that is optional with default value 233 + */ 234 + parameterString?: string; 235 + }; 236 + 237 + export type CallToTestOrderOfParamsData = { 238 + /** 239 + * This is a optional string with default 240 + */ 241 + parameterOptionalStringWithDefault?: string; 242 + /** 243 + * This is a optional string with empty default 244 + */ 245 + parameterOptionalStringWithEmptyDefault?: string; 246 + /** 247 + * This is a optional string with no default 248 + */ 249 + parameterOptionalStringWithNoDefault?: string; 250 + /** 251 + * This is a string that can be null with default 252 + */ 253 + parameterStringNullableWithDefault?: string | null; 254 + /** 255 + * This is a string that can be null with no default 256 + */ 257 + parameterStringNullableWithNoDefault?: string | null; 258 + /** 259 + * This is a string with default 260 + */ 261 + parameterStringWithDefault: string; 262 + /** 263 + * This is a string with empty default 264 + */ 265 + parameterStringWithEmptyDefault: string; 266 + /** 267 + * This is a string with no default 268 + */ 269 + parameterStringWithNoDefault: string; 270 + }; 271 + 272 + export type CallWithNoContentResponseResponse = void; 273 + 274 + export type CallWithResponseAndNoContentResponseResponse = number | void; 275 + 276 + export type DummyAResponse = void; 277 + 278 + export type DummyBResponse = void; 279 + 280 + export type CallWithResponseResponse = ModelWithString; 281 + 282 + export type CallWithDuplicateResponsesResponse = ModelWithBoolean & ModelWithInteger | ModelWithString; 283 + 284 + export type CallWithResponsesResponse = { 285 + readonly '@namespace.string'?: string; 286 + readonly '@namespace.integer'?: number; 287 + readonly value?: Array<ModelWithString>; 288 + } | ModelThatExtends | ModelThatExtendsExtends; 289 + 290 + export type CollectionFormatData = { 291 + /** 292 + * This is an array parameter that is sent as csv format (comma-separated values) 293 + */ 294 + parameterArrayCsv: Array<(string)> | null; 295 + /** 296 + * This is an array parameter that is sent as multi format (multiple parameter instances) 297 + */ 298 + parameterArrayMulti: Array<(string)> | null; 299 + /** 300 + * This is an array parameter that is sent as pipes format (pipe-separated values) 301 + */ 302 + parameterArrayPipes: Array<(string)> | null; 303 + /** 304 + * This is an array parameter that is sent as ssv format (space-separated values) 305 + */ 306 + parameterArraySsv: Array<(string)> | null; 307 + /** 308 + * This is an array parameter that is sent as tsv format (tab-separated values) 309 + */ 310 + parameterArrayTsv: Array<(string)> | null; 311 + }; 312 + 313 + export type TypesData = { 314 + /** 315 + * This is a number parameter 316 + */ 317 + id?: number; 318 + /** 319 + * This is an array parameter 320 + */ 321 + parameterArray: Array<(string)> | null; 322 + /** 323 + * This is a boolean parameter 324 + */ 325 + parameterBoolean: boolean | null; 326 + /** 327 + * This is a dictionary parameter 328 + */ 329 + parameterDictionary: { 330 + [key: string]: unknown; 331 + } | null; 332 + /** 333 + * This is an enum parameter 334 + */ 335 + parameterEnum: 'Success' | 'Warning' | 'Error' | null; 336 + /** 337 + * This is a number parameter 338 + */ 339 + parameterNumber: number; 340 + /** 341 + * This is an object parameter 342 + */ 343 + parameterObject: { 344 + [key: string]: unknown; 345 + } | null; 346 + /** 347 + * This is a string parameter 348 + */ 349 + parameterString: string | null; 350 + }; 351 + 352 + export type TypesResponse = number | string | boolean | { 353 + [key: string]: unknown; 354 + }; 355 + 356 + export type UploadFileData = { 357 + /** 358 + * Supply a file reference for upload 359 + */ 360 + file: (Blob | File); 361 + }; 362 + 363 + export type UploadFileResponse = boolean; 364 + 365 + export type FileResponseData = { 366 + id: string; 367 + }; 368 + 369 + export type FileResponseResponse = (Blob | File); 370 + 371 + export type ComplexTypesData = { 372 + /** 373 + * Parameter containing object 374 + */ 375 + parameterObject: { 376 + first?: { 377 + second?: { 378 + third?: string; 379 + }; 380 + }; 381 + }; 382 + /** 383 + * Parameter containing reference 384 + */ 385 + parameterReference: ModelWithString; 386 + }; 387 + 388 + export type ComplexTypesResponse = Array<ModelWithString>; 389 + 390 + export type MultipartRequestData = { 391 + formData?: { 392 + content?: (Blob | File); 393 + data?: ModelWithString | null; 394 + }; 395 + }; 396 + 397 + export type MultipartResponseResponse = { 398 + file?: (Blob | File); 399 + metadata?: { 400 + foo?: string; 401 + bar?: string; 402 + }; 403 + }; 404 + 405 + export type ComplexParamsData = { 406 + id: number; 407 + requestBody?: { 408 + readonly key: string | null; 409 + name: string | null; 410 + enabled?: boolean; 411 + readonly type: 'Monkey' | 'Horse' | 'Bird'; 412 + listOfModels?: Array<ModelWithString> | null; 413 + listOfStrings?: Array<(string)> | null; 414 + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; 415 + readonly user?: { 416 + readonly id?: number; 417 + readonly name?: string | null; 418 + }; 419 + }; 420 + }; 421 + 422 + export type ComplexParamsResponse = ModelWithString; 423 + 424 + export type CallWithResultFromHeaderResponse = string; 425 + 426 + export type TestErrorCodeData = { 427 + /** 428 + * Status code to return 429 + */ 430 + status: number; 431 + }; 432 + 433 + export type TestErrorCodeResponse = unknown; 434 + 435 + export type NonAsciiæøåÆøÅöôêÊ字符串Data = { 436 + /** 437 + * Dummy input param 438 + */ 439 + nonAsciiParamæøåÆøÅöôêÊ: number; 440 + }; 441 + 442 + export type NonAsciiæøåÆøÅöôêÊ字符串Response = Array<NonAsciiStringæøåÆØÅöôêÊ字符串>; 443 + 444 + export type $OpenApiTs = { 445 + '/api/v{api-version}/no-tag': { 446 + post: { 447 + req: PostServiceWithEmptyTagData; 448 + res: { 449 + default: ModelWithReadOnlyAndWriteOnly; 450 + }; 451 + }; 452 + }; 453 + '/api/v{api-version}/simple/$count': { 454 + get: { 455 + res: { 456 + /** 457 + * Success 458 + */ 459 + 200: Model_From_Zendesk; 460 + }; 461 + }; 462 + }; 463 + '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}': { 464 + delete: { 465 + req: DeleteFooData; 466 + }; 467 + }; 468 + '/api/v{api-version}/descriptions/': { 469 + post: { 470 + req: CallWithDescriptionsData; 471 + }; 472 + }; 473 + '/api/v{api-version}/parameters/deprecated': { 474 + post: { 475 + req: DeprecatedCallData; 476 + }; 477 + }; 478 + '/api/v{api-version}/parameters/{parameterPath}': { 479 + post: { 480 + req: CallWithParametersData; 481 + }; 482 + }; 483 + '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}': { 484 + post: { 485 + req: CallWithWeirdParameterNamesData; 486 + }; 487 + }; 488 + '/api/v{api-version}/parameters/': { 489 + get: { 490 + req: GetCallWithOptionalParamData; 491 + }; 492 + post: { 493 + req: PostCallWithOptionalParamData; 494 + }; 495 + }; 496 + '/api/v{api-version}/requestBody/': { 497 + post: { 498 + req: PostApiRequestBodyData; 499 + }; 500 + }; 501 + '/api/v{api-version}/formData/': { 502 + post: { 503 + req: PostApiFormDataData; 504 + }; 505 + }; 506 + '/api/v{api-version}/defaults': { 507 + get: { 508 + req: CallWithDefaultParametersData; 509 + }; 510 + post: { 511 + req: CallWithDefaultOptionalParametersData; 512 + }; 513 + put: { 514 + req: CallToTestOrderOfParamsData; 515 + }; 516 + }; 517 + '/api/v{api-version}/no-content': { 518 + get: { 519 + res: { 520 + /** 521 + * Success 522 + */ 523 + 204: void; 524 + }; 525 + }; 526 + }; 527 + '/api/v{api-version}/multiple-tags/response-and-no-content': { 528 + get: { 529 + res: { 530 + /** 531 + * Response is a simple number 532 + */ 533 + 200: number; 534 + /** 535 + * Success 536 + */ 537 + 204: void; 538 + }; 539 + }; 540 + }; 541 + '/api/v{api-version}/multiple-tags/a': { 542 + get: { 543 + res: { 544 + /** 545 + * Success 546 + */ 547 + 204: void; 548 + }; 549 + }; 550 + }; 551 + '/api/v{api-version}/multiple-tags/b': { 552 + get: { 553 + res: { 554 + /** 555 + * Success 556 + */ 557 + 204: void; 558 + }; 559 + }; 560 + }; 561 + '/api/v{api-version}/response': { 562 + get: { 563 + res: { 564 + default: ModelWithString; 565 + }; 566 + }; 567 + post: { 568 + res: { 569 + /** 570 + * Message for 200 response 571 + */ 572 + 200: ModelWithBoolean & ModelWithInteger; 573 + /** 574 + * Message for 201 response 575 + */ 576 + 201: ModelWithString; 577 + /** 578 + * Message for 500 error 579 + */ 580 + 500: ModelWithStringError; 581 + /** 582 + * Message for 501 error 583 + */ 584 + 501: ModelWithStringError; 585 + /** 586 + * Message for 502 error 587 + */ 588 + 502: ModelWithStringError; 589 + /** 590 + * Message for 4XX errors 591 + */ 592 + '4XX': DictionaryWithArray; 593 + /** 594 + * Message for default response 595 + */ 596 + default: ModelWithBoolean; 597 + }; 598 + }; 599 + put: { 600 + res: { 601 + /** 602 + * Message for 200 response 603 + */ 604 + 200: { 605 + readonly '@namespace.string'?: string; 606 + readonly '@namespace.integer'?: number; 607 + readonly value?: Array<ModelWithString>; 608 + }; 609 + /** 610 + * Message for 201 response 611 + */ 612 + 201: ModelThatExtends; 613 + /** 614 + * Message for 202 response 615 + */ 616 + 202: ModelThatExtendsExtends; 617 + /** 618 + * Message for 500 error 619 + */ 620 + 500: ModelWithStringError; 621 + /** 622 + * Message for 501 error 623 + */ 624 + 501: ModelWithStringError; 625 + /** 626 + * Message for 502 error 627 + */ 628 + 502: ModelWithStringError; 629 + /** 630 + * Message for default response 631 + */ 632 + default: ModelWithString; 633 + }; 634 + }; 635 + }; 636 + '/api/v{api-version}/collectionFormat': { 637 + get: { 638 + req: CollectionFormatData; 639 + }; 640 + }; 641 + '/api/v{api-version}/types': { 642 + get: { 643 + req: TypesData; 644 + res: { 645 + /** 646 + * Response is a simple number 647 + */ 648 + 200: number; 649 + /** 650 + * Response is a simple string 651 + */ 652 + 201: string; 653 + /** 654 + * Response is a simple boolean 655 + */ 656 + 202: boolean; 657 + /** 658 + * Response is a simple object 659 + */ 660 + 203: { 661 + [key: string]: unknown; 662 + }; 663 + }; 664 + }; 665 + }; 666 + '/api/v{api-version}/upload': { 667 + post: { 668 + req: UploadFileData; 669 + res: { 670 + 200: boolean; 671 + }; 672 + }; 673 + }; 674 + '/api/v{api-version}/file/{id}': { 675 + get: { 676 + req: FileResponseData; 677 + res: { 678 + /** 679 + * Success 680 + */ 681 + 200: (Blob | File); 682 + }; 683 + }; 684 + }; 685 + '/api/v{api-version}/complex': { 686 + get: { 687 + req: ComplexTypesData; 688 + res: { 689 + /** 690 + * Successful response 691 + */ 692 + 200: Array<ModelWithString>; 693 + /** 694 + * 400 `server` error 695 + */ 696 + 400: unknown; 697 + /** 698 + * 500 server error 699 + */ 700 + 500: unknown; 701 + }; 702 + }; 703 + }; 704 + '/api/v{api-version}/multipart': { 705 + post: { 706 + req: MultipartRequestData; 707 + }; 708 + get: { 709 + res: { 710 + /** 711 + * OK 712 + */ 713 + 200: { 714 + file?: (Blob | File); 715 + metadata?: { 716 + foo?: string; 717 + bar?: string; 718 + }; 719 + }; 720 + }; 721 + }; 722 + }; 723 + '/api/v{api-version}/complex/{id}': { 724 + put: { 725 + req: ComplexParamsData; 726 + res: { 727 + /** 728 + * Success 729 + */ 730 + 200: ModelWithString; 731 + }; 732 + }; 733 + }; 734 + '/api/v{api-version}/header': { 735 + post: { 736 + res: { 737 + /** 738 + * Successful response 739 + */ 740 + 200: string; 741 + /** 742 + * 400 server error 743 + */ 744 + 400: unknown; 745 + /** 746 + * 500 server error 747 + */ 748 + 500: unknown; 749 + }; 750 + }; 751 + }; 752 + '/api/v{api-version}/error': { 753 + post: { 754 + req: TestErrorCodeData; 755 + res: { 756 + /** 757 + * Custom message: Successful response 758 + */ 759 + 200: unknown; 760 + /** 761 + * Custom message: Internal Server Error 762 + */ 763 + 500: unknown; 764 + /** 765 + * Custom message: Not Implemented 766 + */ 767 + 501: unknown; 768 + /** 769 + * Custom message: Bad Gateway 770 + */ 771 + 502: unknown; 772 + /** 773 + * Custom message: Service Unavailable 774 + */ 775 + 503: unknown; 776 + }; 777 + }; 778 + }; 779 + '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串': { 780 + post: { 781 + req: NonAsciiæøåÆøÅöôêÊ字符串Data; 782 + res: { 783 + /** 784 + * Successful response 785 + */ 786 + 200: Array<NonAsciiStringæøåÆØÅöôêÊ字符串>; 787 + }; 788 + }; 789 + }; 16 790 };
packages/openapi-ts/test/__snapshots__/test/generated/v3_models/index.ts.snap packages/openapi-ts/test/__snapshots__/test/generated/v3_types/index.ts.snap
-871
packages/openapi-ts/test/__snapshots__/test/generated/v3_models/types.gen.ts.snap
··· 1 - // This file is auto-generated by @hey-api/openapi-ts 2 - 3 - /** 4 - * Testing multiline comments in string: First line 5 - * Second line 6 - * 7 - * Fourth line 8 - */ 9 - export type camelCaseCommentWithBreaks = number; 10 - 11 - /** 12 - * Testing multiline comments in string: First line 13 - * Second line 14 - * 15 - * Fourth line 16 - */ 17 - export type CommentWithBreaks = number; 18 - 19 - /** 20 - * Testing backticks in string: `backticks` and ```multiple backticks``` should work 21 - */ 22 - export type CommentWithBackticks = number; 23 - 24 - /** 25 - * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work 26 - */ 27 - export type CommentWithBackticksAndQuotes = number; 28 - 29 - /** 30 - * Testing slashes in string: \backwards\\\ and /forwards/// should work 31 - */ 32 - export type CommentWithSlashes = number; 33 - 34 - /** 35 - * Testing expression placeholders in string: ${expression} should work 36 - */ 37 - export type CommentWithExpressionPlaceholders = number; 38 - 39 - /** 40 - * Testing quotes in string: 'single quote''' and "double quotes""" should work 41 - */ 42 - export type CommentWithQuotes = number; 43 - 44 - /** 45 - * Testing reserved characters in string: * inline * and ** inline ** should work 46 - */ 47 - export type CommentWithReservedCharacters = number; 48 - 49 - /** 50 - * This is a simple number 51 - */ 52 - export type SimpleInteger = number; 53 - 54 - /** 55 - * This is a simple boolean 56 - */ 57 - export type SimpleBoolean = boolean; 58 - 59 - /** 60 - * This is a simple string 61 - */ 62 - export type SimpleString = string; 63 - 64 - /** 65 - * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) 66 - */ 67 - export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; 68 - 69 - /** 70 - * This is a simple file 71 - */ 72 - export type SimpleFile = (Blob | File); 73 - 74 - /** 75 - * This is a simple reference 76 - */ 77 - export type SimpleReference = ModelWithString; 78 - 79 - /** 80 - * This is a simple string 81 - */ 82 - export type SimpleStringWithPattern = string | null; 83 - 84 - /** 85 - * This is a simple enum with strings 86 - */ 87 - export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; 88 - 89 - export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; 90 - 91 - /** 92 - * This is a simple enum with numbers 93 - */ 94 - export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; 95 - 96 - /** 97 - * Success=1,Warning=2,Error=3 98 - */ 99 - export type EnumFromDescription = number; 100 - 101 - /** 102 - * This is a simple enum with numbers 103 - */ 104 - export type EnumWithExtensions = 200 | 400 | 500; 105 - 106 - export type EnumWithXEnumNames = 0 | 1 | 2; 107 - 108 - /** 109 - * This is a simple array with numbers 110 - */ 111 - export type ArrayWithNumbers = Array<(number)>; 112 - 113 - /** 114 - * This is a simple array with booleans 115 - */ 116 - export type ArrayWithBooleans = Array<(boolean)>; 117 - 118 - /** 119 - * This is a simple array with strings 120 - */ 121 - export type ArrayWithStrings = Array<(string)>; 122 - 123 - /** 124 - * This is a simple array with references 125 - */ 126 - export type ArrayWithReferences = Array<ModelWithString>; 127 - 128 - /** 129 - * This is a simple array containing an array 130 - */ 131 - export type ArrayWithArray = Array<Array<ModelWithString>>; 132 - 133 - /** 134 - * This is a simple array with properties 135 - */ 136 - export type ArrayWithProperties = Array<{ 137 - '16x16'?: camelCaseCommentWithBreaks; 138 - bar?: string; 139 - }>; 140 - 141 - /** 142 - * This is a simple array with any of properties 143 - */ 144 - export type ArrayWithAnyOfProperties = Array<({ 145 - foo?: string; 146 - } | { 147 - bar?: string; 148 - })>; 149 - 150 - export type AnyOfAnyAndNull = { 151 - data?: unknown | null; 152 - }; 153 - 154 - /** 155 - * This is a simple array with any of properties 156 - */ 157 - export type AnyOfArrays = { 158 - results?: Array<({ 159 - foo?: string; 160 - } | { 161 - bar?: string; 162 - })>; 163 - }; 164 - 165 - /** 166 - * This is a string dictionary 167 - */ 168 - export type DictionaryWithString = { 169 - [key: string]: (string); 170 - }; 171 - 172 - export type DictionaryWithPropertiesAndAdditionalProperties = { 173 - foo?: number; 174 - bar?: boolean; 175 - [key: string]: (string | number | boolean) | undefined; 176 - }; 177 - 178 - /** 179 - * This is a string reference 180 - */ 181 - export type DictionaryWithReference = { 182 - [key: string]: ModelWithString; 183 - }; 184 - 185 - /** 186 - * This is a complex dictionary 187 - */ 188 - export type DictionaryWithArray = { 189 - [key: string]: Array<ModelWithString>; 190 - }; 191 - 192 - /** 193 - * This is a string dictionary 194 - */ 195 - export type DictionaryWithDictionary = { 196 - [key: string]: { 197 - [key: string]: (string); 198 - }; 199 - }; 200 - 201 - /** 202 - * This is a complex dictionary 203 - */ 204 - export type DictionaryWithProperties = { 205 - [key: string]: { 206 - foo?: string; 207 - bar?: string; 208 - }; 209 - }; 210 - 211 - /** 212 - * This is a model with one number property 213 - */ 214 - export type ModelWithInteger = { 215 - /** 216 - * This is a simple number property 217 - */ 218 - prop?: number; 219 - }; 220 - 221 - /** 222 - * This is a model with one boolean property 223 - */ 224 - export type ModelWithBoolean = { 225 - /** 226 - * This is a simple boolean property 227 - */ 228 - prop?: boolean; 229 - }; 230 - 231 - /** 232 - * This is a model with one string property 233 - */ 234 - export type ModelWithString = { 235 - /** 236 - * This is a simple string property 237 - */ 238 - prop?: string; 239 - }; 240 - 241 - /** 242 - * This is a model with one string property 243 - */ 244 - export type ModelWithStringError = { 245 - /** 246 - * This is a simple string property 247 - */ 248 - prop?: string; 249 - }; 250 - 251 - /** 252 - * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) 253 - */ 254 - export type Model_From_Zendesk = string; 255 - 256 - /** 257 - * This is a model with one string property 258 - */ 259 - export type ModelWithNullableString = { 260 - /** 261 - * This is a simple string property 262 - */ 263 - nullableProp1?: string | null; 264 - /** 265 - * This is a simple string property 266 - */ 267 - nullableRequiredProp1: string | null; 268 - /** 269 - * This is a simple string property 270 - */ 271 - nullableProp2?: string | null; 272 - /** 273 - * This is a simple string property 274 - */ 275 - nullableRequiredProp2: string | null; 276 - /** 277 - * This is a simple enum with strings 278 - */ 279 - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; 280 - }; 281 - 282 - /** 283 - * This is a simple enum with strings 284 - */ 285 - export type foo_bar_enum = 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; 286 - 287 - /** 288 - * This is a model with one enum 289 - */ 290 - export type ModelWithEnum = { 291 - /** 292 - * This is a simple enum with strings 293 - */ 294 - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; 295 - /** 296 - * These are the HTTP error code enums 297 - */ 298 - statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; 299 - /** 300 - * Simple boolean enum 301 - */ 302 - bool?: boolean; 303 - }; 304 - 305 - /** 306 - * These are the HTTP error code enums 307 - */ 308 - export type statusCode = '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; 309 - 310 - /** 311 - * This is a model with one enum with escaped name 312 - */ 313 - export type ModelWithEnumWithHyphen = { 314 - 'foo-bar-baz-qux'?: '3.0'; 315 - }; 316 - 317 - export type foo_bar_baz_qux = '3.0'; 318 - 319 - /** 320 - * This is a model with one enum 321 - */ 322 - export type ModelWithEnumFromDescription = { 323 - /** 324 - * Success=1,Warning=2,Error=3 325 - */ 326 - test?: number; 327 - }; 328 - 329 - /** 330 - * This is a model with nested enums 331 - */ 332 - export type ModelWithNestedEnums = { 333 - dictionaryWithEnum?: { 334 - [key: string]: ('Success' | 'Warning' | 'Error'); 335 - }; 336 - dictionaryWithEnumFromDescription?: { 337 - [key: string]: (number); 338 - }; 339 - arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; 340 - arrayWithDescription?: Array<(number)>; 341 - /** 342 - * This is a simple enum with strings 343 - */ 344 - 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; 345 - }; 346 - 347 - /** 348 - * This is a model with one property containing a reference 349 - */ 350 - export type ModelWithReference = { 351 - prop?: ModelWithProperties; 352 - }; 353 - 354 - /** 355 - * This is a model with one property containing an array 356 - */ 357 - export type ModelWithArrayReadOnlyAndWriteOnly = { 358 - prop?: Array<ModelWithReadOnlyAndWriteOnly>; 359 - propWithFile?: Array<((Blob | File))>; 360 - propWithNumber?: Array<(number)>; 361 - }; 362 - 363 - /** 364 - * This is a model with one property containing an array 365 - */ 366 - export type ModelWithArray = { 367 - prop?: Array<ModelWithString>; 368 - propWithFile?: Array<((Blob | File))>; 369 - propWithNumber?: Array<(number)>; 370 - }; 371 - 372 - /** 373 - * This is a model with one property containing a dictionary 374 - */ 375 - export type ModelWithDictionary = { 376 - prop?: { 377 - [key: string]: (string); 378 - }; 379 - }; 380 - 381 - /** 382 - * This is a deprecated model with a deprecated property 383 - * @deprecated 384 - */ 385 - export type DeprecatedModel = { 386 - /** 387 - * This is a deprecated property 388 - * @deprecated 389 - */ 390 - prop?: string; 391 - }; 392 - 393 - /** 394 - * This is a model with one property containing a circular reference 395 - */ 396 - export type ModelWithCircularReference = { 397 - prop?: ModelWithCircularReference; 398 - }; 399 - 400 - /** 401 - * This is a model with one property with a 'one of' relationship 402 - */ 403 - export type CompositionWithOneOf = { 404 - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; 405 - }; 406 - 407 - /** 408 - * This is a model with one property with a 'one of' relationship where the options are not $ref 409 - */ 410 - export type CompositionWithOneOfAnonymous = { 411 - propA?: { 412 - propA?: string; 413 - } | string | number; 414 - }; 415 - 416 - /** 417 - * Circle 418 - */ 419 - export type ModelCircle = { 420 - kind: 'circle'; 421 - radius?: number; 422 - }; 423 - 424 - /** 425 - * Square 426 - */ 427 - export type ModelSquare = { 428 - kind: 'square'; 429 - sideLength?: number; 430 - }; 431 - 432 - /** 433 - * This is a model with one property with a 'one of' relationship where the options are not $ref 434 - */ 435 - export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; 436 - 437 - /** 438 - * This is a model with one property with a 'any of' relationship 439 - */ 440 - export type CompositionWithAnyOf = { 441 - propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; 442 - }; 443 - 444 - /** 445 - * This is a model with one property with a 'any of' relationship where the options are not $ref 446 - */ 447 - export type CompositionWithAnyOfAnonymous = { 448 - propA?: { 449 - propA?: string; 450 - } | string | number; 451 - }; 452 - 453 - /** 454 - * This is a model with nested 'any of' property with a type null 455 - */ 456 - export type CompositionWithNestedAnyAndTypeNull = { 457 - propA?: Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>; 458 - }; 459 - 460 - export type e_num_1Период = 'Bird' | 'Dog'; 461 - 462 - export type ConstValue = "ConstValue"; 463 - 464 - /** 465 - * This is a model with one property with a 'any of' relationship where the options are not $ref 466 - */ 467 - export type CompositionWithNestedAnyOfAndNull = { 468 - propA?: Array<(e_num_1Период | ConstValue)> | null; 469 - }; 470 - 471 - /** 472 - * This is a model with one property with a 'one of' relationship 473 - */ 474 - export type CompositionWithOneOfAndNullable = { 475 - propA?: { 476 - boolean?: boolean; 477 - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; 478 - }; 479 - 480 - /** 481 - * This is a model that contains a simple dictionary within composition 482 - */ 483 - export type CompositionWithOneOfAndSimpleDictionary = { 484 - propA?: boolean | { 485 - [key: string]: (number); 486 - }; 487 - }; 488 - 489 - /** 490 - * This is a model that contains a dictionary of simple arrays within composition 491 - */ 492 - export type CompositionWithOneOfAndSimpleArrayDictionary = { 493 - propA?: boolean | { 494 - [key: string]: Array<(boolean)>; 495 - }; 496 - }; 497 - 498 - /** 499 - * This is a model that contains a dictionary of complex arrays (composited) within composition 500 - */ 501 - export type CompositionWithOneOfAndComplexArrayDictionary = { 502 - propA?: boolean | { 503 - [key: string]: Array<(number | string)>; 504 - }; 505 - }; 506 - 507 - /** 508 - * This is a model with one property with a 'all of' relationship 509 - */ 510 - export type CompositionWithAllOfAndNullable = { 511 - propA?: ({ 512 - boolean?: boolean; 513 - } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; 514 - }; 515 - 516 - /** 517 - * This is a model with one property with a 'any of' relationship 518 - */ 519 - export type CompositionWithAnyOfAndNullable = { 520 - propA?: { 521 - boolean?: boolean; 522 - } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; 523 - }; 524 - 525 - /** 526 - * This is a base model with two simple optional properties 527 - */ 528 - export type CompositionBaseModel = { 529 - firstName?: string; 530 - lastname?: string; 531 - }; 532 - 533 - /** 534 - * This is a model that extends the base model 535 - */ 536 - export type CompositionExtendedModel = CompositionBaseModel & { 537 - firstName: string; 538 - lastname: string; 539 - age: number; 540 - }; 541 - 542 - /** 543 - * This is a model with one nested property 544 - */ 545 - export type ModelWithProperties = { 546 - required: string; 547 - readonly requiredAndReadOnly: string; 548 - requiredAndNullable: string | null; 549 - string?: string; 550 - number?: number; 551 - boolean?: boolean; 552 - reference?: ModelWithString; 553 - 'property with space'?: string; 554 - default?: string; 555 - try?: string; 556 - readonly '@namespace.string'?: string; 557 - readonly '@namespace.integer'?: number; 558 - }; 559 - 560 - /** 561 - * This is a model with one nested property 562 - */ 563 - export type ModelWithNestedProperties = { 564 - readonly first: { 565 - readonly second: { 566 - readonly third: string | null; 567 - } | null; 568 - } | null; 569 - }; 570 - 571 - /** 572 - * This is a model with duplicated properties 573 - */ 574 - export type ModelWithDuplicateProperties = { 575 - prop?: ModelWithString; 576 - }; 577 - 578 - /** 579 - * This is a model with ordered properties 580 - */ 581 - export type ModelWithOrderedProperties = { 582 - zebra?: string; 583 - apple?: string; 584 - hawaii?: string; 585 - }; 586 - 587 - /** 588 - * This is a model with duplicated imports 589 - */ 590 - export type ModelWithDuplicateImports = { 591 - propA?: ModelWithString; 592 - propB?: ModelWithString; 593 - propC?: ModelWithString; 594 - }; 595 - 596 - /** 597 - * This is a model that extends another model 598 - */ 599 - export type ModelThatExtends = ModelWithString & { 600 - propExtendsA?: string; 601 - propExtendsB?: ModelWithString; 602 - }; 603 - 604 - /** 605 - * This is a model that extends another model 606 - */ 607 - export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { 608 - propExtendsC?: string; 609 - propExtendsD?: ModelWithString; 610 - }; 611 - 612 - /** 613 - * This is a model that contains a some patterns 614 - */ 615 - export type ModelWithPattern = { 616 - key: string; 617 - name: string; 618 - readonly enabled?: boolean; 619 - readonly modified?: string; 620 - id?: string; 621 - text?: string; 622 - patternWithSingleQuotes?: string; 623 - patternWithNewline?: string; 624 - patternWithBacktick?: string; 625 - }; 626 - 627 - export type File = { 628 - readonly id?: string; 629 - readonly updated_at?: string; 630 - readonly created_at?: string; 631 - mime: string; 632 - readonly file?: string; 633 - }; 634 - 635 - export type _default = { 636 - name?: string; 637 - }; 638 - 639 - export type Pageable = { 640 - page?: number; 641 - size?: number; 642 - sort?: Array<(string)>; 643 - }; 644 - 645 - /** 646 - * This is a free-form object without additionalProperties. 647 - */ 648 - export type FreeFormObjectWithoutAdditionalProperties = { 649 - [key: string]: unknown; 650 - }; 651 - 652 - /** 653 - * This is a free-form object with additionalProperties: true. 654 - */ 655 - export type FreeFormObjectWithAdditionalPropertiesEqTrue = { 656 - [key: string]: unknown; 657 - }; 658 - 659 - /** 660 - * This is a free-form object with additionalProperties: {}. 661 - */ 662 - export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { 663 - [key: string]: unknown; 664 - }; 665 - 666 - export type ModelWithConst = { 667 - String?: "String"; 668 - number?: 0; 669 - null?: null; 670 - withType?: "Some string"; 671 - }; 672 - 673 - /** 674 - * This is a model with one property and additionalProperties: true 675 - */ 676 - export type ModelWithAdditionalPropertiesEqTrue = { 677 - /** 678 - * This is a simple string property 679 - */ 680 - prop?: string; 681 - [key: string]: unknown | string; 682 - }; 683 - 684 - export type NestedAnyOfArraysNullable = { 685 - nullableArray?: Array<(string | boolean)> | null; 686 - }; 687 - 688 - export type CompositionWithOneOfAndProperties = { 689 - foo: ParameterSimpleParameter; 690 - baz: number | null; 691 - qux: number; 692 - } | { 693 - bar: NonAsciiStringæøåÆØÅöôêÊ字符串; 694 - baz: number | null; 695 - qux: number; 696 - }; 697 - 698 - /** 699 - * An object that can be null 700 - */ 701 - export type NullableObject = { 702 - foo?: string; 703 - } | null; 704 - 705 - /** 706 - * Some % character 707 - */ 708 - export type CharactersInDescription = string; 709 - 710 - export type ModelWithNullableObject = { 711 - data?: NullableObject; 712 - }; 713 - 714 - export type ModelWithOneOfEnum = { 715 - foo: 'Bar'; 716 - } | { 717 - foo: 'Baz'; 718 - } | { 719 - foo: 'Qux'; 720 - } | { 721 - content: string; 722 - foo: 'Quux'; 723 - } | { 724 - content: [ 725 - string, 726 - string 727 - ]; 728 - foo: 'Corge'; 729 - }; 730 - 731 - export type foo = 'Bar'; 732 - 733 - export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; 734 - 735 - export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; 736 - 737 - export type ModelWithNestedArrayEnumsData = { 738 - foo?: Array<ModelWithNestedArrayEnumsDataFoo>; 739 - bar?: Array<ModelWithNestedArrayEnumsDataBar>; 740 - }; 741 - 742 - export type ModelWithNestedArrayEnums = { 743 - array_strings?: Array<(string)>; 744 - data?: ModelWithNestedArrayEnumsData; 745 - }; 746 - 747 - export type ModelWithNestedCompositionEnums = { 748 - foo?: ModelWithNestedArrayEnumsDataFoo; 749 - }; 750 - 751 - export type ModelWithReadOnlyAndWriteOnly = { 752 - foo: string; 753 - readonly bar: string; 754 - baz: string; 755 - }; 756 - 757 - export type ModelWithConstantSizeArray = [ 758 - number, 759 - number 760 - ]; 761 - 762 - export type ModelWithAnyOfConstantSizeArray = [ 763 - number | string, 764 - number | string, 765 - number | string 766 - ]; 767 - 768 - export type ModelWithPrefixItemsConstantSizeArray = [ 769 - ModelWithInteger, 770 - number | string, 771 - string 772 - ]; 773 - 774 - export type ModelWithAnyOfConstantSizeArrayNullable = [ 775 - number | null | string, 776 - number | null | string, 777 - number | null | string 778 - ]; 779 - 780 - export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ 781 - number | string, 782 - number | string 783 - ]; 784 - 785 - export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ 786 - number & string, 787 - number & string 788 - ]; 789 - 790 - export type ModelWithNumericEnumUnion = { 791 - /** 792 - * Период 793 - */ 794 - value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; 795 - }; 796 - 797 - /** 798 - * Период 799 - */ 800 - export type value = -10 | -1 | 0 | 1 | 3 | 6 | 12; 801 - 802 - /** 803 - * Some description with `back ticks` 804 - */ 805 - export type ModelWithBackticksInDescription = { 806 - /** 807 - * The template `that` should be used for parsing and importing the contents of the CSV file. 808 - * 809 - * <br/><p>There is one placeholder currently supported:<ul> <li><b>${x}</b> - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)</li></ul><p>Example of a correct JSON template:</p> 810 - * <pre> 811 - * [ 812 - * { 813 - * "resourceType": "Asset", 814 - * "identifier": { 815 - * "name": "${1}", 816 - * "domain": { 817 - * "name": "${2}", 818 - * "community": { 819 - * "name": "Some Community" 820 - * } 821 - * } 822 - * }, 823 - * "attributes" : { 824 - * "00000000-0000-0000-0000-000000003115" : [ { 825 - * "value" : "${3}" 826 - * } ], 827 - * "00000000-0000-0000-0000-000000000222" : [ { 828 - * "value" : "${4}" 829 - * } ] 830 - * } 831 - * } 832 - * ] 833 - * </pre> 834 - */ 835 - template?: string; 836 - }; 837 - 838 - /** 839 - * Model used to test deduplication strategy (unused) 840 - */ 841 - export type ParameterSimpleParameterUnused = string; 842 - 843 - /** 844 - * Model used to test deduplication strategy 845 - */ 846 - export type PostServiceWithEmptyTagResponse = string; 847 - 848 - /** 849 - * Model used to test deduplication strategy 850 - */ 851 - export type PostServiceWithEmptyTagResponse2 = string; 852 - 853 - /** 854 - * Model used to test deduplication strategy 855 - */ 856 - export type DeleteFooData = string; 857 - 858 - /** 859 - * Model used to test deduplication strategy 860 - */ 861 - export type DeleteFooData2 = string; 862 - 863 - /** 864 - * This is a reusable parameter 865 - */ 866 - export type ParameterSimpleParameter = string; 867 - 868 - /** 869 - * Parameter with illegal characters 870 - */ 871 - export type Parameterx_Foo_Bar = ModelWithString;
+775 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3_pascalcase/types.gen.ts.snap
··· 14 14 export type ArrayWithProperties = Array<{ 15 15 '16x16'?: CamelCaseCommentWithBreaks; 16 16 bar?: string; 17 - }>; 17 + }>; 18 + 19 + export type PostServiceWithEmptyTagData = { 20 + requestBody: ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly; 21 + }; 22 + 23 + export type PostServiceWithEmptyTagResponse = ModelWithReadOnlyAndWriteOnly; 24 + 25 + export type ApiVversionOdataControllerCountResponse = ModelFromZendesk; 26 + 27 + export type DeleteFooData = { 28 + /** 29 + * bar in method 30 + */ 31 + barParam: string; 32 + /** 33 + * foo in method 34 + */ 35 + fooParam: string; 36 + /** 37 + * Parameter with illegal characters 38 + */ 39 + xFooBar: ModelWithString; 40 + }; 41 + 42 + export type CallWithDescriptionsData = { 43 + /** 44 + * Testing backticks in string: `backticks` and ```multiple backticks``` should work 45 + */ 46 + parameterWithBackticks?: unknown; 47 + /** 48 + * Testing multiline comments in string: First line 49 + * Second line 50 + * 51 + * Fourth line 52 + */ 53 + parameterWithBreaks?: unknown; 54 + /** 55 + * Testing expression placeholders in string: ${expression} should work 56 + */ 57 + parameterWithExpressionPlaceholders?: unknown; 58 + /** 59 + * Testing quotes in string: 'single quote''' and "double quotes""" should work 60 + */ 61 + parameterWithQuotes?: unknown; 62 + /** 63 + * Testing reserved characters in string: * inline * and ** inline ** should work 64 + */ 65 + parameterWithReservedCharacters?: unknown; 66 + /** 67 + * Testing slashes in string: \backwards\\\ and /forwards/// should work 68 + */ 69 + parameterWithSlashes?: unknown; 70 + }; 71 + 72 + export type DeprecatedCallData = { 73 + /** 74 + * This parameter is deprecated 75 + * @deprecated 76 + */ 77 + parameter: DeprecatedModel | null; 78 + }; 79 + 80 + export type CallWithParametersData = { 81 + fooAllOfEnum: ModelWithNestedArrayEnumsDataFoo; 82 + fooRefEnum?: ModelWithNestedArrayEnumsDataFoo; 83 + /** 84 + * This is the parameter that goes into the cookie 85 + */ 86 + parameterCookie: string | null; 87 + /** 88 + * This is the parameter that goes into the form data 89 + */ 90 + parameterForm: string | null; 91 + /** 92 + * This is the parameter that goes into the header 93 + */ 94 + parameterHeader: string | null; 95 + /** 96 + * This is the parameter that goes into the path 97 + */ 98 + parameterPath: string | null; 99 + /** 100 + * This is the parameter that goes into the query params 101 + */ 102 + parameterQuery: string | null; 103 + /** 104 + * This is the parameter that goes into the body 105 + */ 106 + requestBody: ModelWithString | null; 107 + }; 108 + 109 + export type CallWithWeirdParameterNamesData = { 110 + /** 111 + * This is the parameter with a reserved keyword 112 + */ 113 + _default?: string; 114 + /** 115 + * This is the parameter that goes into the cookie 116 + */ 117 + parameterCookie: string | null; 118 + /** 119 + * This is the parameter that goes into the request form data 120 + */ 121 + parameterForm: string | null; 122 + /** 123 + * This is the parameter that goes into the request header 124 + */ 125 + parameterHeader: string | null; 126 + /** 127 + * This is the parameter that goes into the path 128 + */ 129 + parameterPath1?: string; 130 + /** 131 + * This is the parameter that goes into the path 132 + */ 133 + parameterPath2?: string; 134 + /** 135 + * This is the parameter that goes into the path 136 + */ 137 + parameterPath3?: string; 138 + /** 139 + * This is the parameter that goes into the request query params 140 + */ 141 + parameterQuery: string | null; 142 + /** 143 + * This is the parameter that goes into the body 144 + */ 145 + requestBody: ModelWithString | null; 146 + }; 147 + 148 + export type GetCallWithOptionalParamData = { 149 + /** 150 + * This is an optional parameter 151 + */ 152 + parameter?: string; 153 + /** 154 + * This is a required parameter 155 + */ 156 + requestBody: ModelWithOneOfEnum; 157 + }; 158 + 159 + export type PostCallWithOptionalParamData = { 160 + /** 161 + * This is a required parameter 162 + */ 163 + parameter: Pageable; 164 + /** 165 + * This is an optional parameter 166 + */ 167 + requestBody?: ModelWithString; 168 + }; 169 + 170 + export type PostApiRequestBodyData = { 171 + /** 172 + * A reusable request body 173 + */ 174 + foo?: ModelWithString; 175 + /** 176 + * This is a reusable parameter 177 + */ 178 + parameter?: string; 179 + }; 180 + 181 + export type PostApiFormDataData = { 182 + /** 183 + * A reusable request body 184 + */ 185 + formData?: ModelWithString; 186 + /** 187 + * This is a reusable parameter 188 + */ 189 + parameter?: string; 190 + }; 191 + 192 + export type CallWithDefaultParametersData = { 193 + /** 194 + * This is a simple boolean with default value 195 + */ 196 + parameterBoolean?: boolean | null; 197 + /** 198 + * This is a simple enum with default value 199 + */ 200 + parameterEnum?: 'Success' | 'Warning' | 'Error'; 201 + /** 202 + * This is a simple model with default value 203 + */ 204 + parameterModel?: ModelWithString | null; 205 + /** 206 + * This is a simple number with default value 207 + */ 208 + parameterNumber?: number | null; 209 + /** 210 + * This is a simple string with default value 211 + */ 212 + parameterString?: string | null; 213 + }; 214 + 215 + export type CallWithDefaultOptionalParametersData = { 216 + /** 217 + * This is a simple boolean that is optional with default value 218 + */ 219 + parameterBoolean?: boolean; 220 + /** 221 + * This is a simple enum that is optional with default value 222 + */ 223 + parameterEnum?: 'Success' | 'Warning' | 'Error'; 224 + /** 225 + * This is a simple model that is optional with default value 226 + */ 227 + parameterModel?: ModelWithString; 228 + /** 229 + * This is a simple number that is optional with default value 230 + */ 231 + parameterNumber?: number; 232 + /** 233 + * This is a simple string that is optional with default value 234 + */ 235 + parameterString?: string; 236 + }; 237 + 238 + export type CallToTestOrderOfParamsData = { 239 + /** 240 + * This is a optional string with default 241 + */ 242 + parameterOptionalStringWithDefault?: string; 243 + /** 244 + * This is a optional string with empty default 245 + */ 246 + parameterOptionalStringWithEmptyDefault?: string; 247 + /** 248 + * This is a optional string with no default 249 + */ 250 + parameterOptionalStringWithNoDefault?: string; 251 + /** 252 + * This is a string that can be null with default 253 + */ 254 + parameterStringNullableWithDefault?: string | null; 255 + /** 256 + * This is a string that can be null with no default 257 + */ 258 + parameterStringNullableWithNoDefault?: string | null; 259 + /** 260 + * This is a string with default 261 + */ 262 + parameterStringWithDefault: string; 263 + /** 264 + * This is a string with empty default 265 + */ 266 + parameterStringWithEmptyDefault: string; 267 + /** 268 + * This is a string with no default 269 + */ 270 + parameterStringWithNoDefault: string; 271 + }; 272 + 273 + export type CallWithNoContentResponseResponse = void; 274 + 275 + export type CallWithResponseAndNoContentResponseResponse = number | void; 276 + 277 + export type DummyAResponse = void; 278 + 279 + export type DummyBResponse = void; 280 + 281 + export type CallWithResponseResponse = ModelWithString; 282 + 283 + export type CallWithDuplicateResponsesResponse = ModelWithBoolean & ModelWithInteger | ModelWithString; 284 + 285 + export type CallWithResponsesResponse = { 286 + readonly '@namespace.string'?: string; 287 + readonly '@namespace.integer'?: number; 288 + readonly value?: Array<ModelWithString>; 289 + } | ModelThatExtends | ModelThatExtendsExtends; 290 + 291 + export type CollectionFormatData = { 292 + /** 293 + * This is an array parameter that is sent as csv format (comma-separated values) 294 + */ 295 + parameterArrayCsv: Array<(string)> | null; 296 + /** 297 + * This is an array parameter that is sent as multi format (multiple parameter instances) 298 + */ 299 + parameterArrayMulti: Array<(string)> | null; 300 + /** 301 + * This is an array parameter that is sent as pipes format (pipe-separated values) 302 + */ 303 + parameterArrayPipes: Array<(string)> | null; 304 + /** 305 + * This is an array parameter that is sent as ssv format (space-separated values) 306 + */ 307 + parameterArraySsv: Array<(string)> | null; 308 + /** 309 + * This is an array parameter that is sent as tsv format (tab-separated values) 310 + */ 311 + parameterArrayTsv: Array<(string)> | null; 312 + }; 313 + 314 + export type TypesData = { 315 + /** 316 + * This is a number parameter 317 + */ 318 + id?: number; 319 + /** 320 + * This is an array parameter 321 + */ 322 + parameterArray: Array<(string)> | null; 323 + /** 324 + * This is a boolean parameter 325 + */ 326 + parameterBoolean: boolean | null; 327 + /** 328 + * This is a dictionary parameter 329 + */ 330 + parameterDictionary: { 331 + [key: string]: unknown; 332 + } | null; 333 + /** 334 + * This is an enum parameter 335 + */ 336 + parameterEnum: 'Success' | 'Warning' | 'Error' | null; 337 + /** 338 + * This is a number parameter 339 + */ 340 + parameterNumber: number; 341 + /** 342 + * This is an object parameter 343 + */ 344 + parameterObject: { 345 + [key: string]: unknown; 346 + } | null; 347 + /** 348 + * This is a string parameter 349 + */ 350 + parameterString: string | null; 351 + }; 352 + 353 + export type TypesResponse = number | string | boolean | { 354 + [key: string]: unknown; 355 + }; 356 + 357 + export type UploadFileData = { 358 + /** 359 + * Supply a file reference for upload 360 + */ 361 + file: (Blob | File); 362 + }; 363 + 364 + export type UploadFileResponse = boolean; 365 + 366 + export type FileResponseData = { 367 + id: string; 368 + }; 369 + 370 + export type FileResponseResponse = (Blob | File); 371 + 372 + export type ComplexTypesData = { 373 + /** 374 + * Parameter containing object 375 + */ 376 + parameterObject: { 377 + first?: { 378 + second?: { 379 + third?: string; 380 + }; 381 + }; 382 + }; 383 + /** 384 + * Parameter containing reference 385 + */ 386 + parameterReference: ModelWithString; 387 + }; 388 + 389 + export type ComplexTypesResponse = Array<ModelWithString>; 390 + 391 + export type MultipartRequestData = { 392 + formData?: { 393 + content?: (Blob | File); 394 + data?: ModelWithString | null; 395 + }; 396 + }; 397 + 398 + export type MultipartResponseResponse = { 399 + file?: (Blob | File); 400 + metadata?: { 401 + foo?: string; 402 + bar?: string; 403 + }; 404 + }; 405 + 406 + export type ComplexParamsData = { 407 + id: number; 408 + requestBody?: { 409 + readonly key: string | null; 410 + name: string | null; 411 + enabled?: boolean; 412 + readonly type: 'Monkey' | 'Horse' | 'Bird'; 413 + listOfModels?: Array<ModelWithString> | null; 414 + listOfStrings?: Array<(string)> | null; 415 + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; 416 + readonly user?: { 417 + readonly id?: number; 418 + readonly name?: string | null; 419 + }; 420 + }; 421 + }; 422 + 423 + export type ComplexParamsResponse = ModelWithString; 424 + 425 + export type CallWithResultFromHeaderResponse = string; 426 + 427 + export type TestErrorCodeData = { 428 + /** 429 + * Status code to return 430 + */ 431 + status: number; 432 + }; 433 + 434 + export type TestErrorCodeResponse = unknown; 435 + 436 + export type NonAsciiæøåÆøÅöôêÊ字符串Data = { 437 + /** 438 + * Dummy input param 439 + */ 440 + nonAsciiParamæøåÆøÅöôêÊ: number; 441 + }; 442 + 443 + export type NonAsciiæøåÆøÅöôêÊ字符串Response = Array<NonAsciiStringæøåÆøÅöôêÊ字符串>; 444 + 445 + export type $OpenApiTs = { 446 + '/api/v{api-version}/no-tag': { 447 + post: { 448 + req: PostServiceWithEmptyTagData; 449 + res: { 450 + default: ModelWithReadOnlyAndWriteOnly; 451 + }; 452 + }; 453 + }; 454 + '/api/v{api-version}/simple/$count': { 455 + get: { 456 + res: { 457 + /** 458 + * Success 459 + */ 460 + 200: ModelFromZendesk; 461 + }; 462 + }; 463 + }; 464 + '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}': { 465 + delete: { 466 + req: DeleteFooData; 467 + }; 468 + }; 469 + '/api/v{api-version}/descriptions/': { 470 + post: { 471 + req: CallWithDescriptionsData; 472 + }; 473 + }; 474 + '/api/v{api-version}/parameters/deprecated': { 475 + post: { 476 + req: DeprecatedCallData; 477 + }; 478 + }; 479 + '/api/v{api-version}/parameters/{parameterPath}': { 480 + post: { 481 + req: CallWithParametersData; 482 + }; 483 + }; 484 + '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}': { 485 + post: { 486 + req: CallWithWeirdParameterNamesData; 487 + }; 488 + }; 489 + '/api/v{api-version}/parameters/': { 490 + get: { 491 + req: GetCallWithOptionalParamData; 492 + }; 493 + post: { 494 + req: PostCallWithOptionalParamData; 495 + }; 496 + }; 497 + '/api/v{api-version}/requestBody/': { 498 + post: { 499 + req: PostApiRequestBodyData; 500 + }; 501 + }; 502 + '/api/v{api-version}/formData/': { 503 + post: { 504 + req: PostApiFormDataData; 505 + }; 506 + }; 507 + '/api/v{api-version}/defaults': { 508 + get: { 509 + req: CallWithDefaultParametersData; 510 + }; 511 + post: { 512 + req: CallWithDefaultOptionalParametersData; 513 + }; 514 + put: { 515 + req: CallToTestOrderOfParamsData; 516 + }; 517 + }; 518 + '/api/v{api-version}/no-content': { 519 + get: { 520 + res: { 521 + /** 522 + * Success 523 + */ 524 + 204: void; 525 + }; 526 + }; 527 + }; 528 + '/api/v{api-version}/multiple-tags/response-and-no-content': { 529 + get: { 530 + res: { 531 + /** 532 + * Response is a simple number 533 + */ 534 + 200: number; 535 + /** 536 + * Success 537 + */ 538 + 204: void; 539 + }; 540 + }; 541 + }; 542 + '/api/v{api-version}/multiple-tags/a': { 543 + get: { 544 + res: { 545 + /** 546 + * Success 547 + */ 548 + 204: void; 549 + }; 550 + }; 551 + }; 552 + '/api/v{api-version}/multiple-tags/b': { 553 + get: { 554 + res: { 555 + /** 556 + * Success 557 + */ 558 + 204: void; 559 + }; 560 + }; 561 + }; 562 + '/api/v{api-version}/response': { 563 + get: { 564 + res: { 565 + default: ModelWithString; 566 + }; 567 + }; 568 + post: { 569 + res: { 570 + /** 571 + * Message for 200 response 572 + */ 573 + 200: ModelWithBoolean & ModelWithInteger; 574 + /** 575 + * Message for 201 response 576 + */ 577 + 201: ModelWithString; 578 + /** 579 + * Message for 500 error 580 + */ 581 + 500: ModelWithStringError; 582 + /** 583 + * Message for 501 error 584 + */ 585 + 501: ModelWithStringError; 586 + /** 587 + * Message for 502 error 588 + */ 589 + 502: ModelWithStringError; 590 + /** 591 + * Message for 4XX errors 592 + */ 593 + '4XX': DictionaryWithArray; 594 + /** 595 + * Message for default response 596 + */ 597 + default: ModelWithBoolean; 598 + }; 599 + }; 600 + put: { 601 + res: { 602 + /** 603 + * Message for 200 response 604 + */ 605 + 200: { 606 + readonly '@namespace.string'?: string; 607 + readonly '@namespace.integer'?: number; 608 + readonly value?: Array<ModelWithString>; 609 + }; 610 + /** 611 + * Message for 201 response 612 + */ 613 + 201: ModelThatExtends; 614 + /** 615 + * Message for 202 response 616 + */ 617 + 202: ModelThatExtendsExtends; 618 + /** 619 + * Message for 500 error 620 + */ 621 + 500: ModelWithStringError; 622 + /** 623 + * Message for 501 error 624 + */ 625 + 501: ModelWithStringError; 626 + /** 627 + * Message for 502 error 628 + */ 629 + 502: ModelWithStringError; 630 + /** 631 + * Message for default response 632 + */ 633 + default: ModelWithString; 634 + }; 635 + }; 636 + }; 637 + '/api/v{api-version}/collectionFormat': { 638 + get: { 639 + req: CollectionFormatData; 640 + }; 641 + }; 642 + '/api/v{api-version}/types': { 643 + get: { 644 + req: TypesData; 645 + res: { 646 + /** 647 + * Response is a simple number 648 + */ 649 + 200: number; 650 + /** 651 + * Response is a simple string 652 + */ 653 + 201: string; 654 + /** 655 + * Response is a simple boolean 656 + */ 657 + 202: boolean; 658 + /** 659 + * Response is a simple object 660 + */ 661 + 203: { 662 + [key: string]: unknown; 663 + }; 664 + }; 665 + }; 666 + }; 667 + '/api/v{api-version}/upload': { 668 + post: { 669 + req: UploadFileData; 670 + res: { 671 + 200: boolean; 672 + }; 673 + }; 674 + }; 675 + '/api/v{api-version}/file/{id}': { 676 + get: { 677 + req: FileResponseData; 678 + res: { 679 + /** 680 + * Success 681 + */ 682 + 200: (Blob | File); 683 + }; 684 + }; 685 + }; 686 + '/api/v{api-version}/complex': { 687 + get: { 688 + req: ComplexTypesData; 689 + res: { 690 + /** 691 + * Successful response 692 + */ 693 + 200: Array<ModelWithString>; 694 + /** 695 + * 400 `server` error 696 + */ 697 + 400: unknown; 698 + /** 699 + * 500 server error 700 + */ 701 + 500: unknown; 702 + }; 703 + }; 704 + }; 705 + '/api/v{api-version}/multipart': { 706 + post: { 707 + req: MultipartRequestData; 708 + }; 709 + get: { 710 + res: { 711 + /** 712 + * OK 713 + */ 714 + 200: { 715 + file?: (Blob | File); 716 + metadata?: { 717 + foo?: string; 718 + bar?: string; 719 + }; 720 + }; 721 + }; 722 + }; 723 + }; 724 + '/api/v{api-version}/complex/{id}': { 725 + put: { 726 + req: ComplexParamsData; 727 + res: { 728 + /** 729 + * Success 730 + */ 731 + 200: ModelWithString; 732 + }; 733 + }; 734 + }; 735 + '/api/v{api-version}/header': { 736 + post: { 737 + res: { 738 + /** 739 + * Successful response 740 + */ 741 + 200: string; 742 + /** 743 + * 400 server error 744 + */ 745 + 400: unknown; 746 + /** 747 + * 500 server error 748 + */ 749 + 500: unknown; 750 + }; 751 + }; 752 + }; 753 + '/api/v{api-version}/error': { 754 + post: { 755 + req: TestErrorCodeData; 756 + res: { 757 + /** 758 + * Custom message: Successful response 759 + */ 760 + 200: unknown; 761 + /** 762 + * Custom message: Internal Server Error 763 + */ 764 + 500: unknown; 765 + /** 766 + * Custom message: Not Implemented 767 + */ 768 + 501: unknown; 769 + /** 770 + * Custom message: Bad Gateway 771 + */ 772 + 502: unknown; 773 + /** 774 + * Custom message: Service Unavailable 775 + */ 776 + 503: unknown; 777 + }; 778 + }; 779 + }; 780 + '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串': { 781 + post: { 782 + req: NonAsciiæøåÆøÅöôêÊ字符串Data; 783 + res: { 784 + /** 785 + * Successful response 786 + */ 787 + 200: Array<NonAsciiStringæøåÆøÅöôêÊ字符串>; 788 + }; 789 + }; 790 + }; 791 + };
+1645
packages/openapi-ts/test/__snapshots__/test/generated/v3_types/types.gen.ts.snap
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + /** 4 + * Testing multiline comments in string: First line 5 + * Second line 6 + * 7 + * Fourth line 8 + */ 9 + export type camelCaseCommentWithBreaks = number; 10 + 11 + /** 12 + * Testing multiline comments in string: First line 13 + * Second line 14 + * 15 + * Fourth line 16 + */ 17 + export type CommentWithBreaks = number; 18 + 19 + /** 20 + * Testing backticks in string: `backticks` and ```multiple backticks``` should work 21 + */ 22 + export type CommentWithBackticks = number; 23 + 24 + /** 25 + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work 26 + */ 27 + export type CommentWithBackticksAndQuotes = number; 28 + 29 + /** 30 + * Testing slashes in string: \backwards\\\ and /forwards/// should work 31 + */ 32 + export type CommentWithSlashes = number; 33 + 34 + /** 35 + * Testing expression placeholders in string: ${expression} should work 36 + */ 37 + export type CommentWithExpressionPlaceholders = number; 38 + 39 + /** 40 + * Testing quotes in string: 'single quote''' and "double quotes""" should work 41 + */ 42 + export type CommentWithQuotes = number; 43 + 44 + /** 45 + * Testing reserved characters in string: * inline * and ** inline ** should work 46 + */ 47 + export type CommentWithReservedCharacters = number; 48 + 49 + /** 50 + * This is a simple number 51 + */ 52 + export type SimpleInteger = number; 53 + 54 + /** 55 + * This is a simple boolean 56 + */ 57 + export type SimpleBoolean = boolean; 58 + 59 + /** 60 + * This is a simple string 61 + */ 62 + export type SimpleString = string; 63 + 64 + /** 65 + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) 66 + */ 67 + export type NonAsciiStringæøåÆØÅöôêÊ字符串 = string; 68 + 69 + /** 70 + * This is a simple file 71 + */ 72 + export type SimpleFile = (Blob | File); 73 + 74 + /** 75 + * This is a simple reference 76 + */ 77 + export type SimpleReference = ModelWithString; 78 + 79 + /** 80 + * This is a simple string 81 + */ 82 + export type SimpleStringWithPattern = string | null; 83 + 84 + /** 85 + * This is a simple enum with strings 86 + */ 87 + export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; 88 + 89 + export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; 90 + 91 + /** 92 + * This is a simple enum with numbers 93 + */ 94 + export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; 95 + 96 + /** 97 + * Success=1,Warning=2,Error=3 98 + */ 99 + export type EnumFromDescription = number; 100 + 101 + /** 102 + * This is a simple enum with numbers 103 + */ 104 + export type EnumWithExtensions = 200 | 400 | 500; 105 + 106 + export type EnumWithXEnumNames = 0 | 1 | 2; 107 + 108 + /** 109 + * This is a simple array with numbers 110 + */ 111 + export type ArrayWithNumbers = Array<(number)>; 112 + 113 + /** 114 + * This is a simple array with booleans 115 + */ 116 + export type ArrayWithBooleans = Array<(boolean)>; 117 + 118 + /** 119 + * This is a simple array with strings 120 + */ 121 + export type ArrayWithStrings = Array<(string)>; 122 + 123 + /** 124 + * This is a simple array with references 125 + */ 126 + export type ArrayWithReferences = Array<ModelWithString>; 127 + 128 + /** 129 + * This is a simple array containing an array 130 + */ 131 + export type ArrayWithArray = Array<Array<ModelWithString>>; 132 + 133 + /** 134 + * This is a simple array with properties 135 + */ 136 + export type ArrayWithProperties = Array<{ 137 + '16x16'?: camelCaseCommentWithBreaks; 138 + bar?: string; 139 + }>; 140 + 141 + /** 142 + * This is a simple array with any of properties 143 + */ 144 + export type ArrayWithAnyOfProperties = Array<({ 145 + foo?: string; 146 + } | { 147 + bar?: string; 148 + })>; 149 + 150 + export type AnyOfAnyAndNull = { 151 + data?: unknown | null; 152 + }; 153 + 154 + /** 155 + * This is a simple array with any of properties 156 + */ 157 + export type AnyOfArrays = { 158 + results?: Array<({ 159 + foo?: string; 160 + } | { 161 + bar?: string; 162 + })>; 163 + }; 164 + 165 + /** 166 + * This is a string dictionary 167 + */ 168 + export type DictionaryWithString = { 169 + [key: string]: (string); 170 + }; 171 + 172 + export type DictionaryWithPropertiesAndAdditionalProperties = { 173 + foo?: number; 174 + bar?: boolean; 175 + [key: string]: (string | number | boolean) | undefined; 176 + }; 177 + 178 + /** 179 + * This is a string reference 180 + */ 181 + export type DictionaryWithReference = { 182 + [key: string]: ModelWithString; 183 + }; 184 + 185 + /** 186 + * This is a complex dictionary 187 + */ 188 + export type DictionaryWithArray = { 189 + [key: string]: Array<ModelWithString>; 190 + }; 191 + 192 + /** 193 + * This is a string dictionary 194 + */ 195 + export type DictionaryWithDictionary = { 196 + [key: string]: { 197 + [key: string]: (string); 198 + }; 199 + }; 200 + 201 + /** 202 + * This is a complex dictionary 203 + */ 204 + export type DictionaryWithProperties = { 205 + [key: string]: { 206 + foo?: string; 207 + bar?: string; 208 + }; 209 + }; 210 + 211 + /** 212 + * This is a model with one number property 213 + */ 214 + export type ModelWithInteger = { 215 + /** 216 + * This is a simple number property 217 + */ 218 + prop?: number; 219 + }; 220 + 221 + /** 222 + * This is a model with one boolean property 223 + */ 224 + export type ModelWithBoolean = { 225 + /** 226 + * This is a simple boolean property 227 + */ 228 + prop?: boolean; 229 + }; 230 + 231 + /** 232 + * This is a model with one string property 233 + */ 234 + export type ModelWithString = { 235 + /** 236 + * This is a simple string property 237 + */ 238 + prop?: string; 239 + }; 240 + 241 + /** 242 + * This is a model with one string property 243 + */ 244 + export type ModelWithStringError = { 245 + /** 246 + * This is a simple string property 247 + */ 248 + prop?: string; 249 + }; 250 + 251 + /** 252 + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) 253 + */ 254 + export type Model_From_Zendesk = string; 255 + 256 + /** 257 + * This is a model with one string property 258 + */ 259 + export type ModelWithNullableString = { 260 + /** 261 + * This is a simple string property 262 + */ 263 + nullableProp1?: string | null; 264 + /** 265 + * This is a simple string property 266 + */ 267 + nullableRequiredProp1: string | null; 268 + /** 269 + * This is a simple string property 270 + */ 271 + nullableProp2?: string | null; 272 + /** 273 + * This is a simple string property 274 + */ 275 + nullableRequiredProp2: string | null; 276 + /** 277 + * This is a simple enum with strings 278 + */ 279 + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; 280 + }; 281 + 282 + /** 283 + * This is a simple enum with strings 284 + */ 285 + export type foo_bar_enum = 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; 286 + 287 + /** 288 + * This is a model with one enum 289 + */ 290 + export type ModelWithEnum = { 291 + /** 292 + * This is a simple enum with strings 293 + */ 294 + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; 295 + /** 296 + * These are the HTTP error code enums 297 + */ 298 + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; 299 + /** 300 + * Simple boolean enum 301 + */ 302 + bool?: boolean; 303 + }; 304 + 305 + /** 306 + * These are the HTTP error code enums 307 + */ 308 + export type statusCode = '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; 309 + 310 + /** 311 + * This is a model with one enum with escaped name 312 + */ 313 + export type ModelWithEnumWithHyphen = { 314 + 'foo-bar-baz-qux'?: '3.0'; 315 + }; 316 + 317 + export type foo_bar_baz_qux = '3.0'; 318 + 319 + /** 320 + * This is a model with one enum 321 + */ 322 + export type ModelWithEnumFromDescription = { 323 + /** 324 + * Success=1,Warning=2,Error=3 325 + */ 326 + test?: number; 327 + }; 328 + 329 + /** 330 + * This is a model with nested enums 331 + */ 332 + export type ModelWithNestedEnums = { 333 + dictionaryWithEnum?: { 334 + [key: string]: ('Success' | 'Warning' | 'Error'); 335 + }; 336 + dictionaryWithEnumFromDescription?: { 337 + [key: string]: (number); 338 + }; 339 + arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; 340 + arrayWithDescription?: Array<(number)>; 341 + /** 342 + * This is a simple enum with strings 343 + */ 344 + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; 345 + }; 346 + 347 + /** 348 + * This is a model with one property containing a reference 349 + */ 350 + export type ModelWithReference = { 351 + prop?: ModelWithProperties; 352 + }; 353 + 354 + /** 355 + * This is a model with one property containing an array 356 + */ 357 + export type ModelWithArrayReadOnlyAndWriteOnly = { 358 + prop?: Array<ModelWithReadOnlyAndWriteOnly>; 359 + propWithFile?: Array<((Blob | File))>; 360 + propWithNumber?: Array<(number)>; 361 + }; 362 + 363 + /** 364 + * This is a model with one property containing an array 365 + */ 366 + export type ModelWithArray = { 367 + prop?: Array<ModelWithString>; 368 + propWithFile?: Array<((Blob | File))>; 369 + propWithNumber?: Array<(number)>; 370 + }; 371 + 372 + /** 373 + * This is a model with one property containing a dictionary 374 + */ 375 + export type ModelWithDictionary = { 376 + prop?: { 377 + [key: string]: (string); 378 + }; 379 + }; 380 + 381 + /** 382 + * This is a deprecated model with a deprecated property 383 + * @deprecated 384 + */ 385 + export type DeprecatedModel = { 386 + /** 387 + * This is a deprecated property 388 + * @deprecated 389 + */ 390 + prop?: string; 391 + }; 392 + 393 + /** 394 + * This is a model with one property containing a circular reference 395 + */ 396 + export type ModelWithCircularReference = { 397 + prop?: ModelWithCircularReference; 398 + }; 399 + 400 + /** 401 + * This is a model with one property with a 'one of' relationship 402 + */ 403 + export type CompositionWithOneOf = { 404 + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; 405 + }; 406 + 407 + /** 408 + * This is a model with one property with a 'one of' relationship where the options are not $ref 409 + */ 410 + export type CompositionWithOneOfAnonymous = { 411 + propA?: { 412 + propA?: string; 413 + } | string | number; 414 + }; 415 + 416 + /** 417 + * Circle 418 + */ 419 + export type ModelCircle = { 420 + kind: 'circle'; 421 + radius?: number; 422 + }; 423 + 424 + /** 425 + * Square 426 + */ 427 + export type ModelSquare = { 428 + kind: 'square'; 429 + sideLength?: number; 430 + }; 431 + 432 + /** 433 + * This is a model with one property with a 'one of' relationship where the options are not $ref 434 + */ 435 + export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; 436 + 437 + /** 438 + * This is a model with one property with a 'any of' relationship 439 + */ 440 + export type CompositionWithAnyOf = { 441 + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; 442 + }; 443 + 444 + /** 445 + * This is a model with one property with a 'any of' relationship where the options are not $ref 446 + */ 447 + export type CompositionWithAnyOfAnonymous = { 448 + propA?: { 449 + propA?: string; 450 + } | string | number; 451 + }; 452 + 453 + /** 454 + * This is a model with nested 'any of' property with a type null 455 + */ 456 + export type CompositionWithNestedAnyAndTypeNull = { 457 + propA?: Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>; 458 + }; 459 + 460 + export type e_num_1Период = 'Bird' | 'Dog'; 461 + 462 + export type ConstValue = "ConstValue"; 463 + 464 + /** 465 + * This is a model with one property with a 'any of' relationship where the options are not $ref 466 + */ 467 + export type CompositionWithNestedAnyOfAndNull = { 468 + propA?: Array<(e_num_1Период | ConstValue)> | null; 469 + }; 470 + 471 + /** 472 + * This is a model with one property with a 'one of' relationship 473 + */ 474 + export type CompositionWithOneOfAndNullable = { 475 + propA?: { 476 + boolean?: boolean; 477 + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; 478 + }; 479 + 480 + /** 481 + * This is a model that contains a simple dictionary within composition 482 + */ 483 + export type CompositionWithOneOfAndSimpleDictionary = { 484 + propA?: boolean | { 485 + [key: string]: (number); 486 + }; 487 + }; 488 + 489 + /** 490 + * This is a model that contains a dictionary of simple arrays within composition 491 + */ 492 + export type CompositionWithOneOfAndSimpleArrayDictionary = { 493 + propA?: boolean | { 494 + [key: string]: Array<(boolean)>; 495 + }; 496 + }; 497 + 498 + /** 499 + * This is a model that contains a dictionary of complex arrays (composited) within composition 500 + */ 501 + export type CompositionWithOneOfAndComplexArrayDictionary = { 502 + propA?: boolean | { 503 + [key: string]: Array<(number | string)>; 504 + }; 505 + }; 506 + 507 + /** 508 + * This is a model with one property with a 'all of' relationship 509 + */ 510 + export type CompositionWithAllOfAndNullable = { 511 + propA?: ({ 512 + boolean?: boolean; 513 + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; 514 + }; 515 + 516 + /** 517 + * This is a model with one property with a 'any of' relationship 518 + */ 519 + export type CompositionWithAnyOfAndNullable = { 520 + propA?: { 521 + boolean?: boolean; 522 + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; 523 + }; 524 + 525 + /** 526 + * This is a base model with two simple optional properties 527 + */ 528 + export type CompositionBaseModel = { 529 + firstName?: string; 530 + lastname?: string; 531 + }; 532 + 533 + /** 534 + * This is a model that extends the base model 535 + */ 536 + export type CompositionExtendedModel = CompositionBaseModel & { 537 + firstName: string; 538 + lastname: string; 539 + age: number; 540 + }; 541 + 542 + /** 543 + * This is a model with one nested property 544 + */ 545 + export type ModelWithProperties = { 546 + required: string; 547 + readonly requiredAndReadOnly: string; 548 + requiredAndNullable: string | null; 549 + string?: string; 550 + number?: number; 551 + boolean?: boolean; 552 + reference?: ModelWithString; 553 + 'property with space'?: string; 554 + default?: string; 555 + try?: string; 556 + readonly '@namespace.string'?: string; 557 + readonly '@namespace.integer'?: number; 558 + }; 559 + 560 + /** 561 + * This is a model with one nested property 562 + */ 563 + export type ModelWithNestedProperties = { 564 + readonly first: { 565 + readonly second: { 566 + readonly third: string | null; 567 + } | null; 568 + } | null; 569 + }; 570 + 571 + /** 572 + * This is a model with duplicated properties 573 + */ 574 + export type ModelWithDuplicateProperties = { 575 + prop?: ModelWithString; 576 + }; 577 + 578 + /** 579 + * This is a model with ordered properties 580 + */ 581 + export type ModelWithOrderedProperties = { 582 + zebra?: string; 583 + apple?: string; 584 + hawaii?: string; 585 + }; 586 + 587 + /** 588 + * This is a model with duplicated imports 589 + */ 590 + export type ModelWithDuplicateImports = { 591 + propA?: ModelWithString; 592 + propB?: ModelWithString; 593 + propC?: ModelWithString; 594 + }; 595 + 596 + /** 597 + * This is a model that extends another model 598 + */ 599 + export type ModelThatExtends = ModelWithString & { 600 + propExtendsA?: string; 601 + propExtendsB?: ModelWithString; 602 + }; 603 + 604 + /** 605 + * This is a model that extends another model 606 + */ 607 + export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { 608 + propExtendsC?: string; 609 + propExtendsD?: ModelWithString; 610 + }; 611 + 612 + /** 613 + * This is a model that contains a some patterns 614 + */ 615 + export type ModelWithPattern = { 616 + key: string; 617 + name: string; 618 + readonly enabled?: boolean; 619 + readonly modified?: string; 620 + id?: string; 621 + text?: string; 622 + patternWithSingleQuotes?: string; 623 + patternWithNewline?: string; 624 + patternWithBacktick?: string; 625 + }; 626 + 627 + export type File = { 628 + readonly id?: string; 629 + readonly updated_at?: string; 630 + readonly created_at?: string; 631 + mime: string; 632 + readonly file?: string; 633 + }; 634 + 635 + export type _default = { 636 + name?: string; 637 + }; 638 + 639 + export type Pageable = { 640 + page?: number; 641 + size?: number; 642 + sort?: Array<(string)>; 643 + }; 644 + 645 + /** 646 + * This is a free-form object without additionalProperties. 647 + */ 648 + export type FreeFormObjectWithoutAdditionalProperties = { 649 + [key: string]: unknown; 650 + }; 651 + 652 + /** 653 + * This is a free-form object with additionalProperties: true. 654 + */ 655 + export type FreeFormObjectWithAdditionalPropertiesEqTrue = { 656 + [key: string]: unknown; 657 + }; 658 + 659 + /** 660 + * This is a free-form object with additionalProperties: {}. 661 + */ 662 + export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { 663 + [key: string]: unknown; 664 + }; 665 + 666 + export type ModelWithConst = { 667 + String?: "String"; 668 + number?: 0; 669 + null?: null; 670 + withType?: "Some string"; 671 + }; 672 + 673 + /** 674 + * This is a model with one property and additionalProperties: true 675 + */ 676 + export type ModelWithAdditionalPropertiesEqTrue = { 677 + /** 678 + * This is a simple string property 679 + */ 680 + prop?: string; 681 + [key: string]: unknown | string; 682 + }; 683 + 684 + export type NestedAnyOfArraysNullable = { 685 + nullableArray?: Array<(string | boolean)> | null; 686 + }; 687 + 688 + export type CompositionWithOneOfAndProperties = { 689 + foo: ParameterSimpleParameter; 690 + baz: number | null; 691 + qux: number; 692 + } | { 693 + bar: NonAsciiStringæøåÆØÅöôêÊ字符串; 694 + baz: number | null; 695 + qux: number; 696 + }; 697 + 698 + /** 699 + * An object that can be null 700 + */ 701 + export type NullableObject = { 702 + foo?: string; 703 + } | null; 704 + 705 + /** 706 + * Some % character 707 + */ 708 + export type CharactersInDescription = string; 709 + 710 + export type ModelWithNullableObject = { 711 + data?: NullableObject; 712 + }; 713 + 714 + export type ModelWithOneOfEnum = { 715 + foo: 'Bar'; 716 + } | { 717 + foo: 'Baz'; 718 + } | { 719 + foo: 'Qux'; 720 + } | { 721 + content: string; 722 + foo: 'Quux'; 723 + } | { 724 + content: [ 725 + string, 726 + string 727 + ]; 728 + foo: 'Corge'; 729 + }; 730 + 731 + export type foo = 'Bar'; 732 + 733 + export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; 734 + 735 + export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; 736 + 737 + export type ModelWithNestedArrayEnumsData = { 738 + foo?: Array<ModelWithNestedArrayEnumsDataFoo>; 739 + bar?: Array<ModelWithNestedArrayEnumsDataBar>; 740 + }; 741 + 742 + export type ModelWithNestedArrayEnums = { 743 + array_strings?: Array<(string)>; 744 + data?: ModelWithNestedArrayEnumsData; 745 + }; 746 + 747 + export type ModelWithNestedCompositionEnums = { 748 + foo?: ModelWithNestedArrayEnumsDataFoo; 749 + }; 750 + 751 + export type ModelWithReadOnlyAndWriteOnly = { 752 + foo: string; 753 + readonly bar: string; 754 + baz: string; 755 + }; 756 + 757 + export type ModelWithConstantSizeArray = [ 758 + number, 759 + number 760 + ]; 761 + 762 + export type ModelWithAnyOfConstantSizeArray = [ 763 + number | string, 764 + number | string, 765 + number | string 766 + ]; 767 + 768 + export type ModelWithPrefixItemsConstantSizeArray = [ 769 + ModelWithInteger, 770 + number | string, 771 + string 772 + ]; 773 + 774 + export type ModelWithAnyOfConstantSizeArrayNullable = [ 775 + number | null | string, 776 + number | null | string, 777 + number | null | string 778 + ]; 779 + 780 + export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ 781 + number | string, 782 + number | string 783 + ]; 784 + 785 + export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ 786 + number & string, 787 + number & string 788 + ]; 789 + 790 + export type ModelWithNumericEnumUnion = { 791 + /** 792 + * Период 793 + */ 794 + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; 795 + }; 796 + 797 + /** 798 + * Период 799 + */ 800 + export type value = -10 | -1 | 0 | 1 | 3 | 6 | 12; 801 + 802 + /** 803 + * Some description with `back ticks` 804 + */ 805 + export type ModelWithBackticksInDescription = { 806 + /** 807 + * The template `that` should be used for parsing and importing the contents of the CSV file. 808 + * 809 + * <br/><p>There is one placeholder currently supported:<ul> <li><b>${x}</b> - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)</li></ul><p>Example of a correct JSON template:</p> 810 + * <pre> 811 + * [ 812 + * { 813 + * "resourceType": "Asset", 814 + * "identifier": { 815 + * "name": "${1}", 816 + * "domain": { 817 + * "name": "${2}", 818 + * "community": { 819 + * "name": "Some Community" 820 + * } 821 + * } 822 + * }, 823 + * "attributes" : { 824 + * "00000000-0000-0000-0000-000000003115" : [ { 825 + * "value" : "${3}" 826 + * } ], 827 + * "00000000-0000-0000-0000-000000000222" : [ { 828 + * "value" : "${4}" 829 + * } ] 830 + * } 831 + * } 832 + * ] 833 + * </pre> 834 + */ 835 + template?: string; 836 + }; 837 + 838 + /** 839 + * Model used to test deduplication strategy (unused) 840 + */ 841 + export type ParameterSimpleParameterUnused = string; 842 + 843 + /** 844 + * Model used to test deduplication strategy 845 + */ 846 + export type PostServiceWithEmptyTagResponse = string; 847 + 848 + /** 849 + * Model used to test deduplication strategy 850 + */ 851 + export type PostServiceWithEmptyTagResponse2 = string; 852 + 853 + /** 854 + * Model used to test deduplication strategy 855 + */ 856 + export type DeleteFooData = string; 857 + 858 + /** 859 + * Model used to test deduplication strategy 860 + */ 861 + export type DeleteFooData2 = string; 862 + 863 + /** 864 + * This is a reusable parameter 865 + */ 866 + export type ParameterSimpleParameter = string; 867 + 868 + /** 869 + * Parameter with illegal characters 870 + */ 871 + export type Parameterx_Foo_Bar = ModelWithString; 872 + 873 + export type PostServiceWithEmptyTagData = { 874 + requestBody: ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly; 875 + }; 876 + 877 + export type PostServiceWithEmptyTagResponse3 = ModelWithReadOnlyAndWriteOnly; 878 + 879 + export type ApiVversionOdataControllerCountResponse = Model_From_Zendesk; 880 + 881 + export type DeleteFooData3 = { 882 + /** 883 + * bar in method 884 + */ 885 + barParam: string; 886 + /** 887 + * foo in method 888 + */ 889 + fooParam: string; 890 + /** 891 + * Parameter with illegal characters 892 + */ 893 + xFooBar: ModelWithString; 894 + }; 895 + 896 + export type CallWithDescriptionsData = { 897 + /** 898 + * Testing backticks in string: `backticks` and ```multiple backticks``` should work 899 + */ 900 + parameterWithBackticks?: unknown; 901 + /** 902 + * Testing multiline comments in string: First line 903 + * Second line 904 + * 905 + * Fourth line 906 + */ 907 + parameterWithBreaks?: unknown; 908 + /** 909 + * Testing expression placeholders in string: ${expression} should work 910 + */ 911 + parameterWithExpressionPlaceholders?: unknown; 912 + /** 913 + * Testing quotes in string: 'single quote''' and "double quotes""" should work 914 + */ 915 + parameterWithQuotes?: unknown; 916 + /** 917 + * Testing reserved characters in string: * inline * and ** inline ** should work 918 + */ 919 + parameterWithReservedCharacters?: unknown; 920 + /** 921 + * Testing slashes in string: \backwards\\\ and /forwards/// should work 922 + */ 923 + parameterWithSlashes?: unknown; 924 + }; 925 + 926 + export type DeprecatedCallData = { 927 + /** 928 + * This parameter is deprecated 929 + * @deprecated 930 + */ 931 + parameter: DeprecatedModel | null; 932 + }; 933 + 934 + export type CallWithParametersData = { 935 + fooAllOfEnum: ModelWithNestedArrayEnumsDataFoo; 936 + fooRefEnum?: ModelWithNestedArrayEnumsDataFoo; 937 + /** 938 + * This is the parameter that goes into the cookie 939 + */ 940 + parameterCookie: string | null; 941 + /** 942 + * This is the parameter that goes into the form data 943 + */ 944 + parameterForm: string | null; 945 + /** 946 + * This is the parameter that goes into the header 947 + */ 948 + parameterHeader: string | null; 949 + /** 950 + * This is the parameter that goes into the path 951 + */ 952 + parameterPath: string | null; 953 + /** 954 + * This is the parameter that goes into the query params 955 + */ 956 + parameterQuery: string | null; 957 + /** 958 + * This is the parameter that goes into the body 959 + */ 960 + requestBody: ModelWithString | null; 961 + }; 962 + 963 + export type CallWithWeirdParameterNamesData = { 964 + /** 965 + * This is the parameter with a reserved keyword 966 + */ 967 + _default?: string; 968 + /** 969 + * This is the parameter that goes into the cookie 970 + */ 971 + parameterCookie: string | null; 972 + /** 973 + * This is the parameter that goes into the request form data 974 + */ 975 + parameterForm: string | null; 976 + /** 977 + * This is the parameter that goes into the request header 978 + */ 979 + parameterHeader: string | null; 980 + /** 981 + * This is the parameter that goes into the path 982 + */ 983 + parameterPath1?: string; 984 + /** 985 + * This is the parameter that goes into the path 986 + */ 987 + parameterPath2?: string; 988 + /** 989 + * This is the parameter that goes into the path 990 + */ 991 + parameterPath3?: string; 992 + /** 993 + * This is the parameter that goes into the request query params 994 + */ 995 + parameterQuery: string | null; 996 + /** 997 + * This is the parameter that goes into the body 998 + */ 999 + requestBody: ModelWithString | null; 1000 + }; 1001 + 1002 + export type GetCallWithOptionalParamData = { 1003 + /** 1004 + * This is an optional parameter 1005 + */ 1006 + parameter?: string; 1007 + /** 1008 + * This is a required parameter 1009 + */ 1010 + requestBody: ModelWithOneOfEnum; 1011 + }; 1012 + 1013 + export type PostCallWithOptionalParamData = { 1014 + /** 1015 + * This is a required parameter 1016 + */ 1017 + parameter: Pageable; 1018 + /** 1019 + * This is an optional parameter 1020 + */ 1021 + requestBody?: ModelWithString; 1022 + }; 1023 + 1024 + export type PostApiRequestBodyData = { 1025 + /** 1026 + * A reusable request body 1027 + */ 1028 + foo?: ModelWithString; 1029 + /** 1030 + * This is a reusable parameter 1031 + */ 1032 + parameter?: string; 1033 + }; 1034 + 1035 + export type PostApiFormDataData = { 1036 + /** 1037 + * A reusable request body 1038 + */ 1039 + formData?: ModelWithString; 1040 + /** 1041 + * This is a reusable parameter 1042 + */ 1043 + parameter?: string; 1044 + }; 1045 + 1046 + export type CallWithDefaultParametersData = { 1047 + /** 1048 + * This is a simple boolean with default value 1049 + */ 1050 + parameterBoolean?: boolean | null; 1051 + /** 1052 + * This is a simple enum with default value 1053 + */ 1054 + parameterEnum?: 'Success' | 'Warning' | 'Error'; 1055 + /** 1056 + * This is a simple model with default value 1057 + */ 1058 + parameterModel?: ModelWithString | null; 1059 + /** 1060 + * This is a simple number with default value 1061 + */ 1062 + parameterNumber?: number | null; 1063 + /** 1064 + * This is a simple string with default value 1065 + */ 1066 + parameterString?: string | null; 1067 + }; 1068 + 1069 + export type CallWithDefaultOptionalParametersData = { 1070 + /** 1071 + * This is a simple boolean that is optional with default value 1072 + */ 1073 + parameterBoolean?: boolean; 1074 + /** 1075 + * This is a simple enum that is optional with default value 1076 + */ 1077 + parameterEnum?: 'Success' | 'Warning' | 'Error'; 1078 + /** 1079 + * This is a simple model that is optional with default value 1080 + */ 1081 + parameterModel?: ModelWithString; 1082 + /** 1083 + * This is a simple number that is optional with default value 1084 + */ 1085 + parameterNumber?: number; 1086 + /** 1087 + * This is a simple string that is optional with default value 1088 + */ 1089 + parameterString?: string; 1090 + }; 1091 + 1092 + export type CallToTestOrderOfParamsData = { 1093 + /** 1094 + * This is a optional string with default 1095 + */ 1096 + parameterOptionalStringWithDefault?: string; 1097 + /** 1098 + * This is a optional string with empty default 1099 + */ 1100 + parameterOptionalStringWithEmptyDefault?: string; 1101 + /** 1102 + * This is a optional string with no default 1103 + */ 1104 + parameterOptionalStringWithNoDefault?: string; 1105 + /** 1106 + * This is a string that can be null with default 1107 + */ 1108 + parameterStringNullableWithDefault?: string | null; 1109 + /** 1110 + * This is a string that can be null with no default 1111 + */ 1112 + parameterStringNullableWithNoDefault?: string | null; 1113 + /** 1114 + * This is a string with default 1115 + */ 1116 + parameterStringWithDefault: string; 1117 + /** 1118 + * This is a string with empty default 1119 + */ 1120 + parameterStringWithEmptyDefault: string; 1121 + /** 1122 + * This is a string with no default 1123 + */ 1124 + parameterStringWithNoDefault: string; 1125 + }; 1126 + 1127 + export type CallWithNoContentResponseResponse = void; 1128 + 1129 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1130 + 1131 + export type DummyAResponse = void; 1132 + 1133 + export type DummyBResponse = void; 1134 + 1135 + export type CallWithResponseResponse = ModelWithString; 1136 + 1137 + export type CallWithDuplicateResponsesResponse = ModelWithBoolean & ModelWithInteger | ModelWithString; 1138 + 1139 + export type CallWithResponsesResponse = { 1140 + readonly '@namespace.string'?: string; 1141 + readonly '@namespace.integer'?: number; 1142 + readonly value?: Array<ModelWithString>; 1143 + } | ModelThatExtends | ModelThatExtendsExtends; 1144 + 1145 + export type CollectionFormatData = { 1146 + /** 1147 + * This is an array parameter that is sent as csv format (comma-separated values) 1148 + */ 1149 + parameterArrayCsv: Array<(string)> | null; 1150 + /** 1151 + * This is an array parameter that is sent as multi format (multiple parameter instances) 1152 + */ 1153 + parameterArrayMulti: Array<(string)> | null; 1154 + /** 1155 + * This is an array parameter that is sent as pipes format (pipe-separated values) 1156 + */ 1157 + parameterArrayPipes: Array<(string)> | null; 1158 + /** 1159 + * This is an array parameter that is sent as ssv format (space-separated values) 1160 + */ 1161 + parameterArraySsv: Array<(string)> | null; 1162 + /** 1163 + * This is an array parameter that is sent as tsv format (tab-separated values) 1164 + */ 1165 + parameterArrayTsv: Array<(string)> | null; 1166 + }; 1167 + 1168 + export type TypesData = { 1169 + /** 1170 + * This is a number parameter 1171 + */ 1172 + id?: number; 1173 + /** 1174 + * This is an array parameter 1175 + */ 1176 + parameterArray: Array<(string)> | null; 1177 + /** 1178 + * This is a boolean parameter 1179 + */ 1180 + parameterBoolean: boolean | null; 1181 + /** 1182 + * This is a dictionary parameter 1183 + */ 1184 + parameterDictionary: { 1185 + [key: string]: unknown; 1186 + } | null; 1187 + /** 1188 + * This is an enum parameter 1189 + */ 1190 + parameterEnum: 'Success' | 'Warning' | 'Error' | null; 1191 + /** 1192 + * This is a number parameter 1193 + */ 1194 + parameterNumber: number; 1195 + /** 1196 + * This is an object parameter 1197 + */ 1198 + parameterObject: { 1199 + [key: string]: unknown; 1200 + } | null; 1201 + /** 1202 + * This is a string parameter 1203 + */ 1204 + parameterString: string | null; 1205 + }; 1206 + 1207 + export type TypesResponse = number | string | boolean | { 1208 + [key: string]: unknown; 1209 + }; 1210 + 1211 + export type UploadFileData = { 1212 + /** 1213 + * Supply a file reference for upload 1214 + */ 1215 + file: (Blob | File); 1216 + }; 1217 + 1218 + export type UploadFileResponse = boolean; 1219 + 1220 + export type FileResponseData = { 1221 + id: string; 1222 + }; 1223 + 1224 + export type FileResponseResponse = (Blob | File); 1225 + 1226 + export type ComplexTypesData = { 1227 + /** 1228 + * Parameter containing object 1229 + */ 1230 + parameterObject: { 1231 + first?: { 1232 + second?: { 1233 + third?: string; 1234 + }; 1235 + }; 1236 + }; 1237 + /** 1238 + * Parameter containing reference 1239 + */ 1240 + parameterReference: ModelWithString; 1241 + }; 1242 + 1243 + export type ComplexTypesResponse = Array<ModelWithString>; 1244 + 1245 + export type MultipartRequestData = { 1246 + formData?: { 1247 + content?: (Blob | File); 1248 + data?: ModelWithString | null; 1249 + }; 1250 + }; 1251 + 1252 + export type MultipartResponseResponse = { 1253 + file?: (Blob | File); 1254 + metadata?: { 1255 + foo?: string; 1256 + bar?: string; 1257 + }; 1258 + }; 1259 + 1260 + export type ComplexParamsData = { 1261 + id: number; 1262 + requestBody?: { 1263 + readonly key: string | null; 1264 + name: string | null; 1265 + enabled?: boolean; 1266 + readonly type: 'Monkey' | 'Horse' | 'Bird'; 1267 + listOfModels?: Array<ModelWithString> | null; 1268 + listOfStrings?: Array<(string)> | null; 1269 + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; 1270 + readonly user?: { 1271 + readonly id?: number; 1272 + readonly name?: string | null; 1273 + }; 1274 + }; 1275 + }; 1276 + 1277 + export type ComplexParamsResponse = ModelWithString; 1278 + 1279 + export type CallWithResultFromHeaderResponse = string; 1280 + 1281 + export type TestErrorCodeData = { 1282 + /** 1283 + * Status code to return 1284 + */ 1285 + status: number; 1286 + }; 1287 + 1288 + export type TestErrorCodeResponse = unknown; 1289 + 1290 + export type NonAsciiæøåÆøÅöôêÊ字符串Data = { 1291 + /** 1292 + * Dummy input param 1293 + */ 1294 + nonAsciiParamæøåÆøÅöôêÊ: number; 1295 + }; 1296 + 1297 + export type NonAsciiæøåÆøÅöôêÊ字符串Response = Array<NonAsciiStringæøåÆØÅöôêÊ字符串>; 1298 + 1299 + export type $OpenApiTs = { 1300 + '/api/v{api-version}/no-tag': { 1301 + post: { 1302 + req: PostServiceWithEmptyTagData; 1303 + res: { 1304 + default: ModelWithReadOnlyAndWriteOnly; 1305 + }; 1306 + }; 1307 + }; 1308 + '/api/v{api-version}/simple/$count': { 1309 + get: { 1310 + res: { 1311 + /** 1312 + * Success 1313 + */ 1314 + 200: Model_From_Zendesk; 1315 + }; 1316 + }; 1317 + }; 1318 + '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}': { 1319 + delete: { 1320 + req: DeleteFooData3; 1321 + }; 1322 + }; 1323 + '/api/v{api-version}/descriptions/': { 1324 + post: { 1325 + req: CallWithDescriptionsData; 1326 + }; 1327 + }; 1328 + '/api/v{api-version}/parameters/deprecated': { 1329 + post: { 1330 + req: DeprecatedCallData; 1331 + }; 1332 + }; 1333 + '/api/v{api-version}/parameters/{parameterPath}': { 1334 + post: { 1335 + req: CallWithParametersData; 1336 + }; 1337 + }; 1338 + '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}': { 1339 + post: { 1340 + req: CallWithWeirdParameterNamesData; 1341 + }; 1342 + }; 1343 + '/api/v{api-version}/parameters/': { 1344 + get: { 1345 + req: GetCallWithOptionalParamData; 1346 + }; 1347 + post: { 1348 + req: PostCallWithOptionalParamData; 1349 + }; 1350 + }; 1351 + '/api/v{api-version}/requestBody/': { 1352 + post: { 1353 + req: PostApiRequestBodyData; 1354 + }; 1355 + }; 1356 + '/api/v{api-version}/formData/': { 1357 + post: { 1358 + req: PostApiFormDataData; 1359 + }; 1360 + }; 1361 + '/api/v{api-version}/defaults': { 1362 + get: { 1363 + req: CallWithDefaultParametersData; 1364 + }; 1365 + post: { 1366 + req: CallWithDefaultOptionalParametersData; 1367 + }; 1368 + put: { 1369 + req: CallToTestOrderOfParamsData; 1370 + }; 1371 + }; 1372 + '/api/v{api-version}/no-content': { 1373 + get: { 1374 + res: { 1375 + /** 1376 + * Success 1377 + */ 1378 + 204: void; 1379 + }; 1380 + }; 1381 + }; 1382 + '/api/v{api-version}/multiple-tags/response-and-no-content': { 1383 + get: { 1384 + res: { 1385 + /** 1386 + * Response is a simple number 1387 + */ 1388 + 200: number; 1389 + /** 1390 + * Success 1391 + */ 1392 + 204: void; 1393 + }; 1394 + }; 1395 + }; 1396 + '/api/v{api-version}/multiple-tags/a': { 1397 + get: { 1398 + res: { 1399 + /** 1400 + * Success 1401 + */ 1402 + 204: void; 1403 + }; 1404 + }; 1405 + }; 1406 + '/api/v{api-version}/multiple-tags/b': { 1407 + get: { 1408 + res: { 1409 + /** 1410 + * Success 1411 + */ 1412 + 204: void; 1413 + }; 1414 + }; 1415 + }; 1416 + '/api/v{api-version}/response': { 1417 + get: { 1418 + res: { 1419 + default: ModelWithString; 1420 + }; 1421 + }; 1422 + post: { 1423 + res: { 1424 + /** 1425 + * Message for 200 response 1426 + */ 1427 + 200: ModelWithBoolean & ModelWithInteger; 1428 + /** 1429 + * Message for 201 response 1430 + */ 1431 + 201: ModelWithString; 1432 + /** 1433 + * Message for 500 error 1434 + */ 1435 + 500: ModelWithStringError; 1436 + /** 1437 + * Message for 501 error 1438 + */ 1439 + 501: ModelWithStringError; 1440 + /** 1441 + * Message for 502 error 1442 + */ 1443 + 502: ModelWithStringError; 1444 + /** 1445 + * Message for 4XX errors 1446 + */ 1447 + '4XX': DictionaryWithArray; 1448 + /** 1449 + * Message for default response 1450 + */ 1451 + default: ModelWithBoolean; 1452 + }; 1453 + }; 1454 + put: { 1455 + res: { 1456 + /** 1457 + * Message for 200 response 1458 + */ 1459 + 200: { 1460 + readonly '@namespace.string'?: string; 1461 + readonly '@namespace.integer'?: number; 1462 + readonly value?: Array<ModelWithString>; 1463 + }; 1464 + /** 1465 + * Message for 201 response 1466 + */ 1467 + 201: ModelThatExtends; 1468 + /** 1469 + * Message for 202 response 1470 + */ 1471 + 202: ModelThatExtendsExtends; 1472 + /** 1473 + * Message for 500 error 1474 + */ 1475 + 500: ModelWithStringError; 1476 + /** 1477 + * Message for 501 error 1478 + */ 1479 + 501: ModelWithStringError; 1480 + /** 1481 + * Message for 502 error 1482 + */ 1483 + 502: ModelWithStringError; 1484 + /** 1485 + * Message for default response 1486 + */ 1487 + default: ModelWithString; 1488 + }; 1489 + }; 1490 + }; 1491 + '/api/v{api-version}/collectionFormat': { 1492 + get: { 1493 + req: CollectionFormatData; 1494 + }; 1495 + }; 1496 + '/api/v{api-version}/types': { 1497 + get: { 1498 + req: TypesData; 1499 + res: { 1500 + /** 1501 + * Response is a simple number 1502 + */ 1503 + 200: number; 1504 + /** 1505 + * Response is a simple string 1506 + */ 1507 + 201: string; 1508 + /** 1509 + * Response is a simple boolean 1510 + */ 1511 + 202: boolean; 1512 + /** 1513 + * Response is a simple object 1514 + */ 1515 + 203: { 1516 + [key: string]: unknown; 1517 + }; 1518 + }; 1519 + }; 1520 + }; 1521 + '/api/v{api-version}/upload': { 1522 + post: { 1523 + req: UploadFileData; 1524 + res: { 1525 + 200: boolean; 1526 + }; 1527 + }; 1528 + }; 1529 + '/api/v{api-version}/file/{id}': { 1530 + get: { 1531 + req: FileResponseData; 1532 + res: { 1533 + /** 1534 + * Success 1535 + */ 1536 + 200: (Blob | File); 1537 + }; 1538 + }; 1539 + }; 1540 + '/api/v{api-version}/complex': { 1541 + get: { 1542 + req: ComplexTypesData; 1543 + res: { 1544 + /** 1545 + * Successful response 1546 + */ 1547 + 200: Array<ModelWithString>; 1548 + /** 1549 + * 400 `server` error 1550 + */ 1551 + 400: unknown; 1552 + /** 1553 + * 500 server error 1554 + */ 1555 + 500: unknown; 1556 + }; 1557 + }; 1558 + }; 1559 + '/api/v{api-version}/multipart': { 1560 + post: { 1561 + req: MultipartRequestData; 1562 + }; 1563 + get: { 1564 + res: { 1565 + /** 1566 + * OK 1567 + */ 1568 + 200: { 1569 + file?: (Blob | File); 1570 + metadata?: { 1571 + foo?: string; 1572 + bar?: string; 1573 + }; 1574 + }; 1575 + }; 1576 + }; 1577 + }; 1578 + '/api/v{api-version}/complex/{id}': { 1579 + put: { 1580 + req: ComplexParamsData; 1581 + res: { 1582 + /** 1583 + * Success 1584 + */ 1585 + 200: ModelWithString; 1586 + }; 1587 + }; 1588 + }; 1589 + '/api/v{api-version}/header': { 1590 + post: { 1591 + res: { 1592 + /** 1593 + * Successful response 1594 + */ 1595 + 200: string; 1596 + /** 1597 + * 400 server error 1598 + */ 1599 + 400: unknown; 1600 + /** 1601 + * 500 server error 1602 + */ 1603 + 500: unknown; 1604 + }; 1605 + }; 1606 + }; 1607 + '/api/v{api-version}/error': { 1608 + post: { 1609 + req: TestErrorCodeData; 1610 + res: { 1611 + /** 1612 + * Custom message: Successful response 1613 + */ 1614 + 200: unknown; 1615 + /** 1616 + * Custom message: Internal Server Error 1617 + */ 1618 + 500: unknown; 1619 + /** 1620 + * Custom message: Not Implemented 1621 + */ 1622 + 501: unknown; 1623 + /** 1624 + * Custom message: Bad Gateway 1625 + */ 1626 + 502: unknown; 1627 + /** 1628 + * Custom message: Service Unavailable 1629 + */ 1630 + 503: unknown; 1631 + }; 1632 + }; 1633 + }; 1634 + '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串': { 1635 + post: { 1636 + req: NonAsciiæøåÆøÅöôêÊ字符串Data; 1637 + res: { 1638 + /** 1639 + * Successful response 1640 + */ 1641 + 200: Array<NonAsciiStringæøåÆØÅöôêÊ字符串>; 1642 + }; 1643 + }; 1644 + }; 1645 + };
+10 -10
packages/openapi-ts/test/index.spec.ts
··· 199 199 exportCore: false, 200 200 schemas: false, 201 201 services: false, 202 - types: {}, 203 - }), 204 - description: 'generate models', 205 - name: 'v3_models', 206 - }, 207 - { 208 - config: createConfig({ 209 - exportCore: false, 210 - schemas: false, 211 - services: false, 212 202 types: { 213 203 include: '^(CamelCaseCommentWithBreaks|ArrayWithProperties)', 214 204 name: 'PascalCase', ··· 263 253 }), 264 254 description: 'generate tree-shakeable services', 265 255 name: 'v3_tree_shakeable', 256 + }, 257 + { 258 + config: createConfig({ 259 + exportCore: false, 260 + schemas: false, 261 + services: false, 262 + types: {}, 263 + }), 264 + description: 'generate only types', 265 + name: 'v3_types', 266 266 }, 267 267 ]; 268 268