Skip to content

Commit 70a7034

Browse files
committed
Merge remote-tracking branch 'origin' into okhttp4-generator-tweak
2 parents 5c6a14e + ae3b978 commit 70a7034

File tree

4 files changed

+49
-26
lines changed

4 files changed

+49
-26
lines changed

src/main/resources/handlebars/Java/libraries/feign/api.mustache

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ public interface {{classname}} extends ApiClient.Api {
4040
@RequestLine("{{httpMethod}} {{{path}}}{{#hasQueryParams}}?{{/hasQueryParams}}{{#queryParams}}{{baseName}}={{braces "left"}}{{paramName}}{{braces "right"}}{{#has this 'more'}}&{{/has}}{{/queryParams}}")
4141
@Headers({
4242
{{#vendorExtensions.x-contentType}}
43-
"Content-Type: {{vendorExtensions.x-contentType}}",
43+
"Content-Type: {{{vendorExtensions.x-contentType}}}",
4444
{{/vendorExtensions.x-contentType}}
4545
{{#vendorExtensions.x-accepts}}
46-
"Accept: {{vendorExtensions.x-accepts}}",
46+
"Accept: {{{vendorExtensions.x-accepts}}}",
4747
{{/vendorExtensions.x-accepts}}
4848
{{^vendorExtensions.x-accepts}}
4949
"Accept: */*",
@@ -85,13 +85,13 @@ public interface {{classname}} extends ApiClient.Api {
8585
@RequestLine("{{httpMethod}} {{{path}}}?{{#queryParams}}{{baseName}}={{braces "left"}}{{paramName}}{{braces "right"}}{{#has this 'more'}}&{{/has}}{{/queryParams}}")
8686
@Headers({
8787
{{#vendorExtensions.x-contentType}}
88-
"Content-Type: {{vendorExtensions.x-contentType}}",
88+
"Content-Type: {{{vendorExtensions.x-contentType}}}",
8989
{{/vendorExtensions.x-contentType}}
9090
{{^vendorExtensions.x-contentType}}
9191
"Content-Type: */*",
9292
{{/vendorExtensions.x-contentType}}
9393
{{#vendorExtensions.x-accepts}}
94-
"Accept: {{vendorExtensions.x-accepts}}",
94+
"Accept: {{{vendorExtensions.x-accepts}}}",
9595
{{/vendorExtensions.x-accepts}}
9696
{{#headerParams}}
9797
"{{baseName}}: {{braces "left"}}{{paramName}}{{braces "right"}}"{{#has this 'more'}},{{/has}}

src/main/resources/handlebars/php/api.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ use {{invokerPackage}}\ObjectSerializer;
448448
449449
} else {
450450
// for HTTP post (form)
451-
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
451+
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
452452
}
453453
}
454454

@@ -491,7 +491,7 @@ use {{invokerPackage}}\ObjectSerializer;
491491
$headers
492492
);
493493

494-
$query = \GuzzleHttp\Psr7\build_query($queryParams);
494+
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
495495
return new Request(
496496
'{{httpMethod}}',
497497
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),

src/main/resources/handlebars/php/model_enum.mustache

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,23 @@ class {{classname}}
33
/**
44
* Possible values of this enum
55
*/
6-
{{#allowableValues}}{{#enumVars}}const {{{name}}} = {{{value}}};
7-
{{/enumVars}}{{/allowableValues}}
6+
{{#allowableValues}}
7+
{{#enumVars}}
8+
const {{{name}}} = {{{value}}};
9+
{{/enumVars}}
10+
{{/allowableValues}}
811
/**
912
* Gets allowable values of the enum
1013
* @return string[]
1114
*/
1215
public static function getAllowableEnumValues()
1316
{
1417
return [
15-
{{#allowableValues}}{{#enumVars}}self::{{{name}}},{{^@last}}
16-
{{/@last}}{{/enumVars}}{{/allowableValues}}
18+
{{#allowableValues}}
19+
{{#enumVars}}
20+
self::{{{name}}}{{#hasMore}},{{/hasMore}}
21+
{{/enumVars}}
22+
{{/allowableValues}}
1723
];
1824
}
1925
}

src/main/resources/handlebars/php/model_generic.mustache

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa
1515
* @var string[]
1616
*/
1717
protected static $swaggerTypes = [
18-
{{#vars}}'{{name}}' => '{{{datatype}}}'{{#hasMore}},
19-
{{/hasMore}}{{/vars}}
18+
{{#vars}}
19+
'{{name}}' => '{{{datatype}}}'{{#hasMore}},{{/hasMore}}
20+
{{/vars}}
2021
];
2122

2223
/**
@@ -25,8 +26,9 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa
2526
* @var string[]
2627
*/
2728
protected static $swaggerFormats = [
28-
{{#vars}}'{{name}}' => {{#dataFormat}}'{{{dataFormat}}}'{{/dataFormat}}{{^dataFormat}}null{{/dataFormat}}{{#hasMore}},
29-
{{/hasMore}}{{/vars}}
29+
{{#vars}}
30+
'{{name}}' => {{#dataFormat}}'{{{dataFormat}}}'{{/dataFormat}}{{^dataFormat}}null{{/dataFormat}}{{#hasMore}},{{/hasMore}}
31+
{{/vars}}
3032
];
3133

3234
/**
@@ -56,8 +58,9 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa
5658
* @var string[]
5759
*/
5860
protected static $attributeMap = [
59-
{{#vars}}'{{name}}' => '{{baseName}}'{{#hasMore}},
60-
{{/hasMore}}{{/vars}}
61+
{{#vars}}
62+
'{{name}}' => '{{baseName}}'{{#hasMore}},{{/hasMore}}
63+
{{/vars}}
6164
];
6265

6366
/**
@@ -66,8 +69,9 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa
6669
* @var string[]
6770
*/
6871
protected static $setters = [
69-
{{#vars}}'{{name}}' => '{{setter}}'{{#hasMore}},
70-
{{/hasMore}}{{/vars}}
72+
{{#vars}}
73+
'{{name}}' => '{{setter}}'{{#hasMore}},{{/hasMore}}
74+
{{/vars}}
7175
];
7276

7377
/**
@@ -76,8 +80,9 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa
7680
* @var string[]
7781
*/
7882
protected static $getters = [
79-
{{#vars}}'{{name}}' => '{{getter}}'{{#hasMore}},
80-
{{/hasMore}}{{/vars}}
83+
{{#vars}}
84+
'{{name}}' => '{{getter}}'{{#hasMore}},{{/hasMore}}
85+
{{/vars}}
8186
];
8287

8388
/**
@@ -121,10 +126,18 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa
121126
return self::$swaggerModelName;
122127
}
123128

124-
{{#vars}}{{#isEnum}}{{#allowableValues}}{{#enumVars}}const {{enumName}}_{{{name}}} = {{{value}}};
125-
{{/enumVars}}{{/allowableValues}}{{/isEnum}}{{/vars}}
129+
{{#vars}}
130+
{{#isEnum}}
131+
{{#allowableValues}}
132+
{{#enumVars}}
133+
const {{enumName}}_{{{name}}} = {{{value}}};
134+
{{/enumVars}}
135+
{{/allowableValues}}
136+
{{/isEnum}}
137+
{{/vars}}
126138

127-
{{#vars}}{{#isEnum}}
139+
{{#vars}}
140+
{{#isEnum}}
128141
/**
129142
* Gets allowable values of the enum
130143
*
@@ -133,11 +146,15 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa
133146
public function {{getter}}AllowableValues()
134147
{
135148
return [
136-
{{#allowableValues}}{{#enumVars}}self::{{enumName}}_{{{name}}},{{^@last}}
137-
{{/@last}}{{/enumVars}}{{/allowableValues}}
149+
{{#allowableValues}}
150+
{{#enumVars}}
151+
self::{{enumName}}_{{{name}}}{{#hasMore}},{{/hasMore}}
152+
{{/enumVars}}
153+
{{/allowableValues}}
138154
];
139155
}
140-
{{/isEnum}}{{/vars}}
156+
{{/isEnum}}
157+
{{/vars}}
141158

142159
{{^parentSchema}}
143160
/**

0 commit comments

Comments
 (0)