-
Notifications
You must be signed in to change notification settings - Fork 31
Description
Problem
KeyValueMapField always renders a hidden <input> with JSON.stringify() of its pairs. When there are no valid key-value pairs, this produces "{}" (empty JSON object), which the webhook destination backend validation rejects — it expects either a non-empty headers map or the field to be absent/empty string.
Currently both CreateDestination and DestinationSettings have band-aid fixes that convert "{}" to "" for custom_headers specifically. This is fragile and requires every consumer to handle the edge case.
Proposed fix
Fix KeyValueMapField at the source: don't render the hidden <input> when there are no valid pairs. This way the field is simply absent from the form data — no ambiguity between "" and "{}", and no band-aids needed in consumers.
Once the component is fixed, remove the custom_headers workarounds in:
CreateDestination.tsxDestinationSettings.tsx
Files
internal/portal/src/common/KeyValueMapField/KeyValueMapField.tsxinternal/portal/src/scenes/CreateDestination/CreateDestination.tsxinternal/portal/src/scenes/Destination/DestinationSettings/DestinationSettings.tsx
Metadata
Metadata
Assignees
Labels
Type
Projects
Status