diff --git a/src/Preparator/ExamplesPreparator.php b/src/Preparator/ExamplesPreparator.php index 5bbec4a..1cc5bbc 100644 --- a/src/Preparator/ExamplesPreparator.php +++ b/src/Preparator/ExamplesPreparator.php @@ -66,9 +66,14 @@ private function prepareTestCases(Operation $operation): iterable return $examples ->map( - fn (OperationExample $example) => $this->buildTestCase( - $example->setAutoComplete($this->config->autoComplete) - ) + function (OperationExample $example) { + if ($this->config->response->statusCode !== null) { + $example->setStatusCode($this->config->response->statusCode); + } + $example->setAutoComplete($this->config->autoComplete); + + return $this->buildTestCase($example); + } ) ; }