diff --git a/src/PSR7/Validators/HeadersValidator.php b/src/PSR7/Validators/HeadersValidator.php index cc2a2caf..981d7463 100755 --- a/src/PSR7/Validators/HeadersValidator.php +++ b/src/PSR7/Validators/HeadersValidator.php @@ -41,7 +41,7 @@ public function validate(OperationAddress $addr, MessageInterface $message): voi foreach ($message->getHeader($header) as $headerValue) { try { - $validator->validate($parameter->deserialize($headerValue), $spec->schema); + $validator->validate($parameter->deserialize($headerValue), $parameter->getSchema()); } catch (SchemaMismatch $exception) { throw InvalidHeaders::becauseValueDoesNotMatchSchema($header, $headerValue, $addr, $exception); }