Skip to content

Commit 18ee659

Browse files
[Backport #1957 to 5.x] Add missing deepObject parameter to attribute Parameter (#1958)
* BACKPORT --------- Co-authored-by: Martin Rademacher <mano@radebatz.net>
1 parent 9a81026 commit 18ee659

2 files changed

Lines changed: 22 additions & 20 deletions

File tree

src/Attributes/ParameterTrait.php

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,29 +36,31 @@ public function __construct(
3636
?bool $allowReserved = null,
3737
?array $spaceDelimited = null,
3838
?array $pipeDelimited = null,
39+
mixed $deepObject = null,
3940
// annotation
4041
?array $x = null,
4142
?array $attachables = null
4243
) {
4344
parent::__construct([
44-
'parameter' => $parameter ?? Generator::UNDEFINED,
45-
'name' => $name ?? Generator::UNDEFINED,
46-
'description' => $description,
47-
// next two are special as we override the default value for specific Parameter subclasses
48-
'in' => $in ?? (Generator::isDefault($this->in) ? Generator::UNDEFINED : $this->in),
49-
'required' => $required ?? (Generator::isDefault($this->required) ? Generator::UNDEFINED : $this->required),
50-
'deprecated' => $deprecated ?? Generator::UNDEFINED,
51-
'allowEmptyValue' => $allowEmptyValue ?? Generator::UNDEFINED,
52-
'ref' => $ref ?? Generator::UNDEFINED,
53-
'example' => $example,
54-
'style' => $style ?? Generator::UNDEFINED,
55-
'explode' => $explode ?? Generator::UNDEFINED,
56-
'allowReserved' => $allowReserved ?? Generator::UNDEFINED,
57-
'spaceDelimited' => $spaceDelimited ?? Generator::UNDEFINED,
58-
'pipeDelimited' => $pipeDelimited ?? Generator::UNDEFINED,
59-
'x' => $x ?? Generator::UNDEFINED,
60-
'attachables' => $attachables ?? Generator::UNDEFINED,
61-
'value' => $this->combine($schema, $examples, $content),
62-
]);
45+
'parameter' => $parameter ?? Generator::UNDEFINED,
46+
'name' => $name ?? Generator::UNDEFINED,
47+
'description' => $description,
48+
// next two are special as we override the default value for specific Parameter subclasses
49+
'in' => $in ?? (Generator::isDefault($this->in) ? Generator::UNDEFINED : $this->in),
50+
'required' => $required ?? (Generator::isDefault($this->required) ? Generator::UNDEFINED : $this->required),
51+
'deprecated' => $deprecated ?? Generator::UNDEFINED,
52+
'allowEmptyValue' => $allowEmptyValue ?? Generator::UNDEFINED,
53+
'ref' => $ref ?? Generator::UNDEFINED,
54+
'example' => $example,
55+
'style' => $style ?? Generator::UNDEFINED,
56+
'explode' => $explode ?? Generator::UNDEFINED,
57+
'allowReserved' => $allowReserved ?? Generator::UNDEFINED,
58+
'spaceDelimited' => $spaceDelimited ?? Generator::UNDEFINED,
59+
'pipeDelimited' => $pipeDelimited ?? Generator::UNDEFINED,
60+
'deepObject' => $deepObject ?? Generator::UNDEFINED,
61+
'x' => $x ?? Generator::UNDEFINED,
62+
'attachables' => $attachables ?? Generator::UNDEFINED,
63+
'value' => $this->combine($schema, $examples, $content),
64+
]);
6365
}
6466
}

tests/Annotations/AttributesSyncTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class AttributesSyncTest extends OpenApiTestCase
1616
{
1717
public static $SCHEMA_EXCLUSIONS = ['const', 'multipleOf', 'not', 'additionalItems', 'contains', 'dependencies', 'propertyNames'];
1818
public static $PATHITEM_EXCLUSIONS = ['get', 'put', 'post', 'delete', 'options', 'head', 'patch', 'trace'];
19-
public static $PARAMETER_EXCLUSIONS = ['matrix', 'label', 'form', 'simple', 'deepObject'];
19+
public static $PARAMETER_EXCLUSIONS = ['matrix', 'label', 'form', 'simple'];
2020

2121
public function testCounts(): void
2222
{

0 commit comments

Comments
 (0)