mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-03 22:20:56 +00:00
Fix enum generation for php-symfony generator (#14105)
* fix(symfony): enum generation * docs(php symfony): update samples and docs
This commit is contained in:
parent
8a2a059887
commit
efdc94b113
@ -35,5 +35,6 @@ use JMS\Serializer\Annotation\SerializedName;
|
||||
* @package {{modelPackage}}
|
||||
* @author OpenAPI Generator team
|
||||
*/
|
||||
{{>model_generic}}
|
||||
{{#isEnum}}{{>model_enum}}{{/isEnum}}
|
||||
{{^isEnum}}{{>model_generic}}{{/isEnum}}
|
||||
{{/model}}{{/models}}
|
||||
|
@ -41,6 +41,7 @@ use JMS\Serializer\Annotation\SerializedName;
|
||||
* @package OpenAPI\Server\Model
|
||||
* @author OpenAPI Generator team
|
||||
*/
|
||||
|
||||
class ApiResponse
|
||||
{
|
||||
/**
|
||||
|
@ -41,6 +41,7 @@ use JMS\Serializer\Annotation\SerializedName;
|
||||
* @package OpenAPI\Server\Model
|
||||
* @author OpenAPI Generator team
|
||||
*/
|
||||
|
||||
class Category
|
||||
{
|
||||
/**
|
||||
|
@ -44,12 +44,25 @@ use JMS\Serializer\Annotation\SerializedName;
|
||||
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,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -41,6 +41,7 @@ use JMS\Serializer\Annotation\SerializedName;
|
||||
* @package OpenAPI\Server\Model
|
||||
* @author OpenAPI Generator team
|
||||
*/
|
||||
|
||||
class Order
|
||||
{
|
||||
/**
|
||||
|
@ -41,6 +41,7 @@ use JMS\Serializer\Annotation\SerializedName;
|
||||
* @package OpenAPI\Server\Model
|
||||
* @author OpenAPI Generator team
|
||||
*/
|
||||
|
||||
class Pet
|
||||
{
|
||||
/**
|
||||
|
@ -41,6 +41,7 @@ use JMS\Serializer\Annotation\SerializedName;
|
||||
* @package OpenAPI\Server\Model
|
||||
* @author OpenAPI Generator team
|
||||
*/
|
||||
|
||||
class Tag
|
||||
{
|
||||
/**
|
||||
|
@ -41,6 +41,7 @@ use JMS\Serializer\Annotation\SerializedName;
|
||||
* @package OpenAPI\Server\Model
|
||||
* @author OpenAPI Generator team
|
||||
*/
|
||||
|
||||
class User
|
||||
{
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user