Skip to content

Commit e026794

Browse files
authored
Fix duplicate attachables (zircote#1744)
1 parent 18457fa commit e026794

29 files changed

+43
-31
lines changed

src/Attributes/AdditionalProperties.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function __construct(
103103
'oneOf' => $oneOf ?? Generator::UNDEFINED,
104104
'x' => $x ?? Generator::UNDEFINED,
105105
'attachables' => $attachables ?? Generator::UNDEFINED,
106-
'value' => $this->combine($items, $discriminator, $externalDocs, $additionalProperties, $attachables),
106+
'value' => $this->combine($items, $discriminator, $externalDocs, $additionalProperties),
107107
]);
108108
}
109109
}

src/Attributes/Components.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function __construct(
4242
'callbacks' => $callbacks ?? Generator::UNDEFINED,
4343
'x' => $x ?? Generator::UNDEFINED,
4444
'attachables' => $attachables ?? Generator::UNDEFINED,
45-
'value' => $this->combine($schemas, $responses, $parameters, $examples, $requestBodies, $headers, $securitySchemes, $links, $attachables),
45+
'value' => $this->combine($schemas, $responses, $parameters, $examples, $requestBodies, $headers, $securitySchemes, $links),
4646
]);
4747
}
4848
}

src/Attributes/Contact.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function __construct(
2929
'url' => $url ?? Generator::UNDEFINED,
3030
'email' => $email ?? Generator::UNDEFINED,
3131
'x' => $x ?? Generator::UNDEFINED,
32-
'value' => $this->combine($attachables),
32+
'attachables' => $attachables ?? Generator::UNDEFINED,
3333
]);
3434
}
3535
}

src/Attributes/Discriminator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function __construct(
2828
'propertyName' => $propertyName ?? Generator::UNDEFINED,
2929
'mapping' => $mapping ?? Generator::UNDEFINED,
3030
'x' => $x ?? Generator::UNDEFINED,
31-
'value' => $this->combine($attachables),
31+
'attachables' => $attachables ?? Generator::UNDEFINED,
3232
]);
3333
}
3434
}

src/Attributes/Examples.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ public function __construct(
3636
'externalValue' => $externalValue ?? Generator::UNDEFINED,
3737
'ref' => $ref ?? Generator::UNDEFINED,
3838
'x' => $x ?? Generator::UNDEFINED,
39+
'attachables' => $attachables ?? Generator::UNDEFINED,
3940
]);
40-
if ($attachables) {
41-
$this->merge($attachables);
42-
}
4341
}
4442
}

src/Attributes/ExternalDocumentation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function __construct(
2727
'description' => $description ?? Generator::UNDEFINED,
2828
'url' => $url ?? Generator::UNDEFINED,
2929
'x' => $x ?? Generator::UNDEFINED,
30-
'value' => $this->combine($attachables),
30+
'attachables' => $attachables ?? Generator::UNDEFINED,
3131
]);
3232
}
3333
}

src/Attributes/Flow.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct(
3434
'flow' => $flow ?? Generator::UNDEFINED,
3535
'scopes' => $scopes ?? Generator::UNDEFINED,
3636
'x' => $x ?? Generator::UNDEFINED,
37-
'value' => $this->combine($attachables),
37+
'attachables' => $attachables ?? Generator::UNDEFINED,
3838
]);
3939
}
4040
}

src/Attributes/Header.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public function __construct(
3636
'deprecated' => $deprecated ?? Generator::UNDEFINED,
3737
'allowEmptyValue' => $allowEmptyValue ?? Generator::UNDEFINED,
3838
'x' => $x ?? Generator::UNDEFINED,
39-
'value' => $this->combine($attachables, $schema),
39+
'attachables' => $attachables ?? Generator::UNDEFINED,
40+
'value' => $this->combine($schema),
4041
]);
4142
}
4243
}

src/Attributes/Info.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ public function __construct(
3333
'title' => $title ?? Generator::UNDEFINED,
3434
'termsOfService' => $termsOfService ?? Generator::UNDEFINED,
3535
'x' => $x ?? Generator::UNDEFINED,
36-
'value' => $this->combine($contact, $license, $attachables),
36+
'attachables' => $attachables ?? Generator::UNDEFINED,
37+
'value' => $this->combine($contact, $license),
3738
]);
3839
}
3940
}

src/Attributes/Items.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function __construct(
106106
// annotation
107107
'x' => $x ?? Generator::UNDEFINED,
108108
'attachables' => $attachables ?? Generator::UNDEFINED,
109-
'value' => $this->combine($items, $discriminator, $externalDocs, $attachables),
109+
'value' => $this->combine($items, $discriminator, $externalDocs),
110110
]);
111111
}
112112
}

src/Attributes/JsonContent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public function __construct(
130130
// annotation
131131
'x' => $x ?? Generator::UNDEFINED,
132132
'attachables' => $attachables ?? Generator::UNDEFINED,
133-
'value' => $this->combine($items, $discriminator, $externalDocs, $attachables),
133+
'value' => $this->combine($items, $discriminator, $externalDocs),
134134
]);
135135
}
136136
}

src/Attributes/License.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function __construct(
2929
'identifier' => $identifier ?? Generator::UNDEFINED,
3030
'url' => $url ?? Generator::UNDEFINED,
3131
'x' => $x ?? Generator::UNDEFINED,
32-
'value' => $this->combine($attachables),
32+
'attachables' => $attachables ?? Generator::UNDEFINED,
3333
]);
3434
}
3535
}

src/Attributes/Link.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ public function __construct(
4040
'requestBody' => $requestBody ?? Generator::UNDEFINED,
4141
'description' => $description ?? Generator::UNDEFINED,
4242
'x' => $x ?? Generator::UNDEFINED,
43-
'value' => $this->combine($server, $attachables),
43+
'attachables' => $attachables ?? Generator::UNDEFINED,
44+
'value' => $this->combine($server),
4445
]);
4546
}
4647
}

src/Attributes/MediaType.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ public function __construct(
3333
'example' => $example,
3434
'encoding' => $encoding ?? Generator::UNDEFINED,
3535
'x' => $x ?? Generator::UNDEFINED,
36-
'value' => $this->combine($schema, $examples, $attachables),
36+
'attachables' => $attachables ?? Generator::UNDEFINED,
37+
'value' => $this->combine($schema, $examples),
3738
]);
3839
}
3940
}

src/Attributes/OpenApi.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ public function __construct(
3939
'openapi' => $openapi,
4040
'security' => $security ?? Generator::UNDEFINED,
4141
'x' => $x ?? Generator::UNDEFINED,
42-
'value' => $this->combine($info, $servers, $tags, $externalDocs, $paths, $components, $webhooks, $attachables),
42+
'attachables' => $attachables ?? Generator::UNDEFINED,
43+
'value' => $this->combine($info, $servers, $tags, $externalDocs, $paths, $components, $webhooks),
4344
]);
4445
}
4546
}

src/Attributes/OperationTrait.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ public function __construct(
4747
'callbacks' => $callbacks ?? Generator::UNDEFINED,
4848
'deprecated' => $deprecated ?? Generator::UNDEFINED,
4949
'x' => $x ?? Generator::UNDEFINED,
50-
'value' => $this->combine($requestBody, $responses, $parameters, $externalDocs, $attachables),
50+
'attachables' => $attachables ?? Generator::UNDEFINED,
51+
'value' => $this->combine($requestBody, $responses, $parameters, $externalDocs),
5152
]);
5253
}
5354
}

src/Attributes/ParameterTrait.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ public function __construct(
5656
'spaceDelimited' => $spaceDelimited ?? Generator::UNDEFINED,
5757
'pipeDelimited' => $pipeDelimited ?? Generator::UNDEFINED,
5858
'x' => $x ?? Generator::UNDEFINED,
59-
'value' => $this->combine($schema, $examples, $content, $attachables),
59+
'attachables' => $attachables ?? Generator::UNDEFINED,
60+
'value' => $this->combine($schema, $examples, $content),
6061
]);
6162
}
6263
}

src/Attributes/PathItem.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ public function __construct(
4444
'summary' => $summary ?? Generator::UNDEFINED,
4545
'description' => $description ?? Generator::UNDEFINED,
4646
'x' => $x ?? Generator::UNDEFINED,
47-
'value' => $this->combine($get, $put, $post, $delete, $options, $head, $patch, $trace, $servers, $parameters, $attachables),
47+
'attachables' => $attachables ?? Generator::UNDEFINED,
48+
'value' => $this->combine($get, $put, $post, $delete, $options, $head, $patch, $trace, $servers, $parameters),
4849
]);
4950
}
5051
}

src/Attributes/Property.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public function __construct(
108108
// annotation
109109
'x' => $x ?? Generator::UNDEFINED,
110110
'attachables' => $attachables ?? Generator::UNDEFINED,
111-
'value' => $this->combine($items, $discriminator, $externalDocs, $attachables),
111+
'value' => $this->combine($items, $discriminator, $externalDocs),
112112
]);
113113
}
114114
}

src/Attributes/RequestBody.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ public function __construct(
3434
'description' => $description ?? Generator::UNDEFINED,
3535
'required' => $required ?? Generator::UNDEFINED,
3636
'x' => $x ?? Generator::UNDEFINED,
37-
'value' => $this->combine($content, $attachables),
37+
'attachables' => $attachables ?? Generator::UNDEFINED,
38+
'value' => $this->combine($content),
3839
]);
3940
}
4041
}

src/Attributes/Response.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public function __construct(
3636
'response' => $response ?? Generator::UNDEFINED,
3737
'description' => $description ?? Generator::UNDEFINED,
3838
'x' => $x ?? Generator::UNDEFINED,
39-
'value' => $this->combine($headers, $content, $links, $attachables),
39+
'attachables' => $attachables ?? Generator::UNDEFINED,
40+
'value' => $this->combine($headers, $content, $links),
4041
]);
4142
}
4243
}

src/Attributes/Schema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public function __construct(
108108
'const' => $const,
109109
'x' => $x ?? Generator::UNDEFINED,
110110
'attachables' => $attachables ?? Generator::UNDEFINED,
111-
'value' => $this->combine($items, $discriminator, $externalDocs, $examples, $attachables),
111+
'value' => $this->combine($items, $discriminator, $externalDocs, $examples),
112112
]);
113113
}
114114
}

src/Attributes/SecurityScheme.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ public function __construct(
4545
'scheme' => $scheme ?? Generator::UNDEFINED,
4646
'openIdConnectUrl' => $openIdConnectUrl ?? Generator::UNDEFINED,
4747
'x' => $x ?? Generator::UNDEFINED,
48-
'value' => $this->combine($flows, $attachables),
48+
'attachables' => $attachables ?? Generator::UNDEFINED,
49+
'value' => $this->combine($flows),
4950
]);
5051
}
5152
}

src/Attributes/Server.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ public function __construct(
2929
'url' => $url ?? Generator::UNDEFINED,
3030
'description' => $description ?? Generator::UNDEFINED,
3131
'x' => $x ?? Generator::UNDEFINED,
32-
'value' => $this->combine($variables, $attachables),
32+
'attachables' => $attachables ?? Generator::UNDEFINED,
33+
'value' => $this->combine($variables),
3334
]);
3435
}
3536
}

src/Attributes/ServerVariable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct(
3434
'enum' => $enum ?? Generator::UNDEFINED,
3535
'variables' => $variables ?? Generator::UNDEFINED,
3636
'x' => $x ?? Generator::UNDEFINED,
37-
'value' => $this->combine($attachables),
37+
'attachables' => $attachables ?? Generator::UNDEFINED,
3838
]);
3939
}
4040
}

src/Attributes/Tag.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ public function __construct(
2828
'name' => $name ?? Generator::UNDEFINED,
2929
'description' => $description ?? Generator::UNDEFINED,
3030
'x' => $x ?? Generator::UNDEFINED,
31-
'value' => $this->combine($externalDocs, $attachables),
31+
'attachables' => $attachables ?? Generator::UNDEFINED,
32+
'value' => $this->combine($externalDocs),
3233
]);
3334
}
3435
}

src/Attributes/Webhook.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ public function __construct(
4646
'summary' => $summary ?? Generator::UNDEFINED,
4747
'description' => $description ?? Generator::UNDEFINED,
4848
'x' => $x ?? Generator::UNDEFINED,
49-
'value' => $this->combine($get, $put, $post, $delete, $options, $head, $patch, $trace, $servers, $parameters, $attachables),
49+
'attachables' => $attachables ?? Generator::UNDEFINED,
50+
'value' => $this->combine($get, $put, $post, $delete, $options, $head, $patch, $trace, $servers, $parameters),
5051
]);
5152
}
5253
}

src/Attributes/Xml.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct(
3333
'attribute' => $attribute ?? Generator::UNDEFINED,
3434
'wrapped' => $wrapped ?? Generator::UNDEFINED,
3535
'x' => $x ?? Generator::UNDEFINED,
36-
'value' => $this->combine($attachables),
36+
'attachables' => $attachables ?? Generator::UNDEFINED,
3737
]);
3838
}
3939
}

src/Attributes/XmlContent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function __construct(
109109
// annotation
110110
'x' => $x ?? Generator::UNDEFINED,
111111
'attachables' => $attachables ?? Generator::UNDEFINED,
112-
'value' => $this->combine($items, $discriminator, $externalDocs, $attachables),
112+
'value' => $this->combine($items, $discriminator, $externalDocs),
113113
]);
114114
}
115115
}

0 commit comments

Comments
 (0)