Skip to content

Commit 2bd5d0f

Browse files
committed
Small bug fix to ensure required is an array and not an object
1 parent d22c657 commit 2bd5d0f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/OpenApi/OpenApiGenerator.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,13 @@ private function buildSchema(Resource $resource, array $schema, array $overrides
9696
return array_replace_recursive(
9797
[
9898
'type' => 'object',
99-
'required' => array_filter([
100-
'type',
101-
$hasAttributes ? 'attributes' : null,
102-
$hasRelationships ? 'relationships' : null,
103-
]),
99+
'required' => array_values(
100+
array_filter([
101+
'type',
102+
$hasAttributes ? 'attributes' : null,
103+
$hasRelationships ? 'relationships' : null,
104+
])
105+
),
104106
'properties' => [
105107
'type' => ['type' => 'string', 'const' => $resource->type()],
106108
'attributes' => ['type' => 'object'] + ($schema['attributes'] ?? []),

0 commit comments

Comments
 (0)