diff --git a/private/aws-restjson-server/src/protocols/Aws_restJson1.ts b/private/aws-restjson-server/src/protocols/Aws_restJson1.ts index ce079df7d7d9..8ed51a46fbbc 100644 --- a/private/aws-restjson-server/src/protocols/Aws_restJson1.ts +++ b/private/aws-restjson-server/src/protocols/Aws_restJson1.ts @@ -382,7 +382,7 @@ export const deserializeAllQueryStringTypesRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -614,7 +614,7 @@ export const deserializeConstantAndVariableQueryStringRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -668,7 +668,7 @@ export const deserializeConstantQueryStringRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -838,7 +838,7 @@ export const deserializeEmptyInputAndEmptyOutputRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -1146,7 +1146,7 @@ export const deserializeHttpPrefixHeadersRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -1182,7 +1182,7 @@ export const deserializeHttpPrefixHeadersInResponseRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -1207,7 +1207,7 @@ export const deserializeHttpRequestWithFloatLabelsRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -1238,7 +1238,7 @@ export const deserializeHttpRequestWithGreedyLabelInPathRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -1269,7 +1269,7 @@ export const deserializeHttpRequestWithLabelsRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -1308,7 +1308,7 @@ export const deserializeHttpRequestWithLabelsAndTimestampFormatRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -1360,7 +1360,7 @@ export const deserializeHttpRequestWithRegexLiteralRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -1466,7 +1466,7 @@ export const deserializeInputAndOutputWithHeadersRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -2053,7 +2053,7 @@ export const deserializeMalformedContentTypeWithoutBodyEmptyInputRequest = async ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -2454,7 +2454,7 @@ export const deserializeMalformedStringRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -2571,7 +2571,7 @@ export const deserializeMalformedTimestampHeaderDateTimeRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -2598,7 +2598,7 @@ export const deserializeMalformedTimestampHeaderDefaultRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -2625,7 +2625,7 @@ export const deserializeMalformedTimestampHeaderEpochRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -2652,7 +2652,7 @@ export const deserializeMalformedTimestampPathDefaultRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -2682,7 +2682,7 @@ export const deserializeMalformedTimestampPathEpochRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -2712,7 +2712,7 @@ export const deserializeMalformedTimestampPathHttpDateRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -2742,7 +2742,7 @@ export const deserializeMalformedTimestampQueryDefaultRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -2783,7 +2783,7 @@ export const deserializeMalformedTimestampQueryEpochRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -2824,7 +2824,7 @@ export const deserializeMalformedTimestampQueryHttpDateRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -2894,7 +2894,7 @@ export const deserializeMediaTypeHeaderRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -2974,7 +2974,7 @@ export const deserializeNullAndEmptyHeadersClientRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -3006,7 +3006,7 @@ export const deserializeNullAndEmptyHeadersServerRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -3038,7 +3038,7 @@ export const deserializeOmitsNullSerializesEmptyStringRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -3092,7 +3092,7 @@ export const deserializeOmitsSerializingEmptyListsRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -3312,7 +3312,7 @@ export const deserializeQueryIdempotencyTokenAutoFillRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -3353,7 +3353,7 @@ export const deserializeQueryParamsAsStringListMapRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -3401,7 +3401,7 @@ export const deserializeQueryPrecedenceRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -3486,7 +3486,7 @@ export const deserializeResponseCodeHttpFallbackRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -3753,7 +3753,7 @@ export const deserializeTestGetNoPayloadRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -3845,7 +3845,7 @@ export const deserializeTestPostNoPayloadRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } @@ -3872,7 +3872,7 @@ export const deserializeTimestampFormatHeadersRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } } diff --git a/private/aws-restjson-validation-server/src/protocols/Aws_restJson1.ts b/private/aws-restjson-validation-server/src/protocols/Aws_restJson1.ts index f01881d1eab3..d12999f16ac2 100644 --- a/private/aws-restjson-validation-server/src/protocols/Aws_restJson1.ts +++ b/private/aws-restjson-validation-server/src/protocols/Aws_restJson1.ts @@ -201,7 +201,7 @@ export const deserializeMalformedLengthQueryStringRequest = async ( ); if (contentTypeHeaderKey != null) { const contentType = output.headers[contentTypeHeaderKey]; - if (contentType !== undefined && contentType !== "application/json") { + if (contentType !== undefined) { throw new __UnsupportedMediaTypeException(); } }