Skip to content
This repository has been archived by the owner on Apr 16, 2022. It is now read-only.

Commit

Permalink
fix dodgy parameter type regex
Browse files Browse the repository at this point in the history
  • Loading branch information
akdor1154 committed Nov 19, 2017
1 parent fc3139c commit c289340
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/test/validatorTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,13 @@ describe('validator', () => {
expect(result['errors']['crit'][0]).to.have.property('message', 'Required property FunctionName missing for type AWS::Lambda::Version');
expect(result['errors']['crit'][1]).to.have.property('message', 'Required property FunctionName missing for type AWS::Lambda::Version');
});

it('a list of an extended parameter type should be properly mocked without causing an exception', () => {
const input = 'testData/valid/yaml/issue-94-list-security-group.yaml';
let result = validator.validateFile(input);
expect(result).to.have.deep.property('templateValid', true);
expect(result['errors']['crit']).to.have.lengthOf(0);
})
});

describe('parameters-validation', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ function guessParameterValue(parameterName: string, parameter: any): string | st
} else {
const rawParameterType = parameter['Type'];

const listMatch = /^List<(\w+)>$/.exec(rawParameterType);
const listMatch = /^List<(.+)>$/.exec(rawParameterType);
let isList: boolean;
let parameterType: string;

Expand Down

0 comments on commit c289340

Please sign in to comment.