feat: add support for nested list handling in webhook request content mapping#15
Open
Qoyyuum wants to merge 1 commit into
Open
feat: add support for nested list handling in webhook request content mapping#15Qoyyuum wants to merge 1 commit into
Qoyyuum wants to merge 1 commit into
Conversation
Comment on lines
492
to
510
| @@ -498,6 +508,10 @@ def map_request_content(self, request_content, data): | |||
| nested_value = self.get_nested(data, keys) | |||
| result[key] = nested_value if nested_value is not None else "" | |||
|
|
|||
There was a problem hiding this comment.
This comment is directed at any maintainer looking to merge this.
This section of original code still causes a bug where simple string values in dicts in a list such as Slack Blocks formatting get dropped.
For example:
"request_body": {
"text": "[${{alerts.severity.severity_name}}] ${{alerts.alert_title}}",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "[${{alerts.severity.severity_name}}] ${{alerts.alert_title}}"
}
},
...
Leads to parsed value of
{"text" : "[Low] Test Alert", "blocks": [{"type": "", "text": {"type": "", "text": "[Low] Test Alert"}}] ...}
Removing this entire section fixes the issue and I'm not even clear why this section is here as it seems unnecessary given that the expectation is the config should be valid JSON and should not be trying to interpret "some.key" as a path rather than a simple JSON key name.
Otherwise, this patch seems to work correctly and solved my problem with this module.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR fixes #14