@@ -93,12 +93,10 @@ public function __invoke(array $context = []): OpenApi
93
93
$ resourceShortName = $ resourceMetadata ->getShortName ();
94
94
95
95
// Items needs to be parsed first to be able to reference the lines from the collection operation
96
- [$ itemOperationLinks , $ itemOperationSchemas ] = $ this ->collectPaths ($ resourceMetadata , $ resourceClass , OperationType::ITEM , $ context , $ paths , $ links , $ schemas );
97
- $ this ->appendSchemaDefinitions ($ schemas , $ itemOperationSchemas );
98
- [$ collectionOperationLinks , $ collectionOperationSchemas ] = $ this ->collectPaths ($ resourceMetadata , $ resourceClass , OperationType::COLLECTION , $ context , $ paths , $ links , $ schemas );
96
+ $ this ->collectPaths ($ resourceMetadata , $ resourceClass , OperationType::ITEM , $ context , $ paths , $ links , $ schemas );
97
+ $ this ->collectPaths ($ resourceMetadata , $ resourceClass , OperationType::COLLECTION , $ context , $ paths , $ links , $ schemas );
99
98
100
- [$ subresourceOperationLinks , $ subresourceOperationSchemas ] = $ this ->collectPaths ($ resourceMetadata , $ resourceClass , OperationType::SUBRESOURCE , $ context , $ paths , $ links , $ schemas );
101
- $ this ->appendSchemaDefinitions ($ schemas , $ collectionOperationSchemas );
99
+ $ this ->collectPaths ($ resourceMetadata , $ resourceClass , OperationType::SUBRESOURCE , $ context , $ paths , $ links , $ schemas );
102
100
}
103
101
104
102
$ securitySchemes = $ this ->getSecuritySchemes ();
@@ -125,10 +123,7 @@ public function __invoke(array $context = []): OpenApi
125
123
);
126
124
}
127
125
128
- /**
129
- * @return array | array
130
- */
131
- private function collectPaths (ResourceMetadata $ resourceMetadata , string $ resourceClass , string $ operationType , array $ context , Model \Paths $ paths , array &$ links , \ArrayObject $ schemas ): array
126
+ private function collectPaths (ResourceMetadata $ resourceMetadata , string $ resourceClass , string $ operationType , array $ context , Model \Paths $ paths , array &$ links , \ArrayObject $ schemas ): void
132
127
{
133
128
$ resourceShortName = $ resourceMetadata ->getShortName ();
134
129
$ operations = OperationType::COLLECTION === $ operationType ? $ resourceMetadata ->getCollectionOperations () : (OperationType::ITEM === $ operationType ? $ resourceMetadata ->getItemOperations () : $ this ->subresourceOperationFactory ->create ($ resourceClass ));
0 commit comments