Skip to content

Commit cf61d6f

Browse files
committed
Revert "Don't include empty schema"
This reverts commit 8235126.
1 parent bd06b05 commit cf61d6f

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/OpenApi/OpenApiGenerator.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,8 @@ private function buildSchema(Resource $resource, array $schema, array $overrides
9595
'properties' => [
9696
'type' => ['type' => 'string', 'const' => $resource->type()],
9797
'id' => ['type' => 'string'],
98-
'attributes' => !empty($schema['attributes'])
99-
? ['type' => 'object'] + $schema['attributes']
100-
: [],
101-
'relationships' => !empty($schema['relationships'])
102-
? ['type' => 'object'] + $schema['relationships']
103-
: [],
98+
'attributes' => ['type' => 'object'] + ($schema['attributes'] ?? []),
99+
'relationships' => ['type' => 'object'] + ($schema['relationships'] ?? []),
104100
],
105101
],
106102
$overrides,

0 commit comments

Comments
 (0)