[PHP] error when deserializing enums #4032 (#4886)

* fixed enum template; added enum handling to ObjectSerializer

* regenerated templates

* improved InvalidArgumentException message

* regenerated sample client

* added value check of OuterEnum during sanitization

* regenerated samples
This commit is contained in:
baartosz
2017-03-08 11:08:42 +00:00
committed by wing328
parent 2bb7626202
commit d21e156071
7 changed files with 164 additions and 20 deletions

View File

@@ -29,8 +29,6 @@
namespace Swagger\Client\Model;
use \ArrayAccess;
/**
* EnumClass Class Doc Comment
*
@@ -40,11 +38,25 @@ use \ArrayAccess;
* @link https://github.com/swagger-api/swagger-codegen
*/
class EnumClass {
/**
* Possible values of this enum
*/
const ABC = '_abc';
const EFG = '-efg';
const XYZ = '(xyz)';
/**
* Gets allowable values of the enum
* @return string[]
*/
public static function getAllowableEnumValues()
{
return [
self::ABC,
self::EFG,
self::XYZ,
];
}
}

View File

@@ -29,8 +29,6 @@
namespace Swagger\Client\Model;
use \ArrayAccess;
/**
* OuterEnum Class Doc Comment
*
@@ -40,11 +38,25 @@ use \ArrayAccess;
* @link https://github.com/swagger-api/swagger-codegen
*/
class OuterEnum {
/**
* Possible values of this enum
*/
const PLACED = 'placed';
const APPROVED = 'approved';
const DELIVERED = 'delivered';
/**
* Gets allowable values of the enum
* @return string[]
*/
public static function getAllowableEnumValues()
{
return [
self::PLACED,
self::APPROVED,
self::DELIVERED,
];
}
}