-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Description
Description
This is a non-operational issue, but in the php client, the allowableValues are listed in a response error message when a model property is constrained by enum. In the current (2.2.2-SNAPSHOT) version, this value is not correct, which gives an incorrect error message to the caller
For example:
definitions:
PaymentMethods:
properties:
cardTypes:
type: string
enum:
- Visa
- Discover
- AmexThe generated code looks like this:
public function listInvalidProperties()
{
$invalid_properties = [];
$allowed_values = ["Visa", "Discover", "Amex"];
if (!in_array($this->container['card_types'], $allowed_values)) {
$invalid_properties[] = "invalid value for 'card_types', must be one of #{allowed_values}.";
}
return $invalid_properties;
}