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 #439 from hey-api/feat/jsdoc-comments-for-options

fix: add jsdoc comments with use options

authored by

Jordan Shatford and committed by
GitHub
9eadc04c 747d1e9b

+537 -5
+5
.changeset/shaggy-eggs-count.md
··· 1 + --- 2 + "@hey-api/openapi-ts": patch 3 + --- 4 + 5 + fix: add jsdoc comments with use options
+15 -5
packages/openapi-ts/src/utils/write/services.ts
··· 73 73 const toOperationComment = (operation: Operation) => { 74 74 const config = getConfig(); 75 75 let params: string[] = []; 76 - if (!config.useOptions && operation.parameters.length) { 77 - params = operation.parameters.map( 78 - (p) => 79 - `@param ${p.name} ${p.description ? escapeComment(p.description) : ''}`, 80 - ); 76 + if (operation.parameters.length) { 77 + if (config.useOptions) { 78 + params = [ 79 + '@param data The data for the request.', 80 + ...operation.parameters.map( 81 + (p) => 82 + `@param data.${p.name} ${p.description ? escapeComment(p.description) : ''}`, 83 + ), 84 + ]; 85 + } else { 86 + params = operation.parameters.map( 87 + (p) => 88 + `@param ${p.name} ${p.description ? escapeComment(p.description) : ''}`, 89 + ); 90 + } 81 91 } 82 92 const comment = [ 83 93 operation.deprecated && '@deprecated',
+68
packages/openapi-ts/test/__snapshots__/test/generated/v2/services.gen.ts.snap
··· 91 91 92 92 export class DescriptionsService { 93 93 /** 94 + * @param data The data for the request. 95 + * @param data.parameterWithBreaks Testing multiline comments in string: First line 96 + * Second line 97 + * 98 + * Fourth line 99 + * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work 100 + * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work 101 + * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work 102 + * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work 103 + * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work 94 104 * @throws ApiError 95 105 */ 96 106 public static callWithDescriptions( ··· 121 131 122 132 export class ParametersService { 123 133 /** 134 + * @param data The data for the request. 135 + * @param data.parameterHeader This is the parameter that goes into the header 136 + * @param data.parameterQuery This is the parameter that goes into the query params 137 + * @param data.parameterForm This is the parameter that goes into the form data 138 + * @param data.parameterBody This is the parameter that is sent as request body 139 + * @param data.parameterPath This is the parameter that goes into the path 124 140 * @throws ApiError 125 141 */ 126 142 public static callWithParameters( ··· 153 169 } 154 170 155 171 /** 172 + * @param data The data for the request. 173 + * @param data.parameterHeader This is the parameter that goes into the request header 174 + * @param data.parameterQuery This is the parameter that goes into the request query params 175 + * @param data.parameterForm This is the parameter that goes into the request form data 176 + * @param data.parameterBody This is the parameter that is sent as request body 177 + * @param data.parameterPath1 This is the parameter that goes into the path 178 + * @param data.parameterPath2 This is the parameter that goes into the path 179 + * @param data.parameterPath3 This is the parameter that goes into the path 180 + * @param data._default This is the parameter with a reserved keyword 156 181 * @throws ApiError 157 182 */ 158 183 public static callWithWeirdParameterNames( ··· 193 218 194 219 export class DefaultsService { 195 220 /** 221 + * @param data The data for the request. 222 + * @param data.parameterString This is a simple string with default value 223 + * @param data.parameterNumber This is a simple number with default value 224 + * @param data.parameterBoolean This is a simple boolean with default value 225 + * @param data.parameterEnum This is a simple enum with default value 226 + * @param data.parameterModel This is a simple model with default value 196 227 * @throws ApiError 197 228 */ 198 229 public static callWithDefaultParameters( ··· 219 250 } 220 251 221 252 /** 253 + * @param data The data for the request. 254 + * @param data.parameterString This is a simple string that is optional with default value 255 + * @param data.parameterNumber This is a simple number that is optional with default value 256 + * @param data.parameterBoolean This is a simple boolean that is optional with default value 257 + * @param data.parameterEnum This is a simple enum that is optional with default value 258 + * @param data.parameterModel This is a simple model that is optional with default value 222 259 * @throws ApiError 223 260 */ 224 261 public static callWithDefaultOptionalParameters( ··· 245 282 } 246 283 247 284 /** 285 + * @param data The data for the request. 286 + * @param data.parameterStringWithNoDefault This is a string with no default 287 + * @param data.parameterOptionalStringWithDefault This is a optional string with default 288 + * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default 289 + * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default 290 + * @param data.parameterStringWithDefault This is a string with default 291 + * @param data.parameterStringWithEmptyDefault This is a string with empty default 292 + * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default 293 + * @param data.parameterStringNullableWithDefault This is a string that can be null with default 248 294 * @throws ApiError 249 295 */ 250 296 public static callToTestOrderOfParams( ··· 494 540 495 541 export class CollectionFormatService { 496 542 /** 543 + * @param data The data for the request. 544 + * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) 545 + * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values) 546 + * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values) 547 + * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values) 548 + * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances) 497 549 * @throws ApiError 498 550 */ 499 551 public static collectionFormat( ··· 522 574 523 575 export class TypesService { 524 576 /** 577 + * @param data The data for the request. 578 + * @param data.parameterArray This is an array parameter 579 + * @param data.parameterDictionary This is a dictionary parameter 580 + * @param data.parameterEnum This is an enum parameter 581 + * @param data.parameterNumber This is a number parameter 582 + * @param data.parameterString This is a string parameter 583 + * @param data.parameterBoolean This is a boolean parameter 584 + * @param data.parameterObject This is an object parameter 585 + * @param data.id This is a number parameter 525 586 * @returns number Response is a simple number 526 587 * @returns string Response is a simple string 527 588 * @returns boolean Response is a simple boolean ··· 567 628 568 629 export class ComplexService { 569 630 /** 631 + * @param data The data for the request. 632 + * @param data.parameterObject Parameter containing object 633 + * @param data.parameterReference Parameter containing reference 570 634 * @returns ModelWithString Successful response 571 635 * @throws ApiError 572 636 */ ··· 613 677 614 678 export class ErrorService { 615 679 /** 680 + * @param data The data for the request. 681 + * @param data.status Status code to return 616 682 * @returns unknown Custom message: Successful response 617 683 * @throws ApiError 618 684 */ ··· 640 706 641 707 export class NonAsciiÆøåÆøÅöôêÊService { 642 708 /** 709 + * @param data The data for the request. 710 + * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param 643 711 * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response 644 712 * @throws ApiError 645 713 */
+100
packages/openapi-ts/test/__snapshots__/test/generated/v3/services.gen.ts.snap
··· 17 17 } 18 18 19 19 /** 20 + * @param data The data for the request. 21 + * @param data.requestBody 20 22 * @returns ModelWithReadOnlyAndWriteOnly 21 23 * @throws ApiError 22 24 */ ··· 122 124 123 125 export class ParametersService { 124 126 /** 127 + * @param data The data for the request. 128 + * @param data.foo foo in method 129 + * @param data.bar bar in method 125 130 * @throws ApiError 126 131 */ 127 132 public static deleteFoo( ··· 139 144 } 140 145 141 146 /** 147 + * @param data The data for the request. 148 + * @param data.parameterHeader This is the parameter that goes into the header 149 + * @param data.fooAllOfEnum 150 + * @param data.parameterQuery This is the parameter that goes into the query params 151 + * @param data.parameterForm This is the parameter that goes into the form data 152 + * @param data.parameterCookie This is the parameter that goes into the cookie 153 + * @param data.parameterPath This is the parameter that goes into the path 154 + * @param data.requestBody This is the parameter that goes into the body 155 + * @param data.fooRefEnum 142 156 * @throws ApiError 143 157 */ 144 158 public static callWithParameters( ··· 180 194 } 181 195 182 196 /** 197 + * @param data The data for the request. 198 + * @param data.parameterHeader This is the parameter that goes into the request header 199 + * @param data.parameterQuery This is the parameter that goes into the request query params 200 + * @param data.parameterForm This is the parameter that goes into the request form data 201 + * @param data.parameterCookie This is the parameter that goes into the cookie 202 + * @param data.requestBody This is the parameter that goes into the body 203 + * @param data.parameterPath1 This is the parameter that goes into the path 204 + * @param data.parameterPath2 This is the parameter that goes into the path 205 + * @param data.parameterPath3 This is the parameter that goes into the path 206 + * @param data._default This is the parameter with a reserved keyword 183 207 * @throws ApiError 184 208 */ 185 209 public static callWithWeirdParameterNames( ··· 223 247 } 224 248 225 249 /** 250 + * @param data The data for the request. 251 + * @param data.requestBody This is a required parameter 252 + * @param data.parameter This is an optional parameter 226 253 * @throws ApiError 227 254 */ 228 255 public static getCallWithOptionalParam( ··· 241 268 } 242 269 243 270 /** 271 + * @param data The data for the request. 272 + * @param data.parameter This is a required parameter 273 + * @param data.requestBody This is an optional parameter 244 274 * @throws ApiError 245 275 */ 246 276 public static postCallWithOptionalParam( ··· 261 291 262 292 export class DescriptionsService { 263 293 /** 294 + * @param data The data for the request. 295 + * @param data.parameterWithBreaks Testing multiline comments in string: First line 296 + * Second line 297 + * 298 + * Fourth line 299 + * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work 300 + * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work 301 + * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work 302 + * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work 303 + * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work 264 304 * @throws ApiError 265 305 */ 266 306 public static callWithDescriptions( ··· 292 332 export class DeprecatedService { 293 333 /** 294 334 * @deprecated 335 + * @param data The data for the request. 336 + * @param data.parameter This parameter is deprecated 295 337 * @throws ApiError 296 338 */ 297 339 public static deprecatedCall( ··· 310 352 311 353 export class RequestBodyService { 312 354 /** 355 + * @param data The data for the request. 356 + * @param data.parameter This is a reusable parameter 357 + * @param data.foo A reusable request body 313 358 * @throws ApiError 314 359 */ 315 360 public static postApiRequestBody( ··· 330 375 331 376 export class FormDataService { 332 377 /** 378 + * @param data The data for the request. 379 + * @param data.parameter This is a reusable parameter 380 + * @param data.formData A reusable request body 333 381 * @throws ApiError 334 382 */ 335 383 public static postApiFormData( ··· 350 398 351 399 export class DefaultsService { 352 400 /** 401 + * @param data The data for the request. 402 + * @param data.parameterString This is a simple string with default value 403 + * @param data.parameterNumber This is a simple number with default value 404 + * @param data.parameterBoolean This is a simple boolean with default value 405 + * @param data.parameterEnum This is a simple enum with default value 406 + * @param data.parameterModel This is a simple model with default value 353 407 * @throws ApiError 354 408 */ 355 409 public static callWithDefaultParameters( ··· 376 430 } 377 431 378 432 /** 433 + * @param data The data for the request. 434 + * @param data.parameterString This is a simple string that is optional with default value 435 + * @param data.parameterNumber This is a simple number that is optional with default value 436 + * @param data.parameterBoolean This is a simple boolean that is optional with default value 437 + * @param data.parameterEnum This is a simple enum that is optional with default value 438 + * @param data.parameterModel This is a simple model that is optional with default value 379 439 * @throws ApiError 380 440 */ 381 441 public static callWithDefaultOptionalParameters( ··· 402 462 } 403 463 404 464 /** 465 + * @param data The data for the request. 466 + * @param data.parameterStringWithNoDefault This is a string with no default 467 + * @param data.parameterOptionalStringWithDefault This is a optional string with default 468 + * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default 469 + * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default 470 + * @param data.parameterStringWithDefault This is a string with default 471 + * @param data.parameterStringWithEmptyDefault This is a string with empty default 472 + * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default 473 + * @param data.parameterStringNullableWithDefault This is a string that can be null with default 405 474 * @throws ApiError 406 475 */ 407 476 public static callToTestOrderOfParams( ··· 651 720 652 721 export class CollectionFormatService { 653 722 /** 723 + * @param data The data for the request. 724 + * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) 725 + * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values) 726 + * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values) 727 + * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values) 728 + * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances) 654 729 * @throws ApiError 655 730 */ 656 731 public static collectionFormat( ··· 679 754 680 755 export class TypesService { 681 756 /** 757 + * @param data The data for the request. 758 + * @param data.parameterArray This is an array parameter 759 + * @param data.parameterDictionary This is a dictionary parameter 760 + * @param data.parameterEnum This is an enum parameter 761 + * @param data.parameterNumber This is a number parameter 762 + * @param data.parameterString This is a string parameter 763 + * @param data.parameterBoolean This is a boolean parameter 764 + * @param data.parameterObject This is an object parameter 765 + * @param data.id This is a number parameter 682 766 * @returns number Response is a simple number 683 767 * @returns string Response is a simple string 684 768 * @returns boolean Response is a simple boolean ··· 724 808 725 809 export class UploadService { 726 810 /** 811 + * @param data The data for the request. 812 + * @param data.file Supply a file reference for upload 727 813 * @returns boolean 728 814 * @throws ApiError 729 815 */ ··· 745 831 746 832 export class FileResponseService { 747 833 /** 834 + * @param data The data for the request. 835 + * @param data.id 748 836 * @returns binary Success 749 837 * @throws ApiError 750 838 */ ··· 766 854 767 855 export class ComplexService { 768 856 /** 857 + * @param data The data for the request. 858 + * @param data.parameterObject Parameter containing object 859 + * @param data.parameterReference Parameter containing reference 769 860 * @returns ModelWithString Successful response 770 861 * @throws ApiError 771 862 */ ··· 790 881 } 791 882 792 883 /** 884 + * @param data The data for the request. 885 + * @param data.id 886 + * @param data.requestBody 793 887 * @returns ModelWithString Success 794 888 * @throws ApiError 795 889 */ ··· 813 907 814 908 export class MultipartService { 815 909 /** 910 + * @param data The data for the request. 911 + * @param data.formData 816 912 * @throws ApiError 817 913 */ 818 914 public static multipartRequest( ··· 863 959 864 960 export class ErrorService { 865 961 /** 962 + * @param data The data for the request. 963 + * @param data.status Status code to return 866 964 * @returns unknown Custom message: Successful response 867 965 * @throws ApiError 868 966 */ ··· 890 988 891 989 export class NonAsciiÆøåÆøÅöôêÊService { 892 990 /** 991 + * @param data The data for the request. 992 + * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param 893 993 * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response 894 994 * @throws ApiError 895 995 */
+100
packages/openapi-ts/test/__snapshots__/test/generated/v3_angular/services.gen.ts.snap
··· 24 24 } 25 25 26 26 /** 27 + * @param data The data for the request. 28 + * @param data.requestBody 27 29 * @returns ModelWithReadOnlyAndWriteOnly 28 30 * @throws ApiError 29 31 */ ··· 137 139 constructor(public readonly http: HttpClient) {} 138 140 139 141 /** 142 + * @param data The data for the request. 143 + * @param data.foo foo in method 144 + * @param data.bar bar in method 140 145 * @throws ApiError 141 146 */ 142 147 public deleteFoo( ··· 154 159 } 155 160 156 161 /** 162 + * @param data The data for the request. 163 + * @param data.parameterHeader This is the parameter that goes into the header 164 + * @param data.fooAllOfEnum 165 + * @param data.parameterQuery This is the parameter that goes into the query params 166 + * @param data.parameterForm This is the parameter that goes into the form data 167 + * @param data.parameterCookie This is the parameter that goes into the cookie 168 + * @param data.parameterPath This is the parameter that goes into the path 169 + * @param data.requestBody This is the parameter that goes into the body 170 + * @param data.fooRefEnum 157 171 * @throws ApiError 158 172 */ 159 173 public callWithParameters( ··· 195 209 } 196 210 197 211 /** 212 + * @param data The data for the request. 213 + * @param data.parameterHeader This is the parameter that goes into the request header 214 + * @param data.parameterQuery This is the parameter that goes into the request query params 215 + * @param data.parameterForm This is the parameter that goes into the request form data 216 + * @param data.parameterCookie This is the parameter that goes into the cookie 217 + * @param data.requestBody This is the parameter that goes into the body 218 + * @param data.parameterPath1 This is the parameter that goes into the path 219 + * @param data.parameterPath2 This is the parameter that goes into the path 220 + * @param data.parameterPath3 This is the parameter that goes into the path 221 + * @param data._default This is the parameter with a reserved keyword 198 222 * @throws ApiError 199 223 */ 200 224 public callWithWeirdParameterNames( ··· 238 262 } 239 263 240 264 /** 265 + * @param data The data for the request. 266 + * @param data.requestBody This is a required parameter 267 + * @param data.parameter This is an optional parameter 241 268 * @throws ApiError 242 269 */ 243 270 public getCallWithOptionalParam( ··· 256 283 } 257 284 258 285 /** 286 + * @param data The data for the request. 287 + * @param data.parameter This is a required parameter 288 + * @param data.requestBody This is an optional parameter 259 289 * @throws ApiError 260 290 */ 261 291 public postCallWithOptionalParam( ··· 281 311 constructor(public readonly http: HttpClient) {} 282 312 283 313 /** 314 + * @param data The data for the request. 315 + * @param data.parameterWithBreaks Testing multiline comments in string: First line 316 + * Second line 317 + * 318 + * Fourth line 319 + * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work 320 + * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work 321 + * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work 322 + * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work 323 + * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work 284 324 * @throws ApiError 285 325 */ 286 326 public callWithDescriptions( ··· 317 357 318 358 /** 319 359 * @deprecated 360 + * @param data The data for the request. 361 + * @param data.parameter This parameter is deprecated 320 362 * @throws ApiError 321 363 */ 322 364 public deprecatedCall( ··· 340 382 constructor(public readonly http: HttpClient) {} 341 383 342 384 /** 385 + * @param data The data for the request. 386 + * @param data.parameter This is a reusable parameter 387 + * @param data.foo A reusable request body 343 388 * @throws ApiError 344 389 */ 345 390 public postApiRequestBody( ··· 365 410 constructor(public readonly http: HttpClient) {} 366 411 367 412 /** 413 + * @param data The data for the request. 414 + * @param data.parameter This is a reusable parameter 415 + * @param data.formData A reusable request body 368 416 * @throws ApiError 369 417 */ 370 418 public postApiFormData( ··· 390 438 constructor(public readonly http: HttpClient) {} 391 439 392 440 /** 441 + * @param data The data for the request. 442 + * @param data.parameterString This is a simple string with default value 443 + * @param data.parameterNumber This is a simple number with default value 444 + * @param data.parameterBoolean This is a simple boolean with default value 445 + * @param data.parameterEnum This is a simple enum with default value 446 + * @param data.parameterModel This is a simple model with default value 393 447 * @throws ApiError 394 448 */ 395 449 public callWithDefaultParameters( ··· 416 470 } 417 471 418 472 /** 473 + * @param data The data for the request. 474 + * @param data.parameterString This is a simple string that is optional with default value 475 + * @param data.parameterNumber This is a simple number that is optional with default value 476 + * @param data.parameterBoolean This is a simple boolean that is optional with default value 477 + * @param data.parameterEnum This is a simple enum that is optional with default value 478 + * @param data.parameterModel This is a simple model that is optional with default value 419 479 * @throws ApiError 420 480 */ 421 481 public callWithDefaultOptionalParameters( ··· 442 502 } 443 503 444 504 /** 505 + * @param data The data for the request. 506 + * @param data.parameterStringWithNoDefault This is a string with no default 507 + * @param data.parameterOptionalStringWithDefault This is a optional string with default 508 + * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default 509 + * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default 510 + * @param data.parameterStringWithDefault This is a string with default 511 + * @param data.parameterStringWithEmptyDefault This is a string with empty default 512 + * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default 513 + * @param data.parameterStringNullableWithDefault This is a string that can be null with default 445 514 * @throws ApiError 446 515 */ 447 516 public callToTestOrderOfParams( ··· 726 795 constructor(public readonly http: HttpClient) {} 727 796 728 797 /** 798 + * @param data The data for the request. 799 + * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) 800 + * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values) 801 + * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values) 802 + * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values) 803 + * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances) 729 804 * @throws ApiError 730 805 */ 731 806 public collectionFormat( ··· 759 834 constructor(public readonly http: HttpClient) {} 760 835 761 836 /** 837 + * @param data The data for the request. 838 + * @param data.parameterArray This is an array parameter 839 + * @param data.parameterDictionary This is a dictionary parameter 840 + * @param data.parameterEnum This is an enum parameter 841 + * @param data.parameterNumber This is a number parameter 842 + * @param data.parameterString This is a string parameter 843 + * @param data.parameterBoolean This is a boolean parameter 844 + * @param data.parameterObject This is an object parameter 845 + * @param data.id This is a number parameter 762 846 * @returns number Response is a simple number 763 847 * @returns string Response is a simple string 764 848 * @returns boolean Response is a simple boolean ··· 809 893 constructor(public readonly http: HttpClient) {} 810 894 811 895 /** 896 + * @param data The data for the request. 897 + * @param data.file Supply a file reference for upload 812 898 * @returns boolean 813 899 * @throws ApiError 814 900 */ ··· 833 919 constructor(public readonly http: HttpClient) {} 834 920 835 921 /** 922 + * @param data The data for the request. 923 + * @param data.id 836 924 * @returns binary Success 837 925 * @throws ApiError 838 926 */ ··· 859 947 constructor(public readonly http: HttpClient) {} 860 948 861 949 /** 950 + * @param data The data for the request. 951 + * @param data.parameterObject Parameter containing object 952 + * @param data.parameterReference Parameter containing reference 862 953 * @returns ModelWithString Successful response 863 954 * @throws ApiError 864 955 */ ··· 881 972 } 882 973 883 974 /** 975 + * @param data The data for the request. 976 + * @param data.id 977 + * @param data.requestBody 884 978 * @returns ModelWithString Success 885 979 * @throws ApiError 886 980 */ ··· 909 1003 constructor(public readonly http: HttpClient) {} 910 1004 911 1005 /** 1006 + * @param data The data for the request. 1007 + * @param data.formData 912 1008 * @throws ApiError 913 1009 */ 914 1010 public multipartRequest( ··· 969 1065 constructor(public readonly http: HttpClient) {} 970 1066 971 1067 /** 1068 + * @param data The data for the request. 1069 + * @param data.status Status code to return 972 1070 * @returns unknown Custom message: Successful response 973 1071 * @throws ApiError 974 1072 */ ··· 999 1097 constructor(public readonly http: HttpClient) {} 1000 1098 1001 1099 /** 1100 + * @param data The data for the request. 1101 + * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param 1002 1102 * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response 1003 1103 * @throws ApiError 1004 1104 */
+100
packages/openapi-ts/test/__snapshots__/test/generated/v3_client/services.gen.ts.snap
··· 18 18 } 19 19 20 20 /** 21 + * @param data The data for the request. 22 + * @param data.requestBody 21 23 * @returns ModelWithReadOnlyAndWriteOnly 22 24 * @throws ApiError 23 25 */ ··· 127 129 constructor(public readonly httpRequest: BaseHttpRequest) {} 128 130 129 131 /** 132 + * @param data The data for the request. 133 + * @param data.foo foo in method 134 + * @param data.bar bar in method 130 135 * @throws ApiError 131 136 */ 132 137 public deleteFoo( ··· 144 149 } 145 150 146 151 /** 152 + * @param data The data for the request. 153 + * @param data.parameterHeader This is the parameter that goes into the header 154 + * @param data.fooAllOfEnum 155 + * @param data.parameterQuery This is the parameter that goes into the query params 156 + * @param data.parameterForm This is the parameter that goes into the form data 157 + * @param data.parameterCookie This is the parameter that goes into the cookie 158 + * @param data.parameterPath This is the parameter that goes into the path 159 + * @param data.requestBody This is the parameter that goes into the body 160 + * @param data.fooRefEnum 147 161 * @throws ApiError 148 162 */ 149 163 public callWithParameters( ··· 185 199 } 186 200 187 201 /** 202 + * @param data The data for the request. 203 + * @param data.parameterHeader This is the parameter that goes into the request header 204 + * @param data.parameterQuery This is the parameter that goes into the request query params 205 + * @param data.parameterForm This is the parameter that goes into the request form data 206 + * @param data.parameterCookie This is the parameter that goes into the cookie 207 + * @param data.requestBody This is the parameter that goes into the body 208 + * @param data.parameterPath1 This is the parameter that goes into the path 209 + * @param data.parameterPath2 This is the parameter that goes into the path 210 + * @param data.parameterPath3 This is the parameter that goes into the path 211 + * @param data._default This is the parameter with a reserved keyword 188 212 * @throws ApiError 189 213 */ 190 214 public callWithWeirdParameterNames( ··· 228 252 } 229 253 230 254 /** 255 + * @param data The data for the request. 256 + * @param data.requestBody This is a required parameter 257 + * @param data.parameter This is an optional parameter 231 258 * @throws ApiError 232 259 */ 233 260 public getCallWithOptionalParam( ··· 246 273 } 247 274 248 275 /** 276 + * @param data The data for the request. 277 + * @param data.parameter This is a required parameter 278 + * @param data.requestBody This is an optional parameter 249 279 * @throws ApiError 250 280 */ 251 281 public postCallWithOptionalParam( ··· 268 298 constructor(public readonly httpRequest: BaseHttpRequest) {} 269 299 270 300 /** 301 + * @param data The data for the request. 302 + * @param data.parameterWithBreaks Testing multiline comments in string: First line 303 + * Second line 304 + * 305 + * Fourth line 306 + * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work 307 + * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work 308 + * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work 309 + * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work 310 + * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work 271 311 * @throws ApiError 272 312 */ 273 313 public callWithDescriptions( ··· 301 341 302 342 /** 303 343 * @deprecated 344 + * @param data The data for the request. 345 + * @param data.parameter This parameter is deprecated 304 346 * @throws ApiError 305 347 */ 306 348 public deprecatedCall( ··· 321 363 constructor(public readonly httpRequest: BaseHttpRequest) {} 322 364 323 365 /** 366 + * @param data The data for the request. 367 + * @param data.parameter This is a reusable parameter 368 + * @param data.foo A reusable request body 324 369 * @throws ApiError 325 370 */ 326 371 public postApiRequestBody( ··· 343 388 constructor(public readonly httpRequest: BaseHttpRequest) {} 344 389 345 390 /** 391 + * @param data The data for the request. 392 + * @param data.parameter This is a reusable parameter 393 + * @param data.formData A reusable request body 346 394 * @throws ApiError 347 395 */ 348 396 public postApiFormData( ··· 365 413 constructor(public readonly httpRequest: BaseHttpRequest) {} 366 414 367 415 /** 416 + * @param data The data for the request. 417 + * @param data.parameterString This is a simple string with default value 418 + * @param data.parameterNumber This is a simple number with default value 419 + * @param data.parameterBoolean This is a simple boolean with default value 420 + * @param data.parameterEnum This is a simple enum with default value 421 + * @param data.parameterModel This is a simple model with default value 368 422 * @throws ApiError 369 423 */ 370 424 public callWithDefaultParameters( ··· 391 445 } 392 446 393 447 /** 448 + * @param data The data for the request. 449 + * @param data.parameterString This is a simple string that is optional with default value 450 + * @param data.parameterNumber This is a simple number that is optional with default value 451 + * @param data.parameterBoolean This is a simple boolean that is optional with default value 452 + * @param data.parameterEnum This is a simple enum that is optional with default value 453 + * @param data.parameterModel This is a simple model that is optional with default value 394 454 * @throws ApiError 395 455 */ 396 456 public callWithDefaultOptionalParameters( ··· 417 477 } 418 478 419 479 /** 480 + * @param data The data for the request. 481 + * @param data.parameterStringWithNoDefault This is a string with no default 482 + * @param data.parameterOptionalStringWithDefault This is a optional string with default 483 + * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default 484 + * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default 485 + * @param data.parameterStringWithDefault This is a string with default 486 + * @param data.parameterStringWithEmptyDefault This is a string with empty default 487 + * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default 488 + * @param data.parameterStringNullableWithDefault This is a string that can be null with default 420 489 * @throws ApiError 421 490 */ 422 491 public callToTestOrderOfParams( ··· 680 749 constructor(public readonly httpRequest: BaseHttpRequest) {} 681 750 682 751 /** 752 + * @param data The data for the request. 753 + * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) 754 + * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values) 755 + * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values) 756 + * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values) 757 + * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances) 683 758 * @throws ApiError 684 759 */ 685 760 public collectionFormat( ··· 710 785 constructor(public readonly httpRequest: BaseHttpRequest) {} 711 786 712 787 /** 788 + * @param data The data for the request. 789 + * @param data.parameterArray This is an array parameter 790 + * @param data.parameterDictionary This is a dictionary parameter 791 + * @param data.parameterEnum This is an enum parameter 792 + * @param data.parameterNumber This is a number parameter 793 + * @param data.parameterString This is a string parameter 794 + * @param data.parameterBoolean This is a boolean parameter 795 + * @param data.parameterObject This is an object parameter 796 + * @param data.id This is a number parameter 713 797 * @returns number Response is a simple number 714 798 * @returns string Response is a simple string 715 799 * @returns boolean Response is a simple boolean ··· 757 841 constructor(public readonly httpRequest: BaseHttpRequest) {} 758 842 759 843 /** 844 + * @param data The data for the request. 845 + * @param data.file Supply a file reference for upload 760 846 * @returns boolean 761 847 * @throws ApiError 762 848 */ ··· 780 866 constructor(public readonly httpRequest: BaseHttpRequest) {} 781 867 782 868 /** 869 + * @param data The data for the request. 870 + * @param data.id 783 871 * @returns binary Success 784 872 * @throws ApiError 785 873 */ ··· 803 891 constructor(public readonly httpRequest: BaseHttpRequest) {} 804 892 805 893 /** 894 + * @param data The data for the request. 895 + * @param data.parameterObject Parameter containing object 896 + * @param data.parameterReference Parameter containing reference 806 897 * @returns ModelWithString Successful response 807 898 * @throws ApiError 808 899 */ ··· 827 918 } 828 919 829 920 /** 921 + * @param data The data for the request. 922 + * @param data.id 923 + * @param data.requestBody 830 924 * @returns ModelWithString Success 831 925 * @throws ApiError 832 926 */ ··· 852 946 constructor(public readonly httpRequest: BaseHttpRequest) {} 853 947 854 948 /** 949 + * @param data The data for the request. 950 + * @param data.formData 855 951 * @throws ApiError 856 952 */ 857 953 public multipartRequest( ··· 906 1002 constructor(public readonly httpRequest: BaseHttpRequest) {} 907 1003 908 1004 /** 1005 + * @param data The data for the request. 1006 + * @param data.status Status code to return 909 1007 * @returns unknown Custom message: Successful response 910 1008 * @throws ApiError 911 1009 */ ··· 935 1033 constructor(public readonly httpRequest: BaseHttpRequest) {} 936 1034 937 1035 /** 1036 + * @param data The data for the request. 1037 + * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param 938 1038 * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response 939 1039 * @throws ApiError 940 1040 */
+100
packages/openapi-ts/test/__snapshots__/test/generated/v3_enums_typescript/services.gen.ts.snap
··· 17 17 } 18 18 19 19 /** 20 + * @param data The data for the request. 21 + * @param data.requestBody 20 22 * @returns ModelWithReadOnlyAndWriteOnly 21 23 * @throws ApiError 22 24 */ ··· 122 124 123 125 export class ParametersService { 124 126 /** 127 + * @param data The data for the request. 128 + * @param data.foo foo in method 129 + * @param data.bar bar in method 125 130 * @throws ApiError 126 131 */ 127 132 public static deleteFoo( ··· 139 144 } 140 145 141 146 /** 147 + * @param data The data for the request. 148 + * @param data.parameterHeader This is the parameter that goes into the header 149 + * @param data.fooAllOfEnum 150 + * @param data.parameterQuery This is the parameter that goes into the query params 151 + * @param data.parameterForm This is the parameter that goes into the form data 152 + * @param data.parameterCookie This is the parameter that goes into the cookie 153 + * @param data.parameterPath This is the parameter that goes into the path 154 + * @param data.requestBody This is the parameter that goes into the body 155 + * @param data.fooRefEnum 142 156 * @throws ApiError 143 157 */ 144 158 public static callWithParameters( ··· 180 194 } 181 195 182 196 /** 197 + * @param data The data for the request. 198 + * @param data.parameterHeader This is the parameter that goes into the request header 199 + * @param data.parameterQuery This is the parameter that goes into the request query params 200 + * @param data.parameterForm This is the parameter that goes into the request form data 201 + * @param data.parameterCookie This is the parameter that goes into the cookie 202 + * @param data.requestBody This is the parameter that goes into the body 203 + * @param data.parameterPath1 This is the parameter that goes into the path 204 + * @param data.parameterPath2 This is the parameter that goes into the path 205 + * @param data.parameterPath3 This is the parameter that goes into the path 206 + * @param data._default This is the parameter with a reserved keyword 183 207 * @throws ApiError 184 208 */ 185 209 public static callWithWeirdParameterNames( ··· 223 247 } 224 248 225 249 /** 250 + * @param data The data for the request. 251 + * @param data.requestBody This is a required parameter 252 + * @param data.parameter This is an optional parameter 226 253 * @throws ApiError 227 254 */ 228 255 public static getCallWithOptionalParam( ··· 241 268 } 242 269 243 270 /** 271 + * @param data The data for the request. 272 + * @param data.parameter This is a required parameter 273 + * @param data.requestBody This is an optional parameter 244 274 * @throws ApiError 245 275 */ 246 276 public static postCallWithOptionalParam( ··· 261 291 262 292 export class DescriptionsService { 263 293 /** 294 + * @param data The data for the request. 295 + * @param data.parameterWithBreaks Testing multiline comments in string: First line 296 + * Second line 297 + * 298 + * Fourth line 299 + * @param data.parameterWithBackticks Testing backticks in string: `backticks` and ```multiple backticks``` should work 300 + * @param data.parameterWithSlashes Testing slashes in string: \backwards\\\ and /forwards/// should work 301 + * @param data.parameterWithExpressionPlaceholders Testing expression placeholders in string: ${expression} should work 302 + * @param data.parameterWithQuotes Testing quotes in string: 'single quote''' and "double quotes""" should work 303 + * @param data.parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work 264 304 * @throws ApiError 265 305 */ 266 306 public static callWithDescriptions( ··· 292 332 export class DeprecatedService { 293 333 /** 294 334 * @deprecated 335 + * @param data The data for the request. 336 + * @param data.parameter This parameter is deprecated 295 337 * @throws ApiError 296 338 */ 297 339 public static deprecatedCall( ··· 310 352 311 353 export class RequestBodyService { 312 354 /** 355 + * @param data The data for the request. 356 + * @param data.parameter This is a reusable parameter 357 + * @param data.foo A reusable request body 313 358 * @throws ApiError 314 359 */ 315 360 public static postApiRequestBody( ··· 330 375 331 376 export class FormDataService { 332 377 /** 378 + * @param data The data for the request. 379 + * @param data.parameter This is a reusable parameter 380 + * @param data.formData A reusable request body 333 381 * @throws ApiError 334 382 */ 335 383 public static postApiFormData( ··· 350 398 351 399 export class DefaultsService { 352 400 /** 401 + * @param data The data for the request. 402 + * @param data.parameterString This is a simple string with default value 403 + * @param data.parameterNumber This is a simple number with default value 404 + * @param data.parameterBoolean This is a simple boolean with default value 405 + * @param data.parameterEnum This is a simple enum with default value 406 + * @param data.parameterModel This is a simple model with default value 353 407 * @throws ApiError 354 408 */ 355 409 public static callWithDefaultParameters( ··· 376 430 } 377 431 378 432 /** 433 + * @param data The data for the request. 434 + * @param data.parameterString This is a simple string that is optional with default value 435 + * @param data.parameterNumber This is a simple number that is optional with default value 436 + * @param data.parameterBoolean This is a simple boolean that is optional with default value 437 + * @param data.parameterEnum This is a simple enum that is optional with default value 438 + * @param data.parameterModel This is a simple model that is optional with default value 379 439 * @throws ApiError 380 440 */ 381 441 public static callWithDefaultOptionalParameters( ··· 402 462 } 403 463 404 464 /** 465 + * @param data The data for the request. 466 + * @param data.parameterStringWithNoDefault This is a string with no default 467 + * @param data.parameterOptionalStringWithDefault This is a optional string with default 468 + * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default 469 + * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default 470 + * @param data.parameterStringWithDefault This is a string with default 471 + * @param data.parameterStringWithEmptyDefault This is a string with empty default 472 + * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default 473 + * @param data.parameterStringNullableWithDefault This is a string that can be null with default 405 474 * @throws ApiError 406 475 */ 407 476 public static callToTestOrderOfParams( ··· 651 720 652 721 export class CollectionFormatService { 653 722 /** 723 + * @param data The data for the request. 724 + * @param data.parameterArrayCsv This is an array parameter that is sent as csv format (comma-separated values) 725 + * @param data.parameterArraySsv This is an array parameter that is sent as ssv format (space-separated values) 726 + * @param data.parameterArrayTsv This is an array parameter that is sent as tsv format (tab-separated values) 727 + * @param data.parameterArrayPipes This is an array parameter that is sent as pipes format (pipe-separated values) 728 + * @param data.parameterArrayMulti This is an array parameter that is sent as multi format (multiple parameter instances) 654 729 * @throws ApiError 655 730 */ 656 731 public static collectionFormat( ··· 679 754 680 755 export class TypesService { 681 756 /** 757 + * @param data The data for the request. 758 + * @param data.parameterArray This is an array parameter 759 + * @param data.parameterDictionary This is a dictionary parameter 760 + * @param data.parameterEnum This is an enum parameter 761 + * @param data.parameterNumber This is a number parameter 762 + * @param data.parameterString This is a string parameter 763 + * @param data.parameterBoolean This is a boolean parameter 764 + * @param data.parameterObject This is an object parameter 765 + * @param data.id This is a number parameter 682 766 * @returns number Response is a simple number 683 767 * @returns string Response is a simple string 684 768 * @returns boolean Response is a simple boolean ··· 724 808 725 809 export class UploadService { 726 810 /** 811 + * @param data The data for the request. 812 + * @param data.file Supply a file reference for upload 727 813 * @returns boolean 728 814 * @throws ApiError 729 815 */ ··· 745 831 746 832 export class FileResponseService { 747 833 /** 834 + * @param data The data for the request. 835 + * @param data.id 748 836 * @returns binary Success 749 837 * @throws ApiError 750 838 */ ··· 766 854 767 855 export class ComplexService { 768 856 /** 857 + * @param data The data for the request. 858 + * @param data.parameterObject Parameter containing object 859 + * @param data.parameterReference Parameter containing reference 769 860 * @returns ModelWithString Successful response 770 861 * @throws ApiError 771 862 */ ··· 790 881 } 791 882 792 883 /** 884 + * @param data The data for the request. 885 + * @param data.id 886 + * @param data.requestBody 793 887 * @returns ModelWithString Success 794 888 * @throws ApiError 795 889 */ ··· 813 907 814 908 export class MultipartService { 815 909 /** 910 + * @param data The data for the request. 911 + * @param data.formData 816 912 * @throws ApiError 817 913 */ 818 914 public static multipartRequest( ··· 863 959 864 960 export class ErrorService { 865 961 /** 962 + * @param data The data for the request. 963 + * @param data.status Status code to return 866 964 * @returns unknown Custom message: Successful response 867 965 * @throws ApiError 868 966 */ ··· 890 988 891 989 export class NonAsciiÆøåÆøÅöôêÊService { 892 990 /** 991 + * @param data The data for the request. 992 + * @param data.nonAsciiParamæøåÆøÅöôêÊ Dummy input param 893 993 * @returns NonAsciiStringæøåÆØÅöôêÊ字符串 Successful response 894 994 * @throws ApiError 895 995 */
+21
packages/openapi-ts/test/__snapshots__/test/generated/v3_options/services.gen.ts.snap
··· 7 7 8 8 export class DefaultsService { 9 9 /** 10 + * @param data The data for the request. 11 + * @param data.parameterString This is a simple string with default value 12 + * @param data.parameterNumber This is a simple number with default value 13 + * @param data.parameterBoolean This is a simple boolean with default value 14 + * @param data.parameterEnum This is a simple enum with default value 15 + * @param data.parameterModel This is a simple model with default value 10 16 * @throws ApiError 11 17 */ 12 18 public static callWithDefaultParameters( ··· 33 39 } 34 40 35 41 /** 42 + * @param data The data for the request. 43 + * @param data.parameterString This is a simple string that is optional with default value 44 + * @param data.parameterNumber This is a simple number that is optional with default value 45 + * @param data.parameterBoolean This is a simple boolean that is optional with default value 46 + * @param data.parameterEnum This is a simple enum that is optional with default value 47 + * @param data.parameterModel This is a simple model that is optional with default value 36 48 * @throws ApiError 37 49 */ 38 50 public static callWithDefaultOptionalParameters( ··· 59 71 } 60 72 61 73 /** 74 + * @param data The data for the request. 75 + * @param data.parameterStringWithNoDefault This is a string with no default 76 + * @param data.parameterOptionalStringWithDefault This is a optional string with default 77 + * @param data.parameterOptionalStringWithEmptyDefault This is a optional string with empty default 78 + * @param data.parameterOptionalStringWithNoDefault This is a optional string with no default 79 + * @param data.parameterStringWithDefault This is a string with default 80 + * @param data.parameterStringWithEmptyDefault This is a string with empty default 81 + * @param data.parameterStringNullableWithNoDefault This is a string that can be null with no default 82 + * @param data.parameterStringNullableWithDefault This is a string that can be null with default 62 83 * @throws ApiError 63 84 */ 64 85 public static callToTestOrderOfParams(
+28
packages/openapi-ts/test/__snapshots__/test/generated/v3_services_name/services.gen.ts.snap
··· 91 91 92 92 export class myAwesomeParametersApi { 93 93 /** 94 + * @param data The data for the request. 95 + * @param data.foo foo in method 96 + * @param data.bar bar in method 94 97 * @throws ApiError 95 98 */ 96 99 public static deleteFoo( ··· 108 111 } 109 112 110 113 /** 114 + * @param data The data for the request. 115 + * @param data.parameterHeader This is the parameter that goes into the header 116 + * @param data.fooAllOfEnum 117 + * @param data.parameterQuery This is the parameter that goes into the query params 118 + * @param data.parameterForm This is the parameter that goes into the form data 119 + * @param data.parameterCookie This is the parameter that goes into the cookie 120 + * @param data.parameterPath This is the parameter that goes into the path 121 + * @param data.requestBody This is the parameter that goes into the body 122 + * @param data.fooRefEnum 111 123 * @throws ApiError 112 124 */ 113 125 public static callWithParameters( ··· 149 161 } 150 162 151 163 /** 164 + * @param data The data for the request. 165 + * @param data.parameterHeader This is the parameter that goes into the request header 166 + * @param data.parameterQuery This is the parameter that goes into the request query params 167 + * @param data.parameterForm This is the parameter that goes into the request form data 168 + * @param data.parameterCookie This is the parameter that goes into the cookie 169 + * @param data.requestBody This is the parameter that goes into the body 170 + * @param data.parameterPath1 This is the parameter that goes into the path 171 + * @param data.parameterPath2 This is the parameter that goes into the path 172 + * @param data.parameterPath3 This is the parameter that goes into the path 173 + * @param data._default This is the parameter with a reserved keyword 152 174 * @throws ApiError 153 175 */ 154 176 public static callWithWeirdParameterNames( ··· 192 214 } 193 215 194 216 /** 217 + * @param data The data for the request. 218 + * @param data.requestBody This is a required parameter 219 + * @param data.parameter This is an optional parameter 195 220 * @throws ApiError 196 221 */ 197 222 public static getCallWithOptionalParam( ··· 210 235 } 211 236 212 237 /** 238 + * @param data The data for the request. 239 + * @param data.parameter This is a required parameter 240 + * @param data.requestBody This is an optional parameter 213 241 * @throws ApiError 214 242 */ 215 243 public static postCallWithOptionalParam(