Skip to content

Commit 3b3af5d

Browse files
author
Artem Parkhomenko
committed
add using SUCCESSFUL_CODES constant
1 parent 214f22d commit 3b3af5d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/language/typescript/3.0/serializers/operation-object.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
getTypeName,
66
getURL,
77
HTTPMethod,
8+
SUCCESSFUL_CODES,
89
XHRResponseType,
910
} from '../../common/utils';
1011
import {
@@ -257,9 +258,9 @@ export const serializeOperationObject = combineReader(
257258
);
258259

259260
const serializedResponses = serializeResponsesObject(from)(operation.responses);
260-
261261
const responseType: XHRResponseType = pipe(
262-
lookup('200', operation.responses),
262+
SUCCESSFUL_CODES,
263+
array.findFirstMap(code => lookup(code, operation.responses)),
263264
chain(response =>
264265
ReferenceObjectCodec.is(response)
265266
? fromEither(e.resolveRef(response.$ref, ResponseObjectCodec))

0 commit comments

Comments
 (0)