Skip to content

Commit b19b33d

Browse files
sutarminraveclassic
authored andcommitted
fix: Consider HTTP201 to be successful code (#28)
* fix: Consider HTTP201 to be successful code * chore: add example of http 201 response
1 parent a76be11 commit b19b33d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Diff for: src/language/typescript.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import { camelize } from 'tslint/lib/utils';
3737

3838
const EMPTY_DEPENDENCIES: TDependency[] = [];
3939
const EMPTY_REFS: string[] = [];
40-
const SUCCESSFUL_CODES = ['200', 'default'];
40+
const SUCCESSFUL_CODES = ['200', '201', 'default'];
4141

4242
const concatIfL = <A>(condition: boolean, as: A[], a: (as: A[]) => A[]): A[] => (condition ? as.concat(a(as)) : as);
4343
const concatIf = <A>(condition: boolean, as: A[], a: A[]): A[] => concatIfL(condition, as, as => a);

Diff for: test/specs/yaml/swagger.yml

+4
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ paths:
5151
schema:
5252
"$ref": "./common.yml#/definitions/Pet"
5353
responses:
54+
'201':
55+
description: Pet successfuly created
56+
schema:
57+
$ref: "./common.yml#/definitions/Pet"
5458
'405':
5559
description: Invalid input
5660
security:

0 commit comments

Comments
 (0)