diff --git a/src/JsonSchema/SchemaFactory.php b/src/JsonSchema/SchemaFactory.php index 7014020afc4..1583202ea05 100644 --- a/src/JsonSchema/SchemaFactory.php +++ b/src/JsonSchema/SchemaFactory.php @@ -80,6 +80,14 @@ public function buildSchema(string $className, string $format = 'json', string $ return $schema; } + if ('input' === $type && !($operation?->canDeserialize() ?? true)) { + return $schema; + } + + if ('output' === $type && !($operation?->canSerialize() ?? true)) { + return $schema; + } + $validationGroups = $operation ? $this->getValidationGroups($operation) : []; $version = $schema->getVersion(); $method = $operation instanceof HttpOperation ? $operation->getMethod() : 'GET';