From 60bbc2e9c3ff7300afdef7b51528eef14b5d875a Mon Sep 17 00:00:00 2001 From: Keeton Hodgson Date: Tue, 4 Feb 2020 09:42:28 -0800 Subject: [PATCH] fix: add periods to error messages, fix quotes. --- samtranslator/model/api/api_generator.py | 46 +++++++++++-------- samtranslator/model/api/http_api_generator.py | 2 +- samtranslator/model/apigateway.py | 3 +- samtranslator/model/s3_utils/uri_parser.py | 4 +- samtranslator/model/sam_resources.py | 4 +- ...es_unknown_responseparameter_property.json | 2 +- .../output/error_api_invalid_auth.json | 4 +- .../error_api_invalid_definitionuri.json | 8 ++-- .../error_api_invalid_request_model.json | 4 +- ...error_api_with_custom_domains_invalid.json | 4 +- ...ror_api_with_invalid_open_api_version.json | 6 +-- .../error_cors_on_external_swagger.json | 4 +- .../error_function_invalid_codeuri.json | 4 +- ...h_deployment_preference_missing_alias.json | 6 +-- .../error_multiple_resource_errors.json | 8 ++-- 15 files changed, 59 insertions(+), 50 deletions(-) diff --git a/samtranslator/model/api/api_generator.py b/samtranslator/model/api/api_generator.py index fe6d139b6..0ef76718f 100644 --- a/samtranslator/model/api/api_generator.py +++ b/samtranslator/model/api/api_generator.py @@ -154,7 +154,7 @@ def _construct_rest_api(self): if self.definition_uri and self.definition_body: raise InvalidResourceException( - self.logical_id, "Specify either 'DefinitionUri' or 'DefinitionBody' property and not both" + self.logical_id, "Specify either 'DefinitionUri' or 'DefinitionBody' property and not both." ) if self.open_api_version: @@ -162,7 +162,7 @@ def _construct_rest_api(self): SwaggerEditor.get_openapi_versions_supported_regex(), self.open_api_version ): raise InvalidResourceException( - self.logical_id, 'The OpenApiVersion value must be of the format "3.0.0"' + self.logical_id, "The OpenApiVersion value must be of the format '3.0.0'." ) self._add_cors() @@ -193,7 +193,7 @@ def _construct_body_s3_dict(self): if not self.definition_uri.get("Bucket", None) or not self.definition_uri.get("Key", None): # DefinitionUri is a dictionary but does not contain Bucket or Key property raise InvalidResourceException( - self.logical_id, "'DefinitionUri' requires Bucket and Key properties to be specified" + self.logical_id, "'DefinitionUri' requires Bucket and Key properties to be specified." ) s3_pointer = self.definition_uri @@ -205,7 +205,7 @@ def _construct_body_s3_dict(self): raise InvalidResourceException( self.logical_id, "'DefinitionUri' is not a valid S3 Uri of the form " - '"s3://bucket/key" with optional versionId query parameter.', + "'s3://bucket/key' with optional versionId query parameter.", ) body_s3 = {"Bucket": s3_pointer["Bucket"], "Key": s3_pointer["Key"]} @@ -276,7 +276,7 @@ def _construct_api_domain(self, rest_api): if self.domain.get("DomainName") is None or self.domain.get("CertificateArn") is None: raise InvalidResourceException( - self.logical_id, "Custom Domains only works if both DomainName and CertificateArn" " are provided" + self.logical_id, "Custom Domains only works if both DomainName and CertificateArn" " are provided." ) self.domain["ApiDomainName"] = "{}{}".format( @@ -293,7 +293,7 @@ def _construct_api_domain(self, rest_api): elif endpoint not in ["EDGE", "REGIONAL"]: raise InvalidResourceException( self.logical_id, - "EndpointConfiguration for Custom Domains must be" " one of {}".format(["EDGE", "REGIONAL"]), + "EndpointConfiguration for Custom Domains must be" " one of {}.".format(["EDGE", "REGIONAL"]), ) if endpoint == "REGIONAL": @@ -427,7 +427,7 @@ def _add_cors(self): if self.cors and not self.definition_body: raise InvalidResourceException( - self.logical_id, "Cors works only with inline Swagger specified in " "'DefinitionBody' property" + self.logical_id, "Cors works only with inline Swagger specified in 'DefinitionBody' property." ) if isinstance(self.cors, string_types) or is_instrinsic(self.cors): @@ -447,7 +447,8 @@ def _add_cors(self): if not SwaggerEditor.is_valid(self.definition_body): raise InvalidResourceException( self.logical_id, - "Unable to add Cors configuration because " "'DefinitionBody' does not contain a valid Swagger", + "Unable to add Cors configuration because " + "'DefinitionBody' does not contain a valid Swagger definition.", ) if properties.AllowCredentials is True and properties.AllowOrigin == _CORS_WILDCARD: @@ -500,7 +501,7 @@ def _add_auth(self): if self.auth and not self.definition_body: raise InvalidResourceException( - self.logical_id, "Auth works only with inline Swagger specified in " "'DefinitionBody' property" + self.logical_id, "Auth works only with inline Swagger specified in " "'DefinitionBody' property." ) # Make sure keys in the dict are recognized @@ -510,7 +511,8 @@ def _add_auth(self): if not SwaggerEditor.is_valid(self.definition_body): raise InvalidResourceException( self.logical_id, - "Unable to add Auth configuration because " "'DefinitionBody' does not contain a valid Swagger", + "Unable to add Auth configuration because " + "'DefinitionBody' does not contain a valid Swagger definition.", ) swagger_editor = SwaggerEditor(self.definition_body) auth_properties = AuthProperties(**self.auth) @@ -565,10 +567,10 @@ def _construct_usage_plan(self, rest_api_stage=None): usage_plan_key = None if create_usage_plan is None: - raise InvalidResourceException(self.logical_id, "'CreateUsagePlan' is a required field for UsagePlan") + raise InvalidResourceException(self.logical_id, "'CreateUsagePlan' is a required field for UsagePlan.") if create_usage_plan not in create_usage_plans_accepted_values: raise InvalidResourceException( - self.logical_id, "'CreateUsagePlan' accepts one of {}".format(create_usage_plans_accepted_values) + self.logical_id, "'CreateUsagePlan' accepts one of {}.".format(create_usage_plans_accepted_values) ) if create_usage_plan == "NONE": @@ -680,7 +682,7 @@ def _add_gateway_responses(self): if self.gateway_responses and not self.definition_body: raise InvalidResourceException( self.logical_id, - "GatewayResponses works only with inline Swagger specified in " "'DefinitionBody' property", + "GatewayResponses works only with inline Swagger specified in " "'DefinitionBody' property.", ) # Make sure keys in the dict are recognized @@ -689,13 +691,16 @@ def _add_gateway_responses(self): if response_key not in GatewayResponseProperties: raise InvalidResourceException( self.logical_id, - "Invalid property '{}' in 'GatewayResponses' property '{}'".format(response_key, responses_key), + "Invalid property '{}' in 'GatewayResponses' property '{}'.".format( + response_key, responses_key + ), ) if not SwaggerEditor.is_valid(self.definition_body): raise InvalidResourceException( self.logical_id, - "Unable to add Auth configuration because " "'DefinitionBody' does not contain a valid Swagger", + "Unable to add Auth configuration because " + "'DefinitionBody' does not contain a valid Swagger definition.", ) swagger_editor = SwaggerEditor(self.definition_body) @@ -726,13 +731,14 @@ def _add_models(self): if self.models and not self.definition_body: raise InvalidResourceException( - self.logical_id, "Models works only with inline Swagger specified in " "'DefinitionBody' property" + self.logical_id, "Models works only with inline Swagger specified in " "'DefinitionBody' property." ) if not SwaggerEditor.is_valid(self.definition_body): raise InvalidResourceException( self.logical_id, - "Unable to add Models definitions because " "'DefinitionBody' does not contain a valid Swagger", + "Unable to add Models definitions because " + "'DefinitionBody' does not contain a valid Swagger definition.", ) if not all(isinstance(model, dict) for model in self.models.values()): @@ -815,7 +821,7 @@ def _get_authorizers(self, authorizers_config, default_authorizer=None): return None if not isinstance(authorizers_config, dict): - raise InvalidResourceException(self.logical_id, "Authorizers must be a dictionary") + raise InvalidResourceException(self.logical_id, "Authorizers must be a dictionary.") for authorizer_name, authorizer in authorizers_config.items(): if not isinstance(authorizer, dict): @@ -892,7 +898,9 @@ def _set_default_authorizer( if not authorizers.get(default_authorizer) and default_authorizer != "AWS_IAM": raise InvalidResourceException( self.logical_id, - "Unable to set DefaultAuthorizer because '" + default_authorizer + "' was not defined in 'Authorizers'", + "Unable to set DefaultAuthorizer because '" + + default_authorizer + + "' was not defined in 'Authorizers'.", ) for path in swagger_editor.iter_on_path(): diff --git a/samtranslator/model/api/http_api_generator.py b/samtranslator/model/api/http_api_generator.py index b3d465cfa..0643db332 100644 --- a/samtranslator/model/api/http_api_generator.py +++ b/samtranslator/model/api/http_api_generator.py @@ -190,7 +190,7 @@ def _construct_body_s3_dict(self): raise InvalidResourceException( self.logical_id, "'DefinitionUri' is not a valid S3 Uri of the form " - '"s3://bucket/key" with optional versionId query parameter.', + "'s3://bucket/key' with optional versionId query parameter.", ) body_s3 = {"Bucket": s3_pointer["Bucket"], "Key": s3_pointer["Key"]} diff --git a/samtranslator/model/apigateway.py b/samtranslator/model/apigateway.py index e1bfaa282..7494f6729 100644 --- a/samtranslator/model/apigateway.py +++ b/samtranslator/model/apigateway.py @@ -233,7 +233,8 @@ def __init__( ): if function_payload_type not in ApiGatewayAuthorizer._VALID_FUNCTION_PAYLOAD_TYPES: raise InvalidResourceException( - api_logical_id, name + " Authorizer has invalid " "'FunctionPayloadType': " + function_payload_type + api_logical_id, + name + " Authorizer has invalid " "'FunctionPayloadType': " + function_payload_type + ".", ) if function_payload_type == "REQUEST" and self._is_missing_identity_source(identity): diff --git a/samtranslator/model/s3_utils/uri_parser.py b/samtranslator/model/s3_utils/uri_parser.py index e55a6a682..a5188e21c 100644 --- a/samtranslator/model/s3_utils/uri_parser.py +++ b/samtranslator/model/s3_utils/uri_parser.py @@ -59,7 +59,7 @@ def construct_s3_location_object(location_uri, logical_id, property_name): if not location_uri.get("Bucket") or not location_uri.get("Key"): # location_uri is a dictionary but does not contain Bucket or Key property raise InvalidResourceException( - logical_id, "'{}' requires Bucket and Key properties to be " "specified".format(property_name) + logical_id, "'{}' requires Bucket and Key properties to be specified.".format(property_name) ) s3_pointer = location_uri @@ -72,7 +72,7 @@ def construct_s3_location_object(location_uri, logical_id, property_name): raise InvalidResourceException( logical_id, "'{}' is not a valid S3 Uri of the form " - '"s3://bucket/key" with optional versionId query ' + "'s3://bucket/key' with optional versionId query " "parameter.".format(property_name), ) diff --git a/samtranslator/model/sam_resources.py b/samtranslator/model/sam_resources.py index 3d1af1af8..8683dba3d 100644 --- a/samtranslator/model/sam_resources.py +++ b/samtranslator/model/sam_resources.py @@ -530,7 +530,7 @@ def _validate_dlq(self): if not self.DeadLetterQueue.get("Type") or not self.DeadLetterQueue.get("TargetArn"): raise InvalidResourceException( self.logical_id, - "'DeadLetterQueue' requires Type and TargetArn properties to be specified".format(valid_dlq_types), + "'DeadLetterQueue' requires Type and TargetArn properties to be specified.".format(valid_dlq_types), ) # Validate required Types @@ -715,7 +715,7 @@ def _validate_deployment_preference_and_add_update_policy( if deployment_preference_collection.get(self.logical_id).enabled: if self.AutoPublishAlias is None: raise InvalidResourceException( - self.logical_id, "'DeploymentPreference' requires AutoPublishAlias property to be specified" + self.logical_id, "'DeploymentPreference' requires AutoPublishAlias property to be specified." ) if lambda_alias is None: raise ValueError("lambda_alias expected for updating it with the appropriate update policy") diff --git a/tests/translator/output/error_api_gateway_responses_unknown_responseparameter_property.json b/tests/translator/output/error_api_gateway_responses_unknown_responseparameter_property.json index bfcd81c34..62fd4320f 100644 --- a/tests/translator/output/error_api_gateway_responses_unknown_responseparameter_property.json +++ b/tests/translator/output/error_api_gateway_responses_unknown_responseparameter_property.json @@ -1 +1 @@ -{"errorMessage":"Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [ExplicitApi] is invalid. Invalid property 'SubStatusCode' in 'GatewayResponses' property 'UNAUTHORIZED'"} \ No newline at end of file +{"errorMessage":"Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [ExplicitApi] is invalid. Invalid property 'SubStatusCode' in 'GatewayResponses' property 'UNAUTHORIZED'."} diff --git a/tests/translator/output/error_api_invalid_auth.json b/tests/translator/output/error_api_invalid_auth.json index 1ed9fb027..6cdd59dbe 100644 --- a/tests/translator/output/error_api_invalid_auth.json +++ b/tests/translator/output/error_api_invalid_auth.json @@ -1,3 +1,3 @@ { - "errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 15. Resource with id [AuthNotDictApi] is invalid. Type of property 'Auth' is invalid. Resource with id [AuthWithAdditionalPropertyApi] is invalid. Invalid value for 'Auth' property Resource with id [AuthWithDefinitionUriApi] is invalid. Auth works only with inline Swagger specified in 'DefinitionBody' property Resource with id [AuthWithInvalidDefinitionBodyApi] is invalid. Unable to add Auth configuration because 'DefinitionBody' does not contain a valid Swagger Resource with id [AuthWithMissingDefaultAuthorizerApi] is invalid. Unable to set DefaultAuthorizer because 'NotThere' was not defined in 'Authorizers' Resource with id [AuthorizerNotDict] is invalid. Authorizer MyCognitoAuthorizer must be a dictionary. Resource with id [AuthorizersNotDictApi] is invalid. Authorizers must be a dictionary Resource with id [InvalidFunctionPayloadTypeApi] is invalid. MyLambdaAuthorizer Authorizer has invalid 'FunctionPayloadType': INVALID Resource with id [MissingAuthorizerFn] is invalid. Event with id [GetRoot] is invalid. Unable to set Authorizer [UnspecifiedAuthorizer] on API method [get] for path [/] because it wasn't defined in the API's Authorizers. Resource with id [NoApiAuthorizerFn] is invalid. Event with id [GetRoot] is invalid. Unable to set Authorizer [MyAuth] on API method [get] for path [/] because the related API does not define any Authorizers. Resource with id [NoAuthFn] is invalid. Event with id [GetRoot] is invalid. Unable to set Authorizer [MyAuth] on API method [get] for path [/] because the related API does not define any Authorizers. Resource with id [NoAuthorizersFn] is invalid. Event with id [GetRoot] is invalid. Unable to set Authorizer [MyAuth] on API method [get] for path [/] because the related API does not define any Authorizers. Resource with id [NoDefaultAuthorizerWithNoneFn] is invalid. Event with id [GetRoot] is invalid. Unable to set Authorizer on API method [get] for path [/] because 'NONE' is only a valid value when a DefaultAuthorizer on the API is specified. Resource with id [NoIdentityOnRequestAuthorizer] is invalid. MyLambdaRequestAuthorizer Authorizer must specify Identity with at least one of Headers, QueryStrings, StageVariables, or Context. Resource with id [NoIdentitySourceOnRequestAuthorizer] is invalid. MyLambdaRequestAuthorizer Authorizer must specify Identity with at least one of Headers, QueryStrings, StageVariables, or Context." -} \ No newline at end of file + "errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 15. Resource with id [AuthNotDictApi] is invalid. Type of property 'Auth' is invalid. Resource with id [AuthWithAdditionalPropertyApi] is invalid. Invalid value for 'Auth' property Resource with id [AuthWithDefinitionUriApi] is invalid. Auth works only with inline Swagger specified in 'DefinitionBody' property. Resource with id [AuthWithInvalidDefinitionBodyApi] is invalid. Unable to add Auth configuration because 'DefinitionBody' does not contain a valid Swagger definition. Resource with id [AuthWithMissingDefaultAuthorizerApi] is invalid. Unable to set DefaultAuthorizer because 'NotThere' was not defined in 'Authorizers'. Resource with id [AuthorizerNotDict] is invalid. Authorizer MyCognitoAuthorizer must be a dictionary. Resource with id [AuthorizersNotDictApi] is invalid. Authorizers must be a dictionary. Resource with id [InvalidFunctionPayloadTypeApi] is invalid. MyLambdaAuthorizer Authorizer has invalid 'FunctionPayloadType': INVALID. Resource with id [MissingAuthorizerFn] is invalid. Event with id [GetRoot] is invalid. Unable to set Authorizer [UnspecifiedAuthorizer] on API method [get] for path [/] because it wasn't defined in the API's Authorizers. Resource with id [NoApiAuthorizerFn] is invalid. Event with id [GetRoot] is invalid. Unable to set Authorizer [MyAuth] on API method [get] for path [/] because the related API does not define any Authorizers. Resource with id [NoAuthFn] is invalid. Event with id [GetRoot] is invalid. Unable to set Authorizer [MyAuth] on API method [get] for path [/] because the related API does not define any Authorizers. Resource with id [NoAuthorizersFn] is invalid. Event with id [GetRoot] is invalid. Unable to set Authorizer [MyAuth] on API method [get] for path [/] because the related API does not define any Authorizers. Resource with id [NoDefaultAuthorizerWithNoneFn] is invalid. Event with id [GetRoot] is invalid. Unable to set Authorizer on API method [get] for path [/] because 'NONE' is only a valid value when a DefaultAuthorizer on the API is specified. Resource with id [NoIdentityOnRequestAuthorizer] is invalid. MyLambdaRequestAuthorizer Authorizer must specify Identity with at least one of Headers, QueryStrings, StageVariables, or Context. Resource with id [NoIdentitySourceOnRequestAuthorizer] is invalid. MyLambdaRequestAuthorizer Authorizer must specify Identity with at least one of Headers, QueryStrings, StageVariables, or Context." +} diff --git a/tests/translator/output/error_api_invalid_definitionuri.json b/tests/translator/output/error_api_invalid_definitionuri.json index d7760185e..22a6e777e 100644 --- a/tests/translator/output/error_api_invalid_definitionuri.json +++ b/tests/translator/output/error_api_invalid_definitionuri.json @@ -1,11 +1,11 @@ { "errors": [ { - "errorMessage": "Resource with id [Api] is invalid. 'DefinitionUri' is not a valid S3 Uri of the form \"s3://bucket/key\" with optional versionId query parameter." + "errorMessage": "Resource with id [Api] is invalid. 'DefinitionUri' is not a valid S3 Uri of the form 's3://bucket/key' with optional versionId query parameter." }, { - "errorMessage": "Resource with id [ApiWithBodyAndDefinitionUri] is invalid. Specify either 'DefinitionUri' or 'DefinitionBody' property and not both" + "errorMessage": "Resource with id [ApiWithBodyAndDefinitionUri] is invalid. Specify either 'DefinitionUri' or 'DefinitionBody' property and not both." } ], - "errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 2. Resource with id [Api] is invalid. 'DefinitionUri' is not a valid S3 Uri of the form \"s3://bucket/key\" with optional versionId query parameter. Resource with id [ApiWithBodyAndDefinitionUri] is invalid. Specify either 'DefinitionUri' or 'DefinitionBody' property and not both" -} \ No newline at end of file + "errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 2. Resource with id [Api] is invalid. 'DefinitionUri' is not a valid S3 Uri of the form 's3://bucket/key' with optional versionId query parameter. Resource with id [ApiWithBodyAndDefinitionUri] is invalid. Specify either 'DefinitionUri' or 'DefinitionBody' property and not both." +} diff --git a/tests/translator/output/error_api_invalid_request_model.json b/tests/translator/output/error_api_invalid_request_model.json index 337edf835..1fc82b350 100644 --- a/tests/translator/output/error_api_invalid_request_model.json +++ b/tests/translator/output/error_api_invalid_request_model.json @@ -1,3 +1,3 @@ { - "errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 5. Resource with id [MissingModelFunction] is invalid. Event with id [GetHtml] is invalid. Unable to set RequestModel [UnspecifiedModel] on API method [get] for path [/] because it wasn't defined in the API's Models. Resource with id [ModelsNotDictApi] is invalid. Invalid value for 'Models' property Resource with id [ModelsWithDefinitionUrlApi] is invalid. Models works only with inline Swagger specified in 'DefinitionBody' property Resource with id [ModelsWithInvalidDefinitionBodyApi] is invalid. Unable to add Models definitions because 'DefinitionBody' does not contain a valid Swagger Resource with id [NoModelFunction] is invalid. Event with id [GetHtml] is invalid. Unable to set RequestModel [User] on API method [get] for path [/] because the related API does not define any Models." -} \ No newline at end of file + "errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 5. Resource with id [MissingModelFunction] is invalid. Event with id [GetHtml] is invalid. Unable to set RequestModel [UnspecifiedModel] on API method [get] for path [/] because it wasn't defined in the API's Models. Resource with id [ModelsNotDictApi] is invalid. Invalid value for 'Models' property Resource with id [ModelsWithDefinitionUrlApi] is invalid. Models works only with inline Swagger specified in 'DefinitionBody' property. Resource with id [ModelsWithInvalidDefinitionBodyApi] is invalid. Unable to add Models definitions because 'DefinitionBody' does not contain a valid Swagger definition. Resource with id [NoModelFunction] is invalid. Event with id [GetHtml] is invalid. Unable to set RequestModel [User] on API method [get] for path [/] because the related API does not define any Models." +} diff --git a/tests/translator/output/error_api_with_custom_domains_invalid.json b/tests/translator/output/error_api_with_custom_domains_invalid.json index 1f60e2664..d3b1fccfa 100644 --- a/tests/translator/output/error_api_with_custom_domains_invalid.json +++ b/tests/translator/output/error_api_with_custom_domains_invalid.json @@ -1,8 +1,8 @@ { "errors": [ { - "errorMessage": "Resource with id [MyApi] is invalid. EndpointConfiguration for Custom Domains must be one of ['EDGE', 'REGIONAL'] Resource with id [ServerlessRestApi] is invalid. Custom Domains only works if both DomainName and CertificateArn are provided" + "errorMessage": "Resource with id [MyApi] is invalid. EndpointConfiguration for Custom Domains must be one of ['EDGE', 'REGIONAL']. Resource with id [ServerlessRestApi] is invalid. Custom Domains only works if both DomainName and CertificateArn are provided." } ], - "errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 2. Resource with id [MyApi] is invalid. EndpointConfiguration for Custom Domains must be one of ['EDGE', 'REGIONAL'] Resource with id [ServerlessRestApi] is invalid. Custom Domains only works if both DomainName and CertificateArn are provided" + "errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 2. Resource with id [MyApi] is invalid. EndpointConfiguration for Custom Domains must be one of ['EDGE', 'REGIONAL']. Resource with id [ServerlessRestApi] is invalid. Custom Domains only works if both DomainName and CertificateArn are provided." } diff --git a/tests/translator/output/error_api_with_invalid_open_api_version.json b/tests/translator/output/error_api_with_invalid_open_api_version.json index df75e769d..e5b5c73a5 100644 --- a/tests/translator/output/error_api_with_invalid_open_api_version.json +++ b/tests/translator/output/error_api_with_invalid_open_api_version.json @@ -1,8 +1,8 @@ { "errors": [ { - "errorMessage": "Resource with id [MyApi] is invalid. The OpenApiVersion value must be of the format \"3.0.0\"" + "errorMessage": "Resource with id [MyApi] is invalid. The OpenApiVersion value must be of the format '3.0.0'." } ], - "errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [MyApi] is invalid. The OpenApiVersion value must be of the format \"3.0.0\"" - } \ No newline at end of file + "errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [MyApi] is invalid. The OpenApiVersion value must be of the format '3.0.0'." + } diff --git a/tests/translator/output/error_cors_on_external_swagger.json b/tests/translator/output/error_cors_on_external_swagger.json index ea702cd52..528129a2b 100644 --- a/tests/translator/output/error_cors_on_external_swagger.json +++ b/tests/translator/output/error_cors_on_external_swagger.json @@ -1,8 +1,8 @@ { "errors": [ { - "errorMessage": "Resource with id [ExplicitApi] is invalid. Cors works only with inline Swagger specified in 'DefinitionBody' property" + "errorMessage": "Resource with id [ExplicitApi] is invalid. Cors works only with inline Swagger specified in 'DefinitionBody' property." } ], - "errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [ExplicitApi] is invalid. Cors works only with inline Swagger specified in 'DefinitionBody' property" + "errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [ExplicitApi] is invalid. Cors works only with inline Swagger specified in 'DefinitionBody' property." } diff --git a/tests/translator/output/error_function_invalid_codeuri.json b/tests/translator/output/error_function_invalid_codeuri.json index 1307352b4..ce3df9481 100644 --- a/tests/translator/output/error_function_invalid_codeuri.json +++ b/tests/translator/output/error_function_invalid_codeuri.json @@ -4,5 +4,5 @@ "errorMessage": "Resource with id [Function] is invalid. 'CodeUri' is not a valid S3 Uri of the form \"s3://bucket/key\" with optional versionId query parameter." } ], - "errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [Function] is invalid. 'CodeUri' is not a valid S3 Uri of the form \"s3://bucket/key\" with optional versionId query parameter." -} \ No newline at end of file + "errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [Function] is invalid. 'CodeUri' is not a valid S3 Uri of the form 's3://bucket/key' with optional versionId query parameter." +} diff --git a/tests/translator/output/error_function_with_deployment_preference_missing_alias.json b/tests/translator/output/error_function_with_deployment_preference_missing_alias.json index fb505d758..0c9f4ede3 100644 --- a/tests/translator/output/error_function_with_deployment_preference_missing_alias.json +++ b/tests/translator/output/error_function_with_deployment_preference_missing_alias.json @@ -1,8 +1,8 @@ { "errors": [ { - "errorMessage": "Resource with id [MinimalFunction] is invalid. 'DeploymentPreference' requires AutoPublishAlias property to be specified" + "errorMessage": "Resource with id [MinimalFunction] is invalid. 'DeploymentPreference' requires AutoPublishAlias property to be specified." } ], - "errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [MinimalFunction] is invalid. 'DeploymentPreference' requires AutoPublishAlias property to be specified" -} \ No newline at end of file + "errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [MinimalFunction] is invalid. 'DeploymentPreference' requires AutoPublishAlias property to be specified." +} diff --git a/tests/translator/output/error_multiple_resource_errors.json b/tests/translator/output/error_multiple_resource_errors.json index bdc58656f..ec68793ae 100644 --- a/tests/translator/output/error_multiple_resource_errors.json +++ b/tests/translator/output/error_multiple_resource_errors.json @@ -1,7 +1,7 @@ { "errors": [ { - "errorMessage": "Resource with id [BadCodeUriTypeFunction] is invalid. 'CodeUri' requires Bucket and Key properties to be specified" + "errorMessage": "Resource with id [BadCodeUriTypeFunction] is invalid. 'CodeUri' requires Bucket and Key properties to be specified." }, { "errorMessage": "Resource with id [ExternalS3Function] is invalid. Event with id [S3Event] is invalid. S3 events must reference an S3 bucket in the same template." @@ -13,8 +13,8 @@ "errorMessage": "Resource with id [BadDefinitionUriApi] is invalid. 'DefinitionUri' is not a valid S3 Uri of the form \"s3://bucket/key\" with optional versionId query parameter." }, { - "errorMessage": "Resource with id [BadDefinitionUriTypeApi] is invalid. 'DefinitionUri' requires Bucket and Key properties to be specified" + "errorMessage": "Resource with id [BadDefinitionUriTypeApi] is invalid. 'DefinitionUri' requires Bucket and Key properties to be specified." } ], - "errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 5. Resource with id [BadCodeUriFunction] is invalid. 'CodeUri' is not a valid S3 Uri of the form \"s3://bucket/key\" with optional versionId query parameter. Resource with id [BadCodeUriTypeFunction] is invalid. 'CodeUri' requires Bucket and Key properties to be specified Resource with id [BadDefinitionUriApi] is invalid. 'DefinitionUri' is not a valid S3 Uri of the form \"s3://bucket/key\" with optional versionId query parameter. Resource with id [BadDefinitionUriTypeApi] is invalid. 'DefinitionUri' requires Bucket and Key properties to be specified Resource with id [ExternalS3Function] is invalid. Event with id [S3Event] is invalid. S3 events must reference an S3 bucket in the same template." -} \ No newline at end of file + "errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 5. Resource with id [BadCodeUriFunction] is invalid. 'CodeUri' is not a valid S3 Uri of the form 's3://bucket/key' with optional versionId query parameter. Resource with id [BadCodeUriTypeFunction] is invalid. 'CodeUri' requires Bucket and Key properties to be specified. Resource with id [BadDefinitionUriApi] is invalid. 'DefinitionUri' is not a valid S3 Uri of the form 's3://bucket/key' with optional versionId query parameter. Resource with id [BadDefinitionUriTypeApi] is invalid. 'DefinitionUri' requires Bucket and Key properties to be specified. Resource with id [ExternalS3Function] is invalid. Event with id [S3Event] is invalid. S3 events must reference an S3 bucket in the same template." +}