Skip to content

Commit e404ed2

Browse files
GeLoLabsGeLo
authored andcommitted
[JsonSchema] Only build schemas which can be serialized / deserialied
1 parent 332272c commit e404ed2

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/JsonSchema/SchemaFactory.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,14 @@ public function buildSchema(string $className, string $format = 'json', string $
8080
return $schema;
8181
}
8282

83+
if ('input' === $type && !($operation?->canDeserialize() ?? true)) {
84+
return $schema;
85+
}
86+
87+
if ('output' === $type && !($operation?->canSerialize() ?? true)) {
88+
return $schema;
89+
}
90+
8391
$validationGroups = $operation ? $this->getValidationGroups($operation) : [];
8492
$version = $schema->getVersion();
8593
$method = $operation instanceof HttpOperation ? $operation->getMethod() : 'GET';

0 commit comments

Comments
 (0)