Skip to content

Commit 97093c0

Browse files
committed
[JsonSchema] Only build schemas which can be serialized / deserialied
1 parent 73a4c32 commit 97093c0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/JsonSchema/SchemaFactory.php

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

77+
if ('input' === $type && !($operation?->canDeserialize() ?? true)) {
78+
return $schema;
79+
}
80+
81+
if ('output' === $type && !($operation?->canSerialize() ?? true)) {
82+
return $schema;
83+
}
84+
7785
$validationGroups = $operation ? $this->getValidationGroups($operation) : [];
7886
$version = $schema->getVersion();
7987
$definitionName = $this->definitionNameFactory->create($className, $format, $inputOrOutputClass, $operation, $serializerContext);

0 commit comments

Comments
 (0)