diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache index a56053fc829..fcc366f710d 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache @@ -108,15 +108,15 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.22" - jackson_version = "2.10.5" - jackson_databind_version = "2.10.5.1" + swagger_annotations_version = "1.6.3" + jackson_version = "2.13.0" + jackson_databind_version = "2.13.0" {{#openApiNullable}} jackson_databind_nullable_version = "0.2.1" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" - jersey_version = "2.27" - junit_version = "4.13.1" + jersey_version = "2.35" + junit_version = "4.13.2" {{#threetenbp}} threetenbp_version = "2.9.10" {{/threetenbp}} @@ -124,7 +124,7 @@ ext { scribejava_apis_version = "6.9.0" {{/hasOAuthMethods}} {{#hasHttpSignatureMethods}} - tomitribe_http_signatures_version = "1.5" + tomitribe_http_signatures_version = "1.7" {{/hasHttpSignatureMethods}} } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache index 4a87eaeed45..50303b928e1 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache @@ -371,21 +371,21 @@ UTF-8 - 1.6.1 - 2.30.1 - 2.10.5 - 2.10.5.1 + 1.6.3 + 2.35 + 2.13.0 + 2.13.0 0.2.1 {{#threetenbp}} 2.9.10 {{/threetenbp}} 1.3.5 -{{#useBeanValidation}} - 2.0.2 -{{/useBeanValidation}} - 4.13.1 + {{#useBeanValidation}} + 2.0.2 + {{/useBeanValidation}} + 4.13.2 {{#hasHttpSignatureMethods}} - 1.5 + 1.7 {{/hasHttpSignatureMethods}} {{#hasOAuthMethods}} 6.9.0 diff --git a/modules/openapi-generator/src/main/resources/typescript/api/api.mustache b/modules/openapi-generator/src/main/resources/typescript/api/api.mustache index e128db13904..4ccded577e4 100644 --- a/modules/openapi-generator/src/main/resources/typescript/api/api.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/api/api.mustache @@ -200,7 +200,7 @@ export class {{classname}}ResponseProcessor { return body; {{/is2xx}} {{^is2xx}} - throw new ApiException<{{{dataType}}}>({{code}}, "{{message}}", body); + throw new ApiException<{{{dataType}}}>({{code}}, "{{message}}", body, response.headers); {{/is2xx}} {{/dataType}} {{^dataType}} @@ -208,7 +208,7 @@ export class {{classname}}ResponseProcessor { return; {{/is2xx}} {{^is2xx}} - throw new ApiException(response.httpStatusCode, "{{message}}", undefined); + throw new ApiException(response.httpStatusCode, "{{message}}", undefined, response.headers); {{/is2xx}} {{/dataType}} } @@ -233,7 +233,7 @@ export class {{classname}}ResponseProcessor { {{/returnType}} } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } {{/operation}} diff --git a/modules/openapi-generator/src/main/resources/typescript/api/exception.mustache b/modules/openapi-generator/src/main/resources/typescript/api/exception.mustache index aa91d14ebb8..9365d33a8f7 100644 --- a/modules/openapi-generator/src/main/resources/typescript/api/exception.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/api/exception.mustache @@ -8,7 +8,8 @@ * */ export class ApiException extends Error { - public constructor(public code: number, message: string, public body: T) { - super("HTTP-Code: " + code + "\nMessage: " + message + "\nBody: " + JSON.stringify(body)) + public constructor(public code: number, message: string, public body: T, public headers: { [key: string]: string; }) { + super("HTTP-Code: " + code + "\nMessage: " + message + "\nBody: " + JSON.stringify(body) + "\nHeaders: " + + JSON.stringify(headers)) } } diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle b/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle index e70647c7424..346045b3e5d 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle @@ -96,13 +96,13 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.22" - jackson_version = "2.10.5" - jackson_databind_version = "2.10.5.1" + swagger_annotations_version = "1.6.3" + jackson_version = "2.13.0" + jackson_databind_version = "2.13.0" jackson_databind_nullable_version = "0.2.1" jakarta_annotation_version = "1.3.5" - jersey_version = "2.27" - junit_version = "4.13.1" + jersey_version = "2.35" + junit_version = "4.13.2" scribejava_apis_version = "6.9.0" } diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml b/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml index cbbdb8ce35d..fe5cc8b2cce 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml @@ -301,13 +301,13 @@ UTF-8 - 1.6.1 - 2.30.1 - 2.10.5 - 2.10.5.1 + 1.6.3 + 2.35 + 2.13.0 + 2.13.0 0.2.1 1.3.5 - 4.13.1 + 4.13.2 6.9.0 diff --git a/samples/client/petstore/java/jersey2-java8/build.gradle b/samples/client/petstore/java/jersey2-java8/build.gradle index ba735353092..cdefe2ed3cb 100644 --- a/samples/client/petstore/java/jersey2-java8/build.gradle +++ b/samples/client/petstore/java/jersey2-java8/build.gradle @@ -96,13 +96,13 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.22" - jackson_version = "2.10.5" - jackson_databind_version = "2.10.5.1" + swagger_annotations_version = "1.6.3" + jackson_version = "2.13.0" + jackson_databind_version = "2.13.0" jackson_databind_nullable_version = "0.2.1" jakarta_annotation_version = "1.3.5" - jersey_version = "2.27" - junit_version = "4.13.1" + jersey_version = "2.35" + junit_version = "4.13.2" scribejava_apis_version = "6.9.0" } diff --git a/samples/client/petstore/java/jersey2-java8/pom.xml b/samples/client/petstore/java/jersey2-java8/pom.xml index deffd3c8cc1..114bc87e72c 100644 --- a/samples/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/client/petstore/java/jersey2-java8/pom.xml @@ -301,13 +301,13 @@ UTF-8 - 1.6.1 - 2.30.1 - 2.10.5 - 2.10.5.1 + 1.6.3 + 2.35 + 2.13.0 + 2.13.0 0.2.1 1.3.5 - 4.13.1 + 4.13.2 6.9.0 diff --git a/samples/client/petstore/python-asyncio/test_python3.sh b/samples/client/petstore/python-asyncio/test_python3.sh index 580b2182b51..fc91ee7a670 100755 --- a/samples/client/petstore/python-asyncio/test_python3.sh +++ b/samples/client/petstore/python-asyncio/test_python3.sh @@ -11,7 +11,7 @@ export LANG=en_US.UTF-8 ### set virtualenv if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --no-site-packages --always-copy --python python3.6 + virtualenv $VENV --always-copy --python python3 source $VENV/bin/activate DEACTIVE=true fi diff --git a/samples/client/petstore/python-legacy/test_python2.sh b/samples/client/petstore/python-legacy/test_python2.sh index c751423528d..a4faa81ca71 100755 --- a/samples/client/petstore/python-legacy/test_python2.sh +++ b/samples/client/petstore/python-legacy/test_python2.sh @@ -11,7 +11,7 @@ export LANG=en_US.UTF-8 ### set virtualenv if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --no-site-packages --always-copy --python python + virtualenv $VENV --always-copy --python python source $VENV/bin/activate DEACTIVE=true fi diff --git a/samples/client/petstore/python-legacy/test_python2_and_3.sh b/samples/client/petstore/python-legacy/test_python2_and_3.sh index ab02e6e4080..ef758bd4450 100755 --- a/samples/client/petstore/python-legacy/test_python2_and_3.sh +++ b/samples/client/petstore/python-legacy/test_python2_and_3.sh @@ -11,7 +11,7 @@ export LANG=en_US.UTF-8 ### set virtualenv if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --no-site-packages --always-copy + virtualenv $VENV --always-copy source $VENV/bin/activate DEACTIVE=true fi diff --git a/samples/client/petstore/python-tornado/test_python2_and_3.sh b/samples/client/petstore/python-tornado/test_python2_and_3.sh index ab02e6e4080..ef758bd4450 100755 --- a/samples/client/petstore/python-tornado/test_python2_and_3.sh +++ b/samples/client/petstore/python-tornado/test_python2_and_3.sh @@ -11,7 +11,7 @@ export LANG=en_US.UTF-8 ### set virtualenv if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --no-site-packages --always-copy + virtualenv $VENV --always-copy source $VENV/bin/activate DEACTIVE=true fi diff --git a/samples/client/petstore/python/test_python.sh b/samples/client/petstore/python/test_python.sh index 6f5e2c41d3a..f617f3adfa6 100644 --- a/samples/client/petstore/python/test_python.sh +++ b/samples/client/petstore/python/test_python.sh @@ -11,7 +11,7 @@ export LANG=en_US.UTF-8 ### set virtualenv if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --no-site-packages --always-copy + virtualenv $VENV --always-copy source $VENV/bin/activate DEACTIVE=true fi diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test_python.sh b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test_python.sh index 6f5e2c41d3a..f617f3adfa6 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test_python.sh +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test_python.sh @@ -11,7 +11,7 @@ export LANG=en_US.UTF-8 ### set virtualenv if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --no-site-packages --always-copy + virtualenv $VENV --always-copy source $VENV/bin/activate DEACTIVE=true fi diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle index b422fd584fe..24d7c0eb341 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle @@ -96,13 +96,13 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.22" - jackson_version = "2.10.5" - jackson_databind_version = "2.10.5.1" + swagger_annotations_version = "1.6.3" + jackson_version = "2.13.0" + jackson_databind_version = "2.13.0" jackson_databind_nullable_version = "0.2.1" jakarta_annotation_version = "1.3.5" - jersey_version = "2.27" - junit_version = "4.13.1" + jersey_version = "2.35" + junit_version = "4.13.2" threetenbp_version = "2.9.10" } diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml index 4b679de53da..008335f4466 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml @@ -302,13 +302,13 @@ UTF-8 - 1.6.1 - 2.30.1 - 2.10.5 - 2.10.5.1 + 1.6.3 + 2.35 + 2.13.0 + 2.13.0 0.2.1 2.9.10 1.3.5 - 4.13.1 + 4.13.2 diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle index 5a1312b5f80..79e4c46e4c3 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle @@ -96,13 +96,13 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.22" - jackson_version = "2.10.5" - jackson_databind_version = "2.10.5.1" + swagger_annotations_version = "1.6.3" + jackson_version = "2.13.0" + jackson_databind_version = "2.13.0" jackson_databind_nullable_version = "0.2.1" jakarta_annotation_version = "1.3.5" - jersey_version = "2.27" - junit_version = "4.13.1" + jersey_version = "2.35" + junit_version = "4.13.2" } dependencies { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml index ac61d729960..359dda5143e 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml @@ -296,12 +296,12 @@ UTF-8 - 1.6.1 - 2.30.1 - 2.10.5 - 2.10.5.1 + 1.6.3 + 2.35 + 2.13.0 + 2.13.0 0.2.1 1.3.5 - 4.13.1 + 4.13.2 diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle b/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle index 2a964a5d092..9e7ef31e808 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle +++ b/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle @@ -96,15 +96,15 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.22" - jackson_version = "2.10.5" - jackson_databind_version = "2.10.5.1" + swagger_annotations_version = "1.6.3" + jackson_version = "2.13.0" + jackson_databind_version = "2.13.0" jackson_databind_nullable_version = "0.2.1" jakarta_annotation_version = "1.3.5" - jersey_version = "2.27" - junit_version = "4.13.1" + jersey_version = "2.35" + junit_version = "4.13.2" scribejava_apis_version = "6.9.0" - tomitribe_http_signatures_version = "1.5" + tomitribe_http_signatures_version = "1.7" } dependencies { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml b/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml index 0de23c35d49..416ff72b7eb 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml @@ -306,14 +306,14 @@ UTF-8 - 1.6.1 - 2.30.1 - 2.10.5 - 2.10.5.1 + 1.6.3 + 2.35 + 2.13.0 + 2.13.0 0.2.1 1.3.5 - 4.13.1 - 1.5 + 4.13.2 + 1.7 6.9.0 diff --git a/samples/openapi3/client/petstore/python-legacy/test_python2.sh b/samples/openapi3/client/petstore/python-legacy/test_python2.sh index c0e21a11605..dbf254b0961 100755 --- a/samples/openapi3/client/petstore/python-legacy/test_python2.sh +++ b/samples/openapi3/client/petstore/python-legacy/test_python2.sh @@ -11,7 +11,7 @@ export LANG=en_US.UTF-8 ### set virtualenv if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --no-site-packages --always-copy + virtualenv $VENV --always-copy source $VENV/bin/activate DEACTIVE=true fi diff --git a/samples/openapi3/client/petstore/python-legacy/test_python2_and_3.sh b/samples/openapi3/client/petstore/python-legacy/test_python2_and_3.sh index ab02e6e4080..ef758bd4450 100755 --- a/samples/openapi3/client/petstore/python-legacy/test_python2_and_3.sh +++ b/samples/openapi3/client/petstore/python-legacy/test_python2_and_3.sh @@ -11,7 +11,7 @@ export LANG=en_US.UTF-8 ### set virtualenv if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --no-site-packages --always-copy + virtualenv $VENV --always-copy source $VENV/bin/activate DEACTIVE=true fi diff --git a/samples/openapi3/client/petstore/python/test_python.sh b/samples/openapi3/client/petstore/python/test_python.sh index 6f5e2c41d3a..f617f3adfa6 100755 --- a/samples/openapi3/client/petstore/python/test_python.sh +++ b/samples/openapi3/client/petstore/python/test_python.sh @@ -11,7 +11,7 @@ export LANG=en_US.UTF-8 ### set virtualenv if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --no-site-packages --always-copy + virtualenv $VENV --always-copy source $VENV/bin/activate DEACTIVE=true fi diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/apis/DefaultApi.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/apis/DefaultApi.ts index 0f8397d59a4..59a3ac16973 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/apis/DefaultApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/apis/DefaultApi.ts @@ -134,7 +134,7 @@ export class DefaultApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -159,7 +159,7 @@ export class DefaultApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -184,7 +184,7 @@ export class DefaultApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } } diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/apis/exception.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/apis/exception.ts index aa91d14ebb8..9365d33a8f7 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/apis/exception.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/apis/exception.ts @@ -8,7 +8,8 @@ * */ export class ApiException extends Error { - public constructor(public code: number, message: string, public body: T) { - super("HTTP-Code: " + code + "\nMessage: " + message + "\nBody: " + JSON.stringify(body)) + public constructor(public code: number, message: string, public body: T, public headers: { [key: string]: string; }) { + super("HTTP-Code: " + code + "\nMessage: " + message + "\nBody: " + JSON.stringify(body) + "\nHeaders: " + + JSON.stringify(headers)) } } diff --git a/samples/openapi3/client/petstore/typescript/builds/default/apis/PetApi.ts b/samples/openapi3/client/petstore/typescript/builds/default/apis/PetApi.ts index dc53ef953c3..ff3b13bc845 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/apis/PetApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/apis/PetApi.ts @@ -402,7 +402,7 @@ export class PetApiResponseProcessor { return body; } if (isCodeInRange("405", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid input", undefined); + throw new ApiException(response.httpStatusCode, "Invalid input", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -414,7 +414,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -427,7 +427,7 @@ export class PetApiResponseProcessor { public async deletePet(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid pet value", undefined); + throw new ApiException(response.httpStatusCode, "Invalid pet value", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -435,7 +435,7 @@ export class PetApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -455,7 +455,7 @@ export class PetApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid status value", undefined); + throw new ApiException(response.httpStatusCode, "Invalid status value", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -467,7 +467,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -487,7 +487,7 @@ export class PetApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid tag value", undefined); + throw new ApiException(response.httpStatusCode, "Invalid tag value", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -499,7 +499,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -519,10 +519,10 @@ export class PetApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Pet not found", undefined); + throw new ApiException(response.httpStatusCode, "Pet not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -534,7 +534,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -554,13 +554,13 @@ export class PetApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Pet not found", undefined); + throw new ApiException(response.httpStatusCode, "Pet not found", undefined, response.headers); } if (isCodeInRange("405", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Validation exception", undefined); + throw new ApiException(response.httpStatusCode, "Validation exception", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -572,7 +572,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -585,7 +585,7 @@ export class PetApiResponseProcessor { public async updatePetWithForm(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("405", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid input", undefined); + throw new ApiException(response.httpStatusCode, "Invalid input", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -593,7 +593,7 @@ export class PetApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -622,7 +622,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } } diff --git a/samples/openapi3/client/petstore/typescript/builds/default/apis/StoreApi.ts b/samples/openapi3/client/petstore/typescript/builds/default/apis/StoreApi.ts index ec9b8046595..46cf6d33efc 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/apis/StoreApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/apis/StoreApi.ts @@ -145,10 +145,10 @@ export class StoreApiResponseProcessor { public async deleteOrder(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Order not found", undefined); + throw new ApiException(response.httpStatusCode, "Order not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -156,7 +156,7 @@ export class StoreApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -185,7 +185,7 @@ export class StoreApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -205,10 +205,10 @@ export class StoreApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Order not found", undefined); + throw new ApiException(response.httpStatusCode, "Order not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -220,7 +220,7 @@ export class StoreApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -240,7 +240,7 @@ export class StoreApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid Order", undefined); + throw new ApiException(response.httpStatusCode, "Invalid Order", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -252,7 +252,7 @@ export class StoreApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } } diff --git a/samples/openapi3/client/petstore/typescript/builds/default/apis/UserApi.ts b/samples/openapi3/client/petstore/typescript/builds/default/apis/UserApi.ts index 29b98b35ad0..99a7c43b2e5 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/apis/UserApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/apis/UserApi.ts @@ -333,7 +333,7 @@ export class UserApiResponseProcessor { public async createUser(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("0", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "successful operation", undefined); + throw new ApiException(response.httpStatusCode, "successful operation", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -341,7 +341,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -354,7 +354,7 @@ export class UserApiResponseProcessor { public async createUsersWithArrayInput(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("0", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "successful operation", undefined); + throw new ApiException(response.httpStatusCode, "successful operation", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -362,7 +362,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -375,7 +375,7 @@ export class UserApiResponseProcessor { public async createUsersWithListInput(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("0", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "successful operation", undefined); + throw new ApiException(response.httpStatusCode, "successful operation", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -383,7 +383,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -396,10 +396,10 @@ export class UserApiResponseProcessor { public async deleteUser(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid username supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid username supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "User not found", undefined); + throw new ApiException(response.httpStatusCode, "User not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -407,7 +407,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -427,10 +427,10 @@ export class UserApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid username supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid username supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "User not found", undefined); + throw new ApiException(response.httpStatusCode, "User not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -442,7 +442,7 @@ export class UserApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -462,7 +462,7 @@ export class UserApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid username/password supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid username/password supplied", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -474,7 +474,7 @@ export class UserApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -487,7 +487,7 @@ export class UserApiResponseProcessor { public async logoutUser(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("0", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "successful operation", undefined); + throw new ApiException(response.httpStatusCode, "successful operation", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -495,7 +495,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -508,10 +508,10 @@ export class UserApiResponseProcessor { public async updateUser(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid user supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid user supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "User not found", undefined); + throw new ApiException(response.httpStatusCode, "User not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -519,7 +519,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } } diff --git a/samples/openapi3/client/petstore/typescript/builds/default/apis/exception.ts b/samples/openapi3/client/petstore/typescript/builds/default/apis/exception.ts index aa91d14ebb8..9365d33a8f7 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/apis/exception.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/apis/exception.ts @@ -8,7 +8,8 @@ * */ export class ApiException extends Error { - public constructor(public code: number, message: string, public body: T) { - super("HTTP-Code: " + code + "\nMessage: " + message + "\nBody: " + JSON.stringify(body)) + public constructor(public code: number, message: string, public body: T, public headers: { [key: string]: string; }) { + super("HTTP-Code: " + code + "\nMessage: " + message + "\nBody: " + JSON.stringify(body) + "\nHeaders: " + + JSON.stringify(headers)) } } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/apis/PetApi.ts b/samples/openapi3/client/petstore/typescript/builds/deno/apis/PetApi.ts index 559a1891e39..9ae92b9b212 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/apis/PetApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/apis/PetApi.ts @@ -400,7 +400,7 @@ export class PetApiResponseProcessor { return body; } if (isCodeInRange("405", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid input", undefined); + throw new ApiException(response.httpStatusCode, "Invalid input", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -412,7 +412,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -425,7 +425,7 @@ export class PetApiResponseProcessor { public async deletePet(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid pet value", undefined); + throw new ApiException(response.httpStatusCode, "Invalid pet value", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -433,7 +433,7 @@ export class PetApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -453,7 +453,7 @@ export class PetApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid status value", undefined); + throw new ApiException(response.httpStatusCode, "Invalid status value", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -465,7 +465,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -485,7 +485,7 @@ export class PetApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid tag value", undefined); + throw new ApiException(response.httpStatusCode, "Invalid tag value", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -497,7 +497,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -517,10 +517,10 @@ export class PetApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Pet not found", undefined); + throw new ApiException(response.httpStatusCode, "Pet not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -532,7 +532,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -552,13 +552,13 @@ export class PetApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Pet not found", undefined); + throw new ApiException(response.httpStatusCode, "Pet not found", undefined, response.headers); } if (isCodeInRange("405", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Validation exception", undefined); + throw new ApiException(response.httpStatusCode, "Validation exception", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -570,7 +570,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -583,7 +583,7 @@ export class PetApiResponseProcessor { public async updatePetWithForm(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("405", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid input", undefined); + throw new ApiException(response.httpStatusCode, "Invalid input", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -591,7 +591,7 @@ export class PetApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -620,7 +620,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/apis/StoreApi.ts b/samples/openapi3/client/petstore/typescript/builds/deno/apis/StoreApi.ts index 77f70936d14..767734aed21 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/apis/StoreApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/apis/StoreApi.ts @@ -143,10 +143,10 @@ export class StoreApiResponseProcessor { public async deleteOrder(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Order not found", undefined); + throw new ApiException(response.httpStatusCode, "Order not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -154,7 +154,7 @@ export class StoreApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -183,7 +183,7 @@ export class StoreApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -203,10 +203,10 @@ export class StoreApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Order not found", undefined); + throw new ApiException(response.httpStatusCode, "Order not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -218,7 +218,7 @@ export class StoreApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -238,7 +238,7 @@ export class StoreApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid Order", undefined); + throw new ApiException(response.httpStatusCode, "Invalid Order", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -250,7 +250,7 @@ export class StoreApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/apis/UserApi.ts b/samples/openapi3/client/petstore/typescript/builds/deno/apis/UserApi.ts index 2b0633cfd20..7caf789d015 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/apis/UserApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/apis/UserApi.ts @@ -331,7 +331,7 @@ export class UserApiResponseProcessor { public async createUser(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("0", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "successful operation", undefined); + throw new ApiException(response.httpStatusCode, "successful operation", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -339,7 +339,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -352,7 +352,7 @@ export class UserApiResponseProcessor { public async createUsersWithArrayInput(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("0", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "successful operation", undefined); + throw new ApiException(response.httpStatusCode, "successful operation", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -360,7 +360,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -373,7 +373,7 @@ export class UserApiResponseProcessor { public async createUsersWithListInput(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("0", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "successful operation", undefined); + throw new ApiException(response.httpStatusCode, "successful operation", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -381,7 +381,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -394,10 +394,10 @@ export class UserApiResponseProcessor { public async deleteUser(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid username supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid username supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "User not found", undefined); + throw new ApiException(response.httpStatusCode, "User not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -405,7 +405,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -425,10 +425,10 @@ export class UserApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid username supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid username supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "User not found", undefined); + throw new ApiException(response.httpStatusCode, "User not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -440,7 +440,7 @@ export class UserApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -460,7 +460,7 @@ export class UserApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid username/password supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid username/password supplied", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -472,7 +472,7 @@ export class UserApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -485,7 +485,7 @@ export class UserApiResponseProcessor { public async logoutUser(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("0", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "successful operation", undefined); + throw new ApiException(response.httpStatusCode, "successful operation", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -493,7 +493,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -506,10 +506,10 @@ export class UserApiResponseProcessor { public async updateUser(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid user supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid user supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "User not found", undefined); + throw new ApiException(response.httpStatusCode, "User not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -517,7 +517,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/apis/exception.ts b/samples/openapi3/client/petstore/typescript/builds/deno/apis/exception.ts index aa91d14ebb8..9365d33a8f7 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/apis/exception.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/apis/exception.ts @@ -8,7 +8,8 @@ * */ export class ApiException extends Error { - public constructor(public code: number, message: string, public body: T) { - super("HTTP-Code: " + code + "\nMessage: " + message + "\nBody: " + JSON.stringify(body)) + public constructor(public code: number, message: string, public body: T, public headers: { [key: string]: string; }) { + super("HTTP-Code: " + code + "\nMessage: " + message + "\nBody: " + JSON.stringify(body) + "\nHeaders: " + + JSON.stringify(headers)) } } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/PetApi.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/PetApi.ts index 67829b24646..9b8cd23af11 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/PetApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/PetApi.ts @@ -405,7 +405,7 @@ export class PetApiResponseProcessor { return body; } if (isCodeInRange("405", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid input", undefined); + throw new ApiException(response.httpStatusCode, "Invalid input", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -417,7 +417,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -430,7 +430,7 @@ export class PetApiResponseProcessor { public async deletePet(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid pet value", undefined); + throw new ApiException(response.httpStatusCode, "Invalid pet value", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -438,7 +438,7 @@ export class PetApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -458,7 +458,7 @@ export class PetApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid status value", undefined); + throw new ApiException(response.httpStatusCode, "Invalid status value", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -470,7 +470,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -490,7 +490,7 @@ export class PetApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid tag value", undefined); + throw new ApiException(response.httpStatusCode, "Invalid tag value", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -502,7 +502,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -522,10 +522,10 @@ export class PetApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Pet not found", undefined); + throw new ApiException(response.httpStatusCode, "Pet not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -537,7 +537,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -557,13 +557,13 @@ export class PetApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Pet not found", undefined); + throw new ApiException(response.httpStatusCode, "Pet not found", undefined, response.headers); } if (isCodeInRange("405", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Validation exception", undefined); + throw new ApiException(response.httpStatusCode, "Validation exception", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -575,7 +575,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -588,7 +588,7 @@ export class PetApiResponseProcessor { public async updatePetWithForm(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("405", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid input", undefined); + throw new ApiException(response.httpStatusCode, "Invalid input", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -596,7 +596,7 @@ export class PetApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -625,7 +625,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/StoreApi.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/StoreApi.ts index c0debef65d5..356d2cfbc4d 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/StoreApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/StoreApi.ts @@ -148,10 +148,10 @@ export class StoreApiResponseProcessor { public async deleteOrder(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Order not found", undefined); + throw new ApiException(response.httpStatusCode, "Order not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -159,7 +159,7 @@ export class StoreApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -188,7 +188,7 @@ export class StoreApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -208,10 +208,10 @@ export class StoreApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Order not found", undefined); + throw new ApiException(response.httpStatusCode, "Order not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -223,7 +223,7 @@ export class StoreApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -243,7 +243,7 @@ export class StoreApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid Order", undefined); + throw new ApiException(response.httpStatusCode, "Invalid Order", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -255,7 +255,7 @@ export class StoreApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/UserApi.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/UserApi.ts index c02aa71b33d..3991a33b383 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/UserApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/UserApi.ts @@ -336,7 +336,7 @@ export class UserApiResponseProcessor { public async createUser(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("0", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "successful operation", undefined); + throw new ApiException(response.httpStatusCode, "successful operation", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -344,7 +344,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -357,7 +357,7 @@ export class UserApiResponseProcessor { public async createUsersWithArrayInput(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("0", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "successful operation", undefined); + throw new ApiException(response.httpStatusCode, "successful operation", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -365,7 +365,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -378,7 +378,7 @@ export class UserApiResponseProcessor { public async createUsersWithListInput(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("0", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "successful operation", undefined); + throw new ApiException(response.httpStatusCode, "successful operation", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -386,7 +386,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -399,10 +399,10 @@ export class UserApiResponseProcessor { public async deleteUser(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid username supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid username supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "User not found", undefined); + throw new ApiException(response.httpStatusCode, "User not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -410,7 +410,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -430,10 +430,10 @@ export class UserApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid username supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid username supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "User not found", undefined); + throw new ApiException(response.httpStatusCode, "User not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -445,7 +445,7 @@ export class UserApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -465,7 +465,7 @@ export class UserApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid username/password supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid username/password supplied", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -477,7 +477,7 @@ export class UserApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -490,7 +490,7 @@ export class UserApiResponseProcessor { public async logoutUser(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("0", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "successful operation", undefined); + throw new ApiException(response.httpStatusCode, "successful operation", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -498,7 +498,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -511,10 +511,10 @@ export class UserApiResponseProcessor { public async updateUser(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid user supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid user supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "User not found", undefined); + throw new ApiException(response.httpStatusCode, "User not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -522,7 +522,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/exception.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/exception.ts index aa91d14ebb8..9365d33a8f7 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/exception.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/exception.ts @@ -8,7 +8,8 @@ * */ export class ApiException extends Error { - public constructor(public code: number, message: string, public body: T) { - super("HTTP-Code: " + code + "\nMessage: " + message + "\nBody: " + JSON.stringify(body)) + public constructor(public code: number, message: string, public body: T, public headers: { [key: string]: string; }) { + super("HTTP-Code: " + code + "\nMessage: " + message + "\nBody: " + JSON.stringify(body) + "\nHeaders: " + + JSON.stringify(headers)) } } diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/apis/PetApi.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/apis/PetApi.ts index 09e6971dd13..a2b9813749e 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/apis/PetApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/apis/PetApi.ts @@ -400,7 +400,7 @@ export class PetApiResponseProcessor { return body; } if (isCodeInRange("405", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid input", undefined); + throw new ApiException(response.httpStatusCode, "Invalid input", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -412,7 +412,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -425,7 +425,7 @@ export class PetApiResponseProcessor { public async deletePet(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid pet value", undefined); + throw new ApiException(response.httpStatusCode, "Invalid pet value", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -433,7 +433,7 @@ export class PetApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -453,7 +453,7 @@ export class PetApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid status value", undefined); + throw new ApiException(response.httpStatusCode, "Invalid status value", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -465,7 +465,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -485,7 +485,7 @@ export class PetApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid tag value", undefined); + throw new ApiException(response.httpStatusCode, "Invalid tag value", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -497,7 +497,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -517,10 +517,10 @@ export class PetApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Pet not found", undefined); + throw new ApiException(response.httpStatusCode, "Pet not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -532,7 +532,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -552,13 +552,13 @@ export class PetApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Pet not found", undefined); + throw new ApiException(response.httpStatusCode, "Pet not found", undefined, response.headers); } if (isCodeInRange("405", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Validation exception", undefined); + throw new ApiException(response.httpStatusCode, "Validation exception", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -570,7 +570,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -583,7 +583,7 @@ export class PetApiResponseProcessor { public async updatePetWithForm(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("405", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid input", undefined); + throw new ApiException(response.httpStatusCode, "Invalid input", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -591,7 +591,7 @@ export class PetApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -620,7 +620,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } } diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/apis/StoreApi.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/apis/StoreApi.ts index db934bc4d72..a8bc438d420 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/apis/StoreApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/apis/StoreApi.ts @@ -143,10 +143,10 @@ export class StoreApiResponseProcessor { public async deleteOrder(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Order not found", undefined); + throw new ApiException(response.httpStatusCode, "Order not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -154,7 +154,7 @@ export class StoreApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -183,7 +183,7 @@ export class StoreApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -203,10 +203,10 @@ export class StoreApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Order not found", undefined); + throw new ApiException(response.httpStatusCode, "Order not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -218,7 +218,7 @@ export class StoreApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -238,7 +238,7 @@ export class StoreApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid Order", undefined); + throw new ApiException(response.httpStatusCode, "Invalid Order", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -250,7 +250,7 @@ export class StoreApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } } diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/apis/UserApi.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/apis/UserApi.ts index b6eb68b8c39..3f493441c39 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/apis/UserApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/apis/UserApi.ts @@ -331,7 +331,7 @@ export class UserApiResponseProcessor { public async createUser(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("0", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "successful operation", undefined); + throw new ApiException(response.httpStatusCode, "successful operation", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -339,7 +339,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -352,7 +352,7 @@ export class UserApiResponseProcessor { public async createUsersWithArrayInput(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("0", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "successful operation", undefined); + throw new ApiException(response.httpStatusCode, "successful operation", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -360,7 +360,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -373,7 +373,7 @@ export class UserApiResponseProcessor { public async createUsersWithListInput(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("0", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "successful operation", undefined); + throw new ApiException(response.httpStatusCode, "successful operation", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -381,7 +381,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -394,10 +394,10 @@ export class UserApiResponseProcessor { public async deleteUser(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid username supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid username supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "User not found", undefined); + throw new ApiException(response.httpStatusCode, "User not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -405,7 +405,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -425,10 +425,10 @@ export class UserApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid username supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid username supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "User not found", undefined); + throw new ApiException(response.httpStatusCode, "User not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -440,7 +440,7 @@ export class UserApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -460,7 +460,7 @@ export class UserApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid username/password supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid username/password supplied", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -472,7 +472,7 @@ export class UserApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -485,7 +485,7 @@ export class UserApiResponseProcessor { public async logoutUser(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("0", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "successful operation", undefined); + throw new ApiException(response.httpStatusCode, "successful operation", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -493,7 +493,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -506,10 +506,10 @@ export class UserApiResponseProcessor { public async updateUser(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid user supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid user supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "User not found", undefined); + throw new ApiException(response.httpStatusCode, "User not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -517,7 +517,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } } diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/apis/exception.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/apis/exception.ts index aa91d14ebb8..9365d33a8f7 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/apis/exception.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/apis/exception.ts @@ -8,7 +8,8 @@ * */ export class ApiException extends Error { - public constructor(public code: number, message: string, public body: T) { - super("HTTP-Code: " + code + "\nMessage: " + message + "\nBody: " + JSON.stringify(body)) + public constructor(public code: number, message: string, public body: T, public headers: { [key: string]: string; }) { + super("HTTP-Code: " + code + "\nMessage: " + message + "\nBody: " + JSON.stringify(body) + "\nHeaders: " + + JSON.stringify(headers)) } } diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/apis/PetApi.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/apis/PetApi.ts index dc53ef953c3..ff3b13bc845 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/apis/PetApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/apis/PetApi.ts @@ -402,7 +402,7 @@ export class PetApiResponseProcessor { return body; } if (isCodeInRange("405", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid input", undefined); + throw new ApiException(response.httpStatusCode, "Invalid input", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -414,7 +414,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -427,7 +427,7 @@ export class PetApiResponseProcessor { public async deletePet(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid pet value", undefined); + throw new ApiException(response.httpStatusCode, "Invalid pet value", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -435,7 +435,7 @@ export class PetApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -455,7 +455,7 @@ export class PetApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid status value", undefined); + throw new ApiException(response.httpStatusCode, "Invalid status value", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -467,7 +467,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -487,7 +487,7 @@ export class PetApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid tag value", undefined); + throw new ApiException(response.httpStatusCode, "Invalid tag value", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -499,7 +499,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -519,10 +519,10 @@ export class PetApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Pet not found", undefined); + throw new ApiException(response.httpStatusCode, "Pet not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -534,7 +534,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -554,13 +554,13 @@ export class PetApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Pet not found", undefined); + throw new ApiException(response.httpStatusCode, "Pet not found", undefined, response.headers); } if (isCodeInRange("405", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Validation exception", undefined); + throw new ApiException(response.httpStatusCode, "Validation exception", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -572,7 +572,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -585,7 +585,7 @@ export class PetApiResponseProcessor { public async updatePetWithForm(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("405", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid input", undefined); + throw new ApiException(response.httpStatusCode, "Invalid input", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -593,7 +593,7 @@ export class PetApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -622,7 +622,7 @@ export class PetApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } } diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/apis/StoreApi.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/apis/StoreApi.ts index ec9b8046595..46cf6d33efc 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/apis/StoreApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/apis/StoreApi.ts @@ -145,10 +145,10 @@ export class StoreApiResponseProcessor { public async deleteOrder(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Order not found", undefined); + throw new ApiException(response.httpStatusCode, "Order not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -156,7 +156,7 @@ export class StoreApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -185,7 +185,7 @@ export class StoreApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -205,10 +205,10 @@ export class StoreApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid ID supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Order not found", undefined); + throw new ApiException(response.httpStatusCode, "Order not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -220,7 +220,7 @@ export class StoreApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -240,7 +240,7 @@ export class StoreApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid Order", undefined); + throw new ApiException(response.httpStatusCode, "Invalid Order", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -252,7 +252,7 @@ export class StoreApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } } diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/apis/UserApi.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/apis/UserApi.ts index 29b98b35ad0..99a7c43b2e5 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/apis/UserApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/apis/UserApi.ts @@ -333,7 +333,7 @@ export class UserApiResponseProcessor { public async createUser(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("0", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "successful operation", undefined); + throw new ApiException(response.httpStatusCode, "successful operation", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -341,7 +341,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -354,7 +354,7 @@ export class UserApiResponseProcessor { public async createUsersWithArrayInput(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("0", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "successful operation", undefined); + throw new ApiException(response.httpStatusCode, "successful operation", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -362,7 +362,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -375,7 +375,7 @@ export class UserApiResponseProcessor { public async createUsersWithListInput(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("0", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "successful operation", undefined); + throw new ApiException(response.httpStatusCode, "successful operation", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -383,7 +383,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -396,10 +396,10 @@ export class UserApiResponseProcessor { public async deleteUser(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid username supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid username supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "User not found", undefined); + throw new ApiException(response.httpStatusCode, "User not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -407,7 +407,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -427,10 +427,10 @@ export class UserApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid username supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid username supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "User not found", undefined); + throw new ApiException(response.httpStatusCode, "User not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -442,7 +442,7 @@ export class UserApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -462,7 +462,7 @@ export class UserApiResponseProcessor { return body; } if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid username/password supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid username/password supplied", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -474,7 +474,7 @@ export class UserApiResponseProcessor { return body; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -487,7 +487,7 @@ export class UserApiResponseProcessor { public async logoutUser(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("0", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "successful operation", undefined); + throw new ApiException(response.httpStatusCode, "successful operation", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -495,7 +495,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** @@ -508,10 +508,10 @@ export class UserApiResponseProcessor { public async updateUser(response: ResponseContext): Promise< void> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("400", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "Invalid user supplied", undefined); + throw new ApiException(response.httpStatusCode, "Invalid user supplied", undefined, response.headers); } if (isCodeInRange("404", response.httpStatusCode)) { - throw new ApiException(response.httpStatusCode, "User not found", undefined); + throw new ApiException(response.httpStatusCode, "User not found", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -519,7 +519,7 @@ export class UserApiResponseProcessor { return; } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny()); + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } } diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/apis/exception.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/apis/exception.ts index aa91d14ebb8..9365d33a8f7 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/apis/exception.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/apis/exception.ts @@ -8,7 +8,8 @@ * */ export class ApiException extends Error { - public constructor(public code: number, message: string, public body: T) { - super("HTTP-Code: " + code + "\nMessage: " + message + "\nBody: " + JSON.stringify(body)) + public constructor(public code: number, message: string, public body: T, public headers: { [key: string]: string; }) { + super("HTTP-Code: " + code + "\nMessage: " + message + "\nBody: " + JSON.stringify(body) + "\nHeaders: " + + JSON.stringify(headers)) } } diff --git a/samples/server/petstore/python-aiohttp-srclayout/test_python3.sh b/samples/server/petstore/python-aiohttp-srclayout/test_python3.sh index 65d96267d4f..43fab931f00 100755 --- a/samples/server/petstore/python-aiohttp-srclayout/test_python3.sh +++ b/samples/server/petstore/python-aiohttp-srclayout/test_python3.sh @@ -11,7 +11,7 @@ export LANG=en_US.UTF-8 ### set virtualenv if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --no-site-packages --always-copy --python python3 + virtualenv $VENV --always-copy --python python3 source $VENV/bin/activate DEACTIVE=true fi diff --git a/samples/server/petstore/python-aiohttp/test_python3.sh b/samples/server/petstore/python-aiohttp/test_python3.sh index 65d96267d4f..43fab931f00 100755 --- a/samples/server/petstore/python-aiohttp/test_python3.sh +++ b/samples/server/petstore/python-aiohttp/test_python3.sh @@ -11,7 +11,7 @@ export LANG=en_US.UTF-8 ### set virtualenv if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --no-site-packages --always-copy --python python3 + virtualenv $VENV --always-copy --python python3 source $VENV/bin/activate DEACTIVE=true fi diff --git a/samples/server/petstore/python-flask/test_python3.sh b/samples/server/petstore/python-flask/test_python3.sh index 677bc926e43..add0ff0c4f2 100755 --- a/samples/server/petstore/python-flask/test_python3.sh +++ b/samples/server/petstore/python-flask/test_python3.sh @@ -11,7 +11,7 @@ export LANG=en_US.UTF-8 ### set virtualenv if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --no-site-packages --always-copy --python python3 + virtualenv $VENV --always-copy --python python3 source $VENV/bin/activate DEACTIVE=true fi