Skip to content

Commit

Permalink
Validation only when body content is present
Browse files Browse the repository at this point in the history
  • Loading branch information
koriym committed Jan 20, 2024
1 parent 246016b commit 9264022
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/JsonSchema/Interceptor/JsonSchemaInterceptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function invoke(MethodInvocation $invocation): ResourceObject

$ro = $invocation->proceed();
assert($ro instanceof ResourceObject);
if ($ro->code === 200 || $ro->code === 201) {
if ($ro->body && $ro->code === 200 || $ro->code === 201) {
$this->validateResponse($ro, $jsonSchema);
}

Expand Down

0 comments on commit 9264022

Please sign in to comment.