| 1 |
<?php declare(strict_types=1); |
| 2 |
|
| 3 |
/** |
| 4 |
* @license Apache 2.0 |
| 5 |
*/ |
| 6 |
|
| 7 |
namespace OpenApi\Attributes; |
| 8 |
|
| 9 |
use OpenApi\Annotations as OA; |
| 10 |
use OpenApi\Generator; |
| 11 |
|
| 12 |
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] |
| 13 |
class RequestBody extends OA\RequestBody |
| 14 |
{ |
| 15 |
/** |
| 16 |
* @param string|class-string|object|null $ref |
| 17 |
* @param array<MediaType|JsonContent|XmlContent>|MediaType|JsonContent|XmlContent|Attachable|null $content |
| 18 |
* @param array<string,mixed>|null $x |
| 19 |
* @param list<Attachable>|null $attachables |
| 20 |
*/ |
| 21 |
public function __construct( |
| 22 |
string|object|null $ref = null, |
| 23 |
?string $request = null, |
| 24 |
?string $description = Generator::UNDEFINED, |
| 25 |
?bool $required = null, |
| 26 |
array|MediaType|JsonContent|XmlContent|Attachable|null $content = null, |
| 27 |
|
| 28 |
// abstract annotation |
| 29 |
?array $x = null, |
| 30 |
?array $attachables = null |
| 31 |
) { |
| 32 |
parent::__construct([ |
| 33 |
'ref' => $ref ?? Generator::UNDEFINED, |
| 34 |
'request' => $request ?? Generator::UNDEFINED, |
| 35 |
'description' => $description, |
| 36 |
'required' => $required ?? Generator::UNDEFINED, |
| 37 |
'x' => $x ?? Generator::UNDEFINED, |
| 38 |
'attachables' => $attachables ?? Generator::UNDEFINED, |
| 39 |
'value' => $this->combine($content), |
| 40 |
]); |
| 41 |
} |
| 42 |
} |