You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/openapi-generator/src/main/resources/php/api.mustache
+37-27Lines changed: 37 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,16 @@ use {{invokerPackage}}\ObjectSerializer;
60
60
*/
61
61
protected $hostIndex;
62
62
63
-
/**
63
+
/** @var string[] $contentTypes **/
64
+
public const contentTypes = [{{#operation}}
65
+
'{{{operationId}}}' => [{{#consumes}}
66
+
'{{{mediaType}}}',{{/consumes}}
67
+
{{^consumes}}
68
+
'application/json',
69
+
{{/consumes}} ],{{/operation}}
70
+
];
71
+
72
+
/**
64
73
* @param ClientInterface $client
65
74
* @param Configuration $config
66
75
* @param HeaderSelector $selector
@@ -151,6 +160,7 @@ use {{invokerPackage}}\ObjectSerializer;
151
160
* @param array $variables Associative array of variables to pass to the host. Defaults to empty array.
152
161
{{/-first}}
153
162
{{/servers}}
163
+
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['{{{operationId}}}'] to see the possible values for this operation
154
164
*
155
165
* @throws \{{invokerPackage}}\ApiException on non-2xx response
156
166
* @throws \InvalidArgumentException
@@ -159,9 +169,9 @@ use {{invokerPackage}}\ObjectSerializer;
159
169
* @deprecated
160
170
{{/isDeprecated}}
161
171
*/
162
-
public function {{operationId}}({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#servers}}{{#-first}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}?int $hostIndex = null, array $variables = []{{/-first}}{{/servers}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}})
172
+
public function {{operationId}}({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, {{/allParams}}{{#servers}}{{#-first}}?int $hostIndex = null, array $variables = [], {{/-first}}{{/servers}}string $contentType = self::contentTypes['{{{operationId}}}'][0]{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}})
@@ -209,6 +219,7 @@ use {{invokerPackage}}\ObjectSerializer;
209
219
* @param array $variables Associative array of variables to pass to the host. Defaults to empty array.
210
220
{{/-first}}
211
221
{{/servers}}
222
+
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['{{{operationId}}}'] to see the possible values for this operation
212
223
*
213
224
* @throws \{{invokerPackage}}\ApiException on non-2xx response
214
225
* @throws \InvalidArgumentException
@@ -217,9 +228,9 @@ use {{invokerPackage}}\ObjectSerializer;
217
228
* @deprecated
218
229
{{/isDeprecated}}
219
230
*/
220
-
public function {{operationId}}WithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#servers}}{{#-first}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}?int $hostIndex = null, array $variables = []{{/-first}}{{/servers}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}})
231
+
public function {{operationId}}WithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, {{/allParams}}{{#servers}}{{#-first}}?int $hostIndex = null, array $variables = [], {{/-first}}{{/servers}}string $contentType = self::contentTypes['{{{operationId}}}'][0]{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}})
@@ -367,16 +378,17 @@ use {{invokerPackage}}\ObjectSerializer;
367
378
* @param array $variables Associative array of variables to pass to the host. Defaults to empty array.
368
379
{{/-first}}
369
380
{{/servers}}
381
+
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['{{{operationId}}}'] to see the possible values for this operation
370
382
*
371
383
* @throws \InvalidArgumentException
372
384
* @return \GuzzleHttp\Promise\PromiseInterface
373
385
{{#isDeprecated}}
374
386
* @deprecated
375
387
{{/isDeprecated}}
376
388
*/
377
-
public function {{operationId}}Async({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#servers}}{{#-first}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}?int $hostIndex = null, array $variables = []{{/-first}}{{/servers}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}})
389
+
public function {{operationId}}Async({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, {{/allParams}}{{#servers}}{{#-first}}?int $hostIndex = null, array $variables = [], {{/-first}}{{/servers}}string $contentType = self::contentTypes['{{{operationId}}}'][0]{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}})
@@ -428,17 +440,18 @@ use {{invokerPackage}}\ObjectSerializer;
428
440
* @param array $variables Associative array of variables to pass to the host. Defaults to empty array.
429
441
{{/-first}}
430
442
{{/servers}}
443
+
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['{{{operationId}}}'] to see the possible values for this operation
431
444
*
432
445
* @throws \InvalidArgumentException
433
446
* @return \GuzzleHttp\Promise\PromiseInterface
434
447
{{#isDeprecated}}
435
448
* @deprecated
436
449
{{/isDeprecated}}
437
450
*/
438
-
public function {{operationId}}AsyncWithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#servers}}{{#-first}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}?int $hostIndex = null, array $variables = []{{/-first}}{{/servers}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}})
451
+
public function {{operationId}}AsyncWithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, {{/allParams}}{{#servers}}{{#-first}}?int $hostIndex = null, array $variables = [], {{/-first}}{{/servers}}string $contentType = self::contentTypes['{{{operationId}}}'][0]{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}})
@@ -517,14 +530,15 @@ use {{invokerPackage}}\ObjectSerializer;
517
530
* @param array $variables Associative array of variables to pass to the host. Defaults to empty array.
518
531
{{/-first}}
519
532
{{/servers}}
533
+
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['{{{operationId}}}'] to see the possible values for this operation
520
534
*
521
535
* @throws \InvalidArgumentException
522
536
* @return \GuzzleHttp\Psr7\Request
523
537
{{#isDeprecated}}
524
538
* @deprecated
525
539
{{/isDeprecated}}
526
540
*/
527
-
public function {{operationId}}Request({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#servers}}{{#-first}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}?int $hostIndex = null, array $variables = []{{/-first}}{{/servers}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}})
541
+
public function {{operationId}}Request({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, {{/allParams}}{{#servers}}{{#-first}}?int $hostIndex = null, array $variables = [], {{/-first}}{{/servers}}string $contentType = self::contentTypes['{{{operationId}}}'][0]{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}})
528
542
{
529
543
{{#vendorExtensions.x-group-parameters}}
530
544
// unbox the parameters from the associative array
@@ -533,7 +547,9 @@ use {{invokerPackage}}\ObjectSerializer;
@@ -578,9 +594,7 @@ use {{invokerPackage}}\ObjectSerializer;
578
594
throw new \InvalidArgumentException('invalid value for "${{paramName}}" when calling {{classname}}.{{operationId}}, number of items must be greater than or equal to {{minItems}}.');
579
595
}
580
596
{{/minItems}}
581
-
582
-
{{/hasValidation}}
583
-
{{/allParams}}
597
+
{{/hasValidation}}{{/allParams}}
584
598
585
599
$resourcePath = '{{{path}}}';
586
600
$formParams = [];
@@ -649,21 +663,17 @@ use {{invokerPackage}}\ObjectSerializer;
0 commit comments