From 6f1815584b1fe68c0dc415c8f4d289c4550cd598 Mon Sep 17 00:00:00 2001 From: Anton Sutarmin Date: Fri, 15 Feb 2019 04:29:51 +0300 Subject: [PATCH 1/2] fix: Consider HTTP201 to be successful code --- src/language/typescript.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/language/typescript.ts b/src/language/typescript.ts index eff9b9d..df43660 100644 --- a/src/language/typescript.ts +++ b/src/language/typescript.ts @@ -37,7 +37,7 @@ import { camelize } from 'tslint/lib/utils'; const EMPTY_DEPENDENCIES: TDependency[] = []; const EMPTY_REFS: string[] = []; -const SUCCESSFUL_CODES = ['200', 'default']; +const SUCCESSFUL_CODES = ['200', '201', 'default']; const concatIfL = (condition: boolean, as: A[], a: (as: A[]) => A[]): A[] => (condition ? as.concat(a(as)) : as); const concatIf = (condition: boolean, as: A[], a: A[]): A[] => concatIfL(condition, as, as => a); From b1c01ecef0665eb8a0df030a3388a0c3fd3b381c Mon Sep 17 00:00:00 2001 From: Anton Sutarmin Date: Fri, 15 Feb 2019 13:51:52 +0300 Subject: [PATCH 2/2] chore: add example of http 201 response --- test/specs/yaml/swagger.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/specs/yaml/swagger.yml b/test/specs/yaml/swagger.yml index 073c8a0..531572f 100644 --- a/test/specs/yaml/swagger.yml +++ b/test/specs/yaml/swagger.yml @@ -51,6 +51,10 @@ paths: schema: "$ref": "./common.yml#/definitions/Pet" responses: + '201': + description: Pet successfuly created + schema: + $ref: "./common.yml#/definitions/Pet" '405': description: Invalid input security: