Skip to content

Commit 449d40d

Browse files
committed
fix(openapi): Invalid Hydra type specification
1 parent 73569fc commit 449d40d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Hydra/JsonSchema/SchemaFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@ public function buildSchema(string $className, string $format = 'jsonld', string
9292
unset($schema['items']);
9393

9494
switch ($schema->getVersion()) {
95-
// JSON Schema + OpenAPI 3.1
9695
case Schema::VERSION_OPENAPI:
96+
$nullableStringDefinition = ['type' => 'string', 'nullable' => true];
97+
break;
9798
case Schema::VERSION_JSON_SCHEMA:
9899
$nullableStringDefinition = ['type' => ['string', 'null']];
99100
break;
100-
// Swagger
101101
default:
102102
$nullableStringDefinition = ['type' => 'string'];
103103
break;

0 commit comments

Comments
 (0)