From 852d8432b5b49dda834bc52d66c8ded17c075229 Mon Sep 17 00:00:00 2001 From: Christian Wolff Date: Mon, 28 Feb 2022 13:30:19 +0100 Subject: [PATCH] Support Status Code Ranges 2XX, 3XX, 4XX, 5XX fixes #158 --- src/PSR7/SpecFinder.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/PSR7/SpecFinder.php b/src/PSR7/SpecFinder.php index 8d586895..2b0a5030 100644 --- a/src/PSR7/SpecFinder.php +++ b/src/PSR7/SpecFinder.php @@ -211,6 +211,10 @@ public function findResponseSpec($addr): ResponseSpec $response = $operation->responses->getResponse((string) $addr->responseCode()); + if(! $response){ + $response = $operation->responses->getResponse(substr($addr->responseCode(),0,1) . 'XX'); + } + if (! $response) { $response = $operation->responses->getResponse('default'); }