forked from zircote/swagger-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAbstractResponsible.php
More file actions
38 lines (33 loc) · 820 Bytes
/
AbstractResponsible.php
File metadata and controls
38 lines (33 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace OpenApi\Examples\Polymorphism;
use OpenApi\Annotations as OA;
/**
* @OA\Schema(
* schema="Responsible",
* @OA\Discriminator(
* propertyName="type",
* mapping={
* "fl": "#/components/schemas/FlResponsible",
* "employee": "#/components/schemas/EmployeeResponsible"
* }
* ),
* oneOf={
* @OA\Schema(ref="#/components/schemas/FlResponsible"),
* @OA\Schema(ref="#/components/schemas/EmployeeResponsible")
* }
* )
*/
abstract class AbstractResponsible
{
protected const TYPE = null;
/**
* @OA\Property(nullable=false, enum={"employee", "assignee", "fl"})
*
* @var string
*/
protected $type;
public function __construct()
{
$this->type = static::TYPE;
}
}