Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make sure ApplicationId is not null #1062

Merged
merged 1 commit into from
Aug 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def _can_process_application(self, app):
return (self.LOCATION_KEY in app.properties and
isinstance(app.properties[self.LOCATION_KEY], dict) and
self.APPLICATION_ID_KEY in app.properties[self.LOCATION_KEY] and
app.properties[self.LOCATION_KEY][self.APPLICATION_ID_KEY] is not None and
self.SEMANTIC_VERSION_KEY in app.properties[self.LOCATION_KEY])

def _handle_get_application_request(self, app_id, semver, key, logical_id):
Expand Down
7 changes: 7 additions & 0 deletions tests/translator/input/error_null_application_id.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Resources:
Application:
Type: AWS::Serverless::Application
Properties:
Location:
ApplicationId: null
SemanticVersion: 1.0.0
8 changes: 8 additions & 0 deletions tests/translator/output/error_null_application_id.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"errors": [
{
"errorMessage": "Resource with id [Application] is invalid. Property 'ApplicationId' cannot be blank."
}
],
"errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [Application] is invalid. Property 'ApplicationId' cannot be blank."
}
1 change: 1 addition & 0 deletions tests/translator/test_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ def _generate_new_deployment_hash(self, logical_id, dict_to_hash, rest_api_to_sw
'error_missing_startingposition',
'error_missing_stream',
'error_multiple_resource_errors',
'error_null_application_id',
'error_s3_not_in_template',
'error_table_invalid_attributetype',
'error_table_primary_key_missing_name',
Expand Down