Skip to content

Commit

Permalink
feat(http): update labels and regex for a couple of field (#1903)
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeepdsvs authored Feb 21, 2025
1 parent ca53abb commit 2b51393
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/configurations/destinations/http/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1090,11 +1090,11 @@
"properties": {
"to": {
"type": "string",
"pattern": "^\\$(?:\\.|(\\.(\\w+|\\*)|\\[\\d+\\]|\\[('\\w+'|\"\\w+\")\\]|\\[\\*\\]|\\.\\w+\\(\\))*)$"
"pattern": "^(?:$|\\$(?:\\.|(\\.(\\w+|\\*)|\\[\\d+\\]|\\[('\\w+'|\"\\w+\")\\]|\\[\\*\\]|\\.\\w+\\(\\))*)$)"
},
"from": {
"type": "string",
"pattern": "^\\$(?:\\.|(\\.(\\w+|\\*)|\\[\\d+\\]|\\[('\\w+'|\"\\w+\")\\]|\\[\\*\\]|\\.\\w+\\(\\))*)$|^(?!\\$)[A-Za-z0-9!#$%&'*+.^_`|~-]{1,100}$"
"pattern": "^\\$(?:\\.|(\\.(\\w+|\\*)|\\[\\d+\\]|\\[('\\w+'|\"\\w+\")\\]|\\[\\*\\]|\\.\\w+\\(\\))*)$|^(?!\\$)[A-Za-z0-9!#$%&'*+.^_`|~-]{0,100}$"
}
}
}
Expand Down
14 changes: 7 additions & 7 deletions src/configurations/destinations/http/ui-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@
{
"type": "mapping",
"label": "Enter your path parameters in sequence",
"note": "You could dynamically add values from fields in the RudderStack payload(using JSON path) or constants.",
"note": "You could dynamically add values from fields in the RudderStack payload (using JSON path) or constants.",
"columns": [
{
"key": "path",
Expand All @@ -483,7 +483,7 @@
{
"type": "mapping",
"label": "Map your query parameters",
"note": "Map the query parameter keys to the values from fields in the RudderStack payload(using JSON path) or constants.",
"note": "Map the query parameter keys to the values from fields in the RudderStack payload (using JSON path) or constants.",
"configKey": "queryParams",
"default": [],
"separatorIcon": "colon",
Expand Down Expand Up @@ -515,7 +515,7 @@
{
"type": "mapping",
"label": "Map your headers",
"note": "Map the header keys to the values from fields in the RudderStack payload(using JSON path) or constants.",
"note": "Build your Headers object by specifying the Key name, then map the values from fields in the RudderStack payload (using JSON path) or constants.",
"configKey": "headers",
"default": [],
"separatorIcon": "colon",
Expand All @@ -535,7 +535,7 @@
"label": "Value",
"regex": "^\\$(?:\\.|(?:\\.\\.(\\w+|\\*)|\\.(\\w+|\\*)|\\[\\d+\\]|\\[('\\w+'|\"\\w+\")\\]|\\[\\*\\]|\\.\\w+\\(\\))*)$|^(?!\\$)[A-Za-z0-9!#$%&'*+.^_`|~\\- /\\\\]{0,100}$",
"regexErrorMessage": "Please enter a valid JSON path or a constant",
"placeholder": "e.g. application/json"
"placeholder": "e.g. $.contentType or application/json"
}
]
}
Expand Down Expand Up @@ -570,7 +570,7 @@
{
"type": "mapping",
"label": "Map your request payload",
"note": "Build your HTTP request payload using JSON path, then map the values from fields in the RudderStack payload(using JSON path) or constants.",
"note": "Build your HTTP request payload using JSON path, then map the values from fields in the RudderStack payload (using JSON path) or constants.",
"configKey": "propertiesMapping",
"separatorIcon": "colon",
"addButtonLabel": "Add request mapping",
Expand All @@ -579,15 +579,15 @@
"type": "textInput",
"configKey": "to",
"label": "Key",
"regex": "^\\$(?:\\.|(\\.(\\w+|\\*)|\\[\\d+\\]|\\[('\\w+'|\"\\w+\")\\]|\\[\\*\\]|\\.\\w+\\(\\))*)$",
"regex": "^(?:$|\\$(?:\\.|(\\.(\\w+|\\*)|\\[\\d+\\]|\\[('\\w+'|\"\\w+\")\\]|\\[\\*\\]|\\.\\w+\\(\\))*)$)",
"regexErrorMessage": "Please enter a valid JSON path",
"placeholder": "e.g: $.events.key2"
},
{
"type": "textInput",
"configKey": "from",
"label": "Value",
"regex": "^\\$(?:\\.|(?:\\.\\.(\\w+|\\*)|\\.(\\w+|\\*)|\\[\\d+\\]|\\[('\\w+'|\"\\w+\")\\]|\\[\\*\\]|\\.\\w+\\(\\))*)$|^(?!\\$)[A-Za-z0-9!#$%&'*+.^_`|~-]{1,100}$",
"regex": "^\\$(?:\\.|(?:\\.\\.(\\w+|\\*)|\\.(\\w+|\\*)|\\[\\d+\\]|\\[('\\w+'|\"\\w+\")\\]|\\[\\*\\]|\\.\\w+\\(\\))*)$|^(?!\\$)[A-Za-z0-9!#$%&'*+.^_`|~-]{0,100}$",
"regexErrorMessage": "Please enter a valid JSON path or a constant",
"placeholder": "e.g: $.properties.key1"
}
Expand Down
27 changes: 27 additions & 0 deletions test/data/validation/destinations/http.json
Original file line number Diff line number Diff line change
Expand Up @@ -695,5 +695,32 @@
"ketchConsentPurposes.web must be array",
"ketchConsentPurposes.unity.0 must be object"
]
},
{
"testTitle": "With empty propertiesMapping",
"config": {
"apiUrl": "http://sample.com/api/hooks/{{$.traits.userId}}/url/{{$.properties.event}}",
"auth": "basicAuth",
"username": "test-user",
"password": "",
"method": "POST",
"format": "JSON",
"http-connectionMode": "cloud",
"connectionMode": {
"cloud": "cloud"
},
"consentManagement": {},
"isBatchingEnabled": true,
"maxBatchSize": "10",
"headers": [],
"queryParams": [],
"propertiesMapping": [
{
"from": "",
"to": ""
}
]
},
"result": true
}
]

0 comments on commit 2b51393

Please sign in to comment.