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

code changes to validate JSON input array #8

Merged
merged 1 commit into from
Nov 21, 2024
Merged

Conversation

hrai-nr
Copy link
Contributor

@hrai-nr hrai-nr commented Nov 21, 2024

This PR will validate all the JSON array's received as input parameter in the cloud formation stack.
Following is list of validation being done:

  1. The input should be a valid JSON array.
  2. Each element of array also should be a valid JSON object.
  3. Each element should only have required keys, example : AttributeName and AttributeValue in case of CommonAttribute Param.
  4. The value of keys should not be empty, example : The value of keys AttributeName and AttributeValue in case of CommonAttribute Param should not be empty. However in case of LogGroupConfig only one key LogGroupName is mandatory.

Testing done:
Passed these values from stack to test all he valid scenarios:

[{"LogGroupName":"xyz-hrai-fifteen", "FilterPattern":"ERROR"}]
[{"LogGroupName":"xyz-hrai-fifteen", "":"ERROR"}]

[{"AttributeName": "name", "AttributeValue": "hrai"}, {"": "surName", "AttributeValue": "hrai-rai"}]
[{"AttributeName": "name", "AttributeValue": "hrai"}, {"AttributeName": "surName", "AttributeValue": "hrai-rai"}

@hrai-nr hrai-nr merged commit 803a68a into main Nov 21, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants