diff --git a/src/Metadata/Extractor/XmlResourceExtractor.php b/src/Metadata/Extractor/XmlResourceExtractor.php index 7f6c037450..85dc61fdf4 100644 --- a/src/Metadata/Extractor/XmlResourceExtractor.php +++ b/src/Metadata/Extractor/XmlResourceExtractor.php @@ -224,12 +224,12 @@ private function buildOpenapi(\SimpleXMLElement $resource): bool|OpenApiOperatio in: $this->phpize($parameter, 'in', 'string'), description: $this->phpize($parameter, 'description', 'string'), required: $this->phpize($parameter, 'required', 'bool'), - deprecated: $this->phpize($parameter, 'deprecated', 'bool'), - allowEmptyValue: $this->phpize($parameter, 'allowEmptyValue', 'bool'), - schema: isset($parameter->schema->values) ? $this->buildValues($parameter->schema->values) : null, + deprecated: $this->phpize($parameter, 'deprecated', 'bool', false), + allowEmptyValue: $this->phpize($parameter, 'allowEmptyValue', 'bool', null), + schema: isset($parameter->schema->values) ? $this->buildValues($parameter->schema->values) : [], style: $this->phpize($parameter, 'style', 'string'), - explode: $this->phpize($parameter, 'explode', 'bool'), - allowReserved: $this->phpize($parameter, 'allowReserved', 'bool'), + explode: $this->phpize($parameter, 'explode', 'bool', false), + allowReserved: $this->phpize($parameter, 'allowReserved', 'bool', null), example: $this->phpize($parameter, 'example', 'string'), examples: isset($parameter->examples->values) ? new \ArrayObject($this->buildValues($parameter->examples->values)) : null, content: isset($parameter->content->values) ? new \ArrayObject($this->buildValues($parameter->content->values)) : null, diff --git a/src/OpenApi/Model/Parameter.php b/src/OpenApi/Model/Parameter.php index 918da61514..793e582b43 100644 --- a/src/OpenApi/Model/Parameter.php +++ b/src/OpenApi/Model/Parameter.php @@ -17,7 +17,7 @@ final class Parameter { use ExtensionTrait; - public function __construct(private string $name, private string $in, private string $description = '', private bool $required = false, private bool $deprecated = false, private bool $allowEmptyValue = false, private array $schema = [], private ?string $style = null, private bool $explode = false, private bool $allowReserved = false, private $example = null, private ?\ArrayObject $examples = null, private ?\ArrayObject $content = null) + public function __construct(private string $name, private string $in, private string $description = '', private bool $required = false, private bool $deprecated = false, private ?bool $allowEmptyValue = false, private array $schema = [], private ?string $style = null, private bool $explode = false, private ?bool $allowReserved = false, private $example = null, private ?\ArrayObject $examples = null, private ?\ArrayObject $content = null) { if (null === $style) { if ('query' === $in || 'cookie' === $in) { @@ -148,7 +148,7 @@ public function withDeprecated(bool $deprecated): self return $clone; } - public function withAllowEmptyValue(bool $allowEmptyValue): self + public function withAllowEmptyValue(?bool $allowEmptyValue): self { $clone = clone $this; $clone->allowEmptyValue = $allowEmptyValue; @@ -180,7 +180,7 @@ public function withExplode(bool $explode): self return $clone; } - public function withAllowReserved(bool $allowReserved): self + public function withAllowReserved(?bool $allowReserved): self { $clone = clone $this; $clone->allowReserved = $allowReserved;