Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 21 additions & 19 deletions src/Attributes/ParameterTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,31 @@ public function __construct(
?bool $allowReserved = null,
?array $spaceDelimited = null,
?array $pipeDelimited = null,
mixed $deepObject = null,
// annotation
?array $x = null,
?array $attachables = null
) {
parent::__construct([
'parameter' => $parameter ?? Generator::UNDEFINED,
'name' => $name ?? Generator::UNDEFINED,
'description' => $description,
// next two are special as we override the default value for specific Parameter subclasses
'in' => $in ?? (Generator::isDefault($this->in) ? Generator::UNDEFINED : $this->in),
'required' => $required ?? (Generator::isDefault($this->required) ? Generator::UNDEFINED : $this->required),
'deprecated' => $deprecated ?? Generator::UNDEFINED,
'allowEmptyValue' => $allowEmptyValue ?? Generator::UNDEFINED,
'ref' => $ref ?? Generator::UNDEFINED,
'example' => $example,
'style' => $style ?? Generator::UNDEFINED,
'explode' => $explode ?? Generator::UNDEFINED,
'allowReserved' => $allowReserved ?? Generator::UNDEFINED,
'spaceDelimited' => $spaceDelimited ?? Generator::UNDEFINED,
'pipeDelimited' => $pipeDelimited ?? Generator::UNDEFINED,
'x' => $x ?? Generator::UNDEFINED,
'attachables' => $attachables ?? Generator::UNDEFINED,
'value' => $this->combine($schema, $examples, $content),
]);
'parameter' => $parameter ?? Generator::UNDEFINED,
'name' => $name ?? Generator::UNDEFINED,
'description' => $description,
// next two are special as we override the default value for specific Parameter subclasses
'in' => $in ?? (Generator::isDefault($this->in) ? Generator::UNDEFINED : $this->in),
'required' => $required ?? (Generator::isDefault($this->required) ? Generator::UNDEFINED : $this->required),
'deprecated' => $deprecated ?? Generator::UNDEFINED,
'allowEmptyValue' => $allowEmptyValue ?? Generator::UNDEFINED,
'ref' => $ref ?? Generator::UNDEFINED,
'example' => $example,
'style' => $style ?? Generator::UNDEFINED,
'explode' => $explode ?? Generator::UNDEFINED,
'allowReserved' => $allowReserved ?? Generator::UNDEFINED,
'spaceDelimited' => $spaceDelimited ?? Generator::UNDEFINED,
'pipeDelimited' => $pipeDelimited ?? Generator::UNDEFINED,
'deepObject' => $deepObject ?? Generator::UNDEFINED,
'x' => $x ?? Generator::UNDEFINED,
'attachables' => $attachables ?? Generator::UNDEFINED,
'value' => $this->combine($schema, $examples, $content),
]);
}
}
2 changes: 1 addition & 1 deletion tests/Annotations/AttributesSyncTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class AttributesSyncTest extends OpenApiTestCase

public static $PATHITEM_EXCLUSIONS = ['get', 'put', 'post', 'delete', 'options', 'head', 'patch', 'trace'];

public static $PARAMETER_EXCLUSIONS = ['matrix', 'label', 'form', 'simple', 'deepObject'];
public static $PARAMETER_EXCLUSIONS = ['matrix', 'label', 'form', 'simple'];

public function testCounts(): void
{
Expand Down