Skip to content

Commit 114f173

Browse files
committed
Assert successful response status from 200 incl. up to 400 excl.
1 parent 0aaf053 commit 114f173

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Swagger yaml generator",
44
"keywords": ["api", "swagger", "open auth"],
55
"license": "MIT",
6-
"version": "1.4.9",
6+
"version": "1.4.10",
77
"authors": [
88
{
99
"name": "Digit",

oa/Response.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,9 @@ protected static function getDefaultResponse(string $contentType, int $status =
244244
*/
245245
protected static function isSuccessStatus($status): bool
246246
{
247-
return in_array((int)$status, [200, 201, 202, 204], true);
247+
$statusInt = (int)$status;
248+
249+
return $statusInt >= 200 && $statusInt < 400;
248250
}
249251

250252
/**

0 commit comments

Comments
 (0)