Skip to content

Commit 1d6e97a

Browse files
authored
Consider 2xx a successful status (#238)
1 parent 35b08b1 commit 1d6e97a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/routes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ const getRequestInfoTypes = ({ requestInfos, parsedSchemas, operationId, default
117117

118118
const isSuccessStatus = (status) =>
119119
(config.defaultResponseAsSuccess && status === "default") ||
120-
(+status >= SUCCESS_RESPONSE_STATUS_RANGE[0] && +status < SUCCESS_RESPONSE_STATUS_RANGE[1]);
120+
(+status >= SUCCESS_RESPONSE_STATUS_RANGE[0] && +status < SUCCESS_RESPONSE_STATUS_RANGE[1]) ||
121+
status === "2xx";
121122

122123
const parseRoute = (route) => {
123124
const pathParamMatches = (route || "").match(

0 commit comments

Comments
 (0)