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