Issue fix - Duplicated subproperties causing validation errors #241
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue Description
When a sub-property uses consecutive capitalized string as name in schema, it will trigger an unexpected error in handling request while validating template against the schema. Test template and schema have attached
Error displays on CloudFormation console
Root cause
Same root cause as PR#235. Duplicated sub-properties being generated unexpectedly. Since additional properties in a sub-property are disallowed as well, then it will occur errors as above.
{@link software.amazon.cloudformation.resource.Serializer#serialize}
invoked by{@link software.amazon.cloudformation.LambdaWrapper#validateModel}
Unit test on Serializer & Validator
Output:
Fix
Turn off
@JsonAutoDetect
on getters and setters to only use the fields as the canonical source of serialization config.Since SubProperties are generated by
POJO.java
template. Ref: codegen.pyBy adding the below annotation before
POJO
Class template would fix the issue.After Fix
Test Schema
Test template