forked from loafle/openapi-generator-original
[PHP][php-nextgen] Fix usage of enums in parameters (#20294)
This commit is contained in:
parent
47891245e9
commit
e87c4ea6c0
@ -711,7 +711,7 @@ use {{invokerPackage}}\ObjectSerializer;
|
||||
{{#queryParams}}
|
||||
// query params
|
||||
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
|
||||
${{paramName}},
|
||||
${{paramName}}{{#isEnumRef}}->value{{/isEnumRef}},
|
||||
'{{baseName}}', // param base name
|
||||
'{{#schema}}{{openApiType}}{{/schema}}', // openApiType
|
||||
'{{style}}', // style
|
||||
@ -728,7 +728,7 @@ use {{invokerPackage}}\ObjectSerializer;
|
||||
}
|
||||
{{/collectionFormat}}
|
||||
if (${{paramName}} !== null) {
|
||||
$headerParams['{{baseName}}'] = ObjectSerializer::toHeaderValue(${{paramName}});
|
||||
$headerParams['{{baseName}}'] = ObjectSerializer::toHeaderValue(${{paramName}}{{#isEnumRef}}->value{{/isEnumRef}});
|
||||
}
|
||||
{{/headerParams}}
|
||||
|
||||
@ -742,7 +742,7 @@ use {{invokerPackage}}\ObjectSerializer;
|
||||
if (${{paramName}} !== null) {
|
||||
$resourcePath = str_replace(
|
||||
'{' . '{{baseName}}' . '}',
|
||||
ObjectSerializer::toPathValue(${{paramName}}),
|
||||
ObjectSerializer::toPathValue(${{paramName}}{{#isEnumRef}}->value{{/isEnumRef}}),
|
||||
$resourcePath
|
||||
);
|
||||
}
|
||||
|
@ -438,7 +438,7 @@ class HeaderApi
|
||||
}
|
||||
// header params
|
||||
if ($enum_ref_string_header !== null) {
|
||||
$headerParams['enum_ref_string_header'] = ObjectSerializer::toHeaderValue($enum_ref_string_header);
|
||||
$headerParams['enum_ref_string_header'] = ObjectSerializer::toHeaderValue($enum_ref_string_header->value);
|
||||
}
|
||||
|
||||
|
||||
|
@ -462,7 +462,7 @@ class PathApi
|
||||
if ($enum_ref_string_path !== null) {
|
||||
$resourcePath = str_replace(
|
||||
'{' . 'enum_ref_string_path' . '}',
|
||||
ObjectSerializer::toPathValue($enum_ref_string_path),
|
||||
ObjectSerializer::toPathValue($enum_ref_string_path->value),
|
||||
$resourcePath
|
||||
);
|
||||
}
|
||||
|
@ -424,7 +424,7 @@ class QueryApi
|
||||
) ?? []);
|
||||
// query params
|
||||
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
|
||||
$enum_ref_string_query,
|
||||
$enum_ref_string_query->value,
|
||||
'enum_ref_string_query', // param base name
|
||||
'StringEnumRef', // openApiType
|
||||
'form', // style
|
||||
|
@ -438,7 +438,7 @@ class HeaderApi
|
||||
}
|
||||
// header params
|
||||
if ($enum_ref_string_header !== null) {
|
||||
$headerParams['enum_ref_string_header'] = ObjectSerializer::toHeaderValue($enum_ref_string_header);
|
||||
$headerParams['enum_ref_string_header'] = ObjectSerializer::toHeaderValue($enum_ref_string_header->value);
|
||||
}
|
||||
|
||||
|
||||
|
@ -462,7 +462,7 @@ class PathApi
|
||||
if ($enum_ref_string_path !== null) {
|
||||
$resourcePath = str_replace(
|
||||
'{' . 'enum_ref_string_path' . '}',
|
||||
ObjectSerializer::toPathValue($enum_ref_string_path),
|
||||
ObjectSerializer::toPathValue($enum_ref_string_path->value),
|
||||
$resourcePath
|
||||
);
|
||||
}
|
||||
|
@ -424,7 +424,7 @@ class QueryApi
|
||||
) ?? []);
|
||||
// query params
|
||||
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
|
||||
$enum_ref_string_query,
|
||||
$enum_ref_string_query->value,
|
||||
'enum_ref_string_query', // param base name
|
||||
'StringEnumRef', // openApiType
|
||||
'form', // style
|
||||
|
@ -773,7 +773,7 @@ class FakeApi
|
||||
|
||||
// query params
|
||||
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
|
||||
$enum_class,
|
||||
$enum_class->value,
|
||||
'enum-class', // param base name
|
||||
'EnumClass', // openApiType
|
||||
'form', // style
|
||||
|
Loading…
x
Reference in New Issue
Block a user