apie-lib /
openapi-schema
| 1 | <?php |
||
| 2 | |||
| 3 | |||
| 4 | namespace Apie\OpenapiSchema\Spec; |
||
| 5 | |||
| 6 | use Apie\OpenapiSchema\Concerns\CompositeValueObjectWithExtension; |
||
| 7 | use Apie\OpenapiSchema\Map\MediaTypeMap; |
||
| 8 | use Apie\ValueObjects\ValueObjectInterface; |
||
| 9 | |||
| 10 | class RequestBody implements ValueObjectInterface |
||
| 11 | { |
||
| 12 | use CompositeValueObjectWithExtension; |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 13 | |||
| 14 | /** |
||
| 15 | * @var string|null |
||
| 16 | */ |
||
| 17 | private $description; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var MediaTypeMap |
||
| 21 | */ |
||
| 22 | private $content; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var bool|null |
||
| 26 | */ |
||
| 27 | private $required = false; |
||
| 28 | |||
| 29 | public function __construct(MediaTypeMap $content) |
||
| 30 | { |
||
| 31 | $this->content = $content; |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @return string|null |
||
| 36 | */ |
||
| 37 | public function getDescription(): ?string |
||
| 38 | { |
||
| 39 | return $this->description; |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @return MediaTypeMap |
||
| 44 | */ |
||
| 45 | public function getContent(): MediaTypeMap |
||
| 46 | { |
||
| 47 | return $this->content; |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @return bool|null |
||
| 52 | */ |
||
| 53 | public function isRequired(): ?bool |
||
| 54 | { |
||
| 55 | return $this->required ?? false; |
||
| 56 | } |
||
| 57 | } |
||
| 58 |