You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Validate resource before deserialize into resource model #273
As for now, Java plugin will deserialize the raw resource property into resource model before validation.
If the resource property is an invalid structure, e.g. pass a String but schema requires a List, it will fail sadly. And CloudFormation will show Internal Failure for this resource.
If validate resource before deserialize it, it can validate such invalid resource properly.
Validating the raw JSON can produce other errors, or fail with false negatives if it's not ordered correctly.
The PR #274 do consider for such case. It will only try to catch MismatchedInputException if the first deserialization fails due to mismatch type. This avoid the false negative for the stringifier issue but provide useful information if type mismatch.
The following validation is kept as-is so that it will validate based on the converted resource model.
Activity
rjlohan commentedon Jun 8, 2020
Before making changes here, verify the history of the serialization behaviour. e.g;
5e7fe4e#diff-f71d0cfe4773c081286e31b592b040ff
7f221a2#diff-f71d0cfe4773c081286e31b592b040ff
Validating the raw JSON can produce other errors, or fail with false negatives if it's not ordered correctly.
wbingli commentedon Jun 8, 2020
The PR #274 do consider for such case. It will only try to catch
MismatchedInputExceptionif the first deserialization fails due to mismatch type. This avoid the false negative for the stringifier issue but provide useful information if type mismatch.The following validation is kept as-is so that it will validate based on the converted resource model.
wbingli commentedon Jun 10, 2020
Resolving as the fix is merged.