Fix enum generation for php-symfony generator (#14105)

* fix(symfony): enum generation

* docs(php symfony): update samples and docs
This commit is contained in:
renaud-twd
2022-12-27 05:42:41 -10:00
committed by GitHub
parent 8a2a059887
commit efdc94b113
8 changed files with 26 additions and 6 deletions

View File

@@ -41,6 +41,7 @@ use JMS\Serializer\Annotation\SerializedName;
* @package OpenAPI\Server\Model
* @author OpenAPI Generator team
*/
class ApiResponse
{
/**

View File

@@ -41,6 +41,7 @@ use JMS\Serializer\Annotation\SerializedName;
* @package OpenAPI\Server\Model
* @author OpenAPI Generator team
*/
class Category
{
/**

View File

@@ -41,15 +41,28 @@ use JMS\Serializer\Annotation\SerializedName;
* @package OpenAPI\Server\Model
* @author OpenAPI Generator team
*/
class EnumStringModel
class EnumStringModel
{
/**
* Constructor
* @param array|null $data Associated array of property values initializing the model
/**
* Possible values of this enum
*/
public function __construct(array $data = null)
const AVAILABLE = "available";
const PENDING = "pending";
const SOLD = "sold";
/**
* Gets allowable values of the enum
* @return string[]
*/
public static function getAllowableEnumValues()
{
return [
self::AVAILABLE,
self::PENDING,
self::SOLD,
];
}
}

View File

@@ -41,6 +41,7 @@ use JMS\Serializer\Annotation\SerializedName;
* @package OpenAPI\Server\Model
* @author OpenAPI Generator team
*/
class Order
{
/**

View File

@@ -41,6 +41,7 @@ use JMS\Serializer\Annotation\SerializedName;
* @package OpenAPI\Server\Model
* @author OpenAPI Generator team
*/
class Pet
{
/**

View File

@@ -41,6 +41,7 @@ use JMS\Serializer\Annotation\SerializedName;
* @package OpenAPI\Server\Model
* @author OpenAPI Generator team
*/
class Tag
{
/**

View File

@@ -41,6 +41,7 @@ use JMS\Serializer\Annotation\SerializedName;
* @package OpenAPI\Server\Model
* @author OpenAPI Generator team
*/
class User
{
/**