forked from loafle/openapi-generator-original
* fix for allowable values, #4645 * fixed string values * rebuilt for #4645
This commit is contained in:
parent
6e846e7463
commit
3476e83a36
@ -128,7 +128,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple
|
||||
{{^isContainer}}
|
||||
$allowed_values = [{{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}];
|
||||
if (!in_array($this->container['{{name}}'], $allowed_values)) {
|
||||
$invalid_properties[] = "invalid value for '{{name}}', must be one of #{allowed_values}.";
|
||||
$invalid_properties[] = "invalid value for '{{name}}', must be one of {{#allowableValues}}{{#values}}'{{{this}}}'{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}.";
|
||||
}
|
||||
|
||||
{{/isContainer}}
|
||||
|
@ -165,7 +165,7 @@ class EnumArrays implements ArrayAccess
|
||||
$invalid_properties = [];
|
||||
$allowed_values = [">=", "$"];
|
||||
if (!in_array($this->container['just_symbol'], $allowed_values)) {
|
||||
$invalid_properties[] = "invalid value for 'just_symbol', must be one of #{allowed_values}.";
|
||||
$invalid_properties[] = "invalid value for 'just_symbol', must be one of '>=', '$'.";
|
||||
}
|
||||
|
||||
return $invalid_properties;
|
||||
|
@ -191,17 +191,17 @@ class EnumTest implements ArrayAccess
|
||||
$invalid_properties = [];
|
||||
$allowed_values = ["UPPER", "lower", ""];
|
||||
if (!in_array($this->container['enum_string'], $allowed_values)) {
|
||||
$invalid_properties[] = "invalid value for 'enum_string', must be one of #{allowed_values}.";
|
||||
$invalid_properties[] = "invalid value for 'enum_string', must be one of 'UPPER', 'lower', ''.";
|
||||
}
|
||||
|
||||
$allowed_values = ["1", "-1"];
|
||||
if (!in_array($this->container['enum_integer'], $allowed_values)) {
|
||||
$invalid_properties[] = "invalid value for 'enum_integer', must be one of #{allowed_values}.";
|
||||
$invalid_properties[] = "invalid value for 'enum_integer', must be one of '1', '-1'.";
|
||||
}
|
||||
|
||||
$allowed_values = ["1.1", "-1.2"];
|
||||
if (!in_array($this->container['enum_number'], $allowed_values)) {
|
||||
$invalid_properties[] = "invalid value for 'enum_number', must be one of #{allowed_values}.";
|
||||
$invalid_properties[] = "invalid value for 'enum_number', must be one of '1.1', '-1.2'.";
|
||||
}
|
||||
|
||||
return $invalid_properties;
|
||||
|
@ -173,7 +173,7 @@ class Order implements ArrayAccess
|
||||
$invalid_properties = [];
|
||||
$allowed_values = ["placed", "approved", "delivered"];
|
||||
if (!in_array($this->container['status'], $allowed_values)) {
|
||||
$invalid_properties[] = "invalid value for 'status', must be one of #{allowed_values}.";
|
||||
$invalid_properties[] = "invalid value for 'status', must be one of 'placed', 'approved', 'delivered'.";
|
||||
}
|
||||
|
||||
return $invalid_properties;
|
||||
|
@ -179,7 +179,7 @@ class Pet implements ArrayAccess
|
||||
}
|
||||
$allowed_values = ["available", "pending", "sold"];
|
||||
if (!in_array($this->container['status'], $allowed_values)) {
|
||||
$invalid_properties[] = "invalid value for 'status', must be one of #{allowed_values}.";
|
||||
$invalid_properties[] = "invalid value for 'status', must be one of 'available', 'pending', 'sold'.";
|
||||
}
|
||||
|
||||
return $invalid_properties;
|
||||
|
Loading…
x
Reference in New Issue
Block a user