The trait Apie\OpenapiSchema\Conce...alueObjectWithExtension requires the property $name which is not provided by Apie\OpenapiSchema\Spec\ServerVariable.
Loading history...
18
19
/**
20
* @var string
21
*/
22
private $default;
23
24
/**
25
* @var string|null
26
*/
27
private $description;
28
29
/**
30
* @var StringList|null
31
*/
32
private $enums = null;
33
34
public function __construct(string $default, ?string $description, string... $enums)
35
{
36
$this->default = $default;
37
$this->description = $description;
38
if (!empty($enums)) {
39
$this->enums = StringList::fromNative($enums);
40
}
41
$this->validateProperties();
42
$this->specificationExtension = new SpecificationExtension([]);
43
}
44
45
protected function validateProperties(): void
46
{
47
if (!empty($this->enums) && !in_array($this->default, $this->enums->toNative(), true)) {
48
throw new DefaultValueNotInEnum($this->default, ...$this->enums);