Skip to content

Commit bd7701b

Browse files
alexluongclaude
andauthored
feat: RFC 7396 JSON merge-patch for destination update (#850)
* feat: add RFC 7396 JSON merge-patch semantics for destination update Destination PATCH now uses merge-patch for config, credentials, metadata, and delivery_metadata: send keys to add/update, null values to delete keys, null for entire field to clear. Filter keeps full replacement semantics. This replaces the previous shallow-merge that could not delete keys or clear fields. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * test: add SDK e2e tests for merge-patch + enable Go nullableOptionalWrapper Adds merge-patch e2e tests for TS (15), Python (14), and Go (7) SDKs covering metadata key deletion via null, field clearing, empty no-op, and filter replacement semantics. Flips nullableOptionalWrapper: true in Go SDK gen.yaml so Go callers can distinguish omitted vs null vs value (breaking change for Go SDK). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 945d05d commit bd7701b

11 files changed

Lines changed: 1514 additions & 51 deletions

File tree

docs/apis/openapi.yaml

Lines changed: 129 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ components:
182182
Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination.
183183
Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not.
184184
If null or empty, all events matching the topic filter will be delivered.
185-
To remove an existing filter when updating a destination, set filter to an empty object `{}`.
185+
Uses full-replacement semantics on update: send a new object to replace, null or `{}` to clear, omit for no change.
186186
example:
187187
data:
188188
amount:
@@ -1481,16 +1481,28 @@ components:
14811481
delivery_metadata:
14821482
type: object
14831483
additionalProperties:
1484-
type: string
1484+
oneOf:
1485+
- type: string
1486+
- type: "null"
14851487
nullable: true
1486-
description: Static key-value pairs merged into event metadata on every attempt.
1488+
description: >-
1489+
Static key-value pairs merged into event metadata on every attempt.
1490+
Uses JSON merge-patch semantics (RFC 7396): send keys to add/update,
1491+
null values to delete keys, null for entire field to clear all.
1492+
Omit or send {} for no change.
14871493
example: { "app-id": "my-app", "region": "us-east-1" }
14881494
metadata:
14891495
type: object
14901496
additionalProperties:
1491-
type: string
1497+
oneOf:
1498+
- type: string
1499+
- type: "null"
14921500
nullable: true
1493-
description: Arbitrary contextual information stored with the destination.
1501+
description: >-
1502+
Arbitrary contextual information stored with the destination.
1503+
Uses JSON merge-patch semantics (RFC 7396): send keys to add/update,
1504+
null values to delete keys, null for entire field to clear all.
1505+
Omit or send {} for no change.
14941506
example: { "internal-id": "123", "team": "platform" }
14951507
DestinationUpdateAWSSQS:
14961508
type: object
@@ -1507,16 +1519,28 @@ components:
15071519
delivery_metadata:
15081520
type: object
15091521
additionalProperties:
1510-
type: string
1522+
oneOf:
1523+
- type: string
1524+
- type: "null"
15111525
nullable: true
1512-
description: Static key-value pairs merged into event metadata on every attempt.
1526+
description: >-
1527+
Static key-value pairs merged into event metadata on every attempt.
1528+
Uses JSON merge-patch semantics (RFC 7396): send keys to add/update,
1529+
null values to delete keys, null for entire field to clear all.
1530+
Omit or send {} for no change.
15131531
example: { "app-id": "my-app", "region": "us-east-1" }
15141532
metadata:
15151533
type: object
15161534
additionalProperties:
1517-
type: string
1535+
oneOf:
1536+
- type: string
1537+
- type: "null"
15181538
nullable: true
1519-
description: Arbitrary contextual information stored with the destination.
1539+
description: >-
1540+
Arbitrary contextual information stored with the destination.
1541+
Uses JSON merge-patch semantics (RFC 7396): send keys to add/update,
1542+
null values to delete keys, null for entire field to clear all.
1543+
Omit or send {} for no change.
15201544
example: { "internal-id": "123", "team": "platform" }
15211545
DestinationUpdateRabbitMQ:
15221546
type: object
@@ -1533,16 +1557,28 @@ components:
15331557
delivery_metadata:
15341558
type: object
15351559
additionalProperties:
1536-
type: string
1560+
oneOf:
1561+
- type: string
1562+
- type: "null"
15371563
nullable: true
1538-
description: Static key-value pairs merged into event metadata on every attempt.
1564+
description: >-
1565+
Static key-value pairs merged into event metadata on every attempt.
1566+
Uses JSON merge-patch semantics (RFC 7396): send keys to add/update,
1567+
null values to delete keys, null for entire field to clear all.
1568+
Omit or send {} for no change.
15391569
example: { "app-id": "my-app", "region": "us-east-1" }
15401570
metadata:
15411571
type: object
15421572
additionalProperties:
1543-
type: string
1573+
oneOf:
1574+
- type: string
1575+
- type: "null"
15441576
nullable: true
1545-
description: Arbitrary contextual information stored with the destination.
1577+
description: >-
1578+
Arbitrary contextual information stored with the destination.
1579+
Uses JSON merge-patch semantics (RFC 7396): send keys to add/update,
1580+
null values to delete keys, null for entire field to clear all.
1581+
Omit or send {} for no change.
15461582
example: { "internal-id": "123", "team": "platform" }
15471583
DestinationUpdateHookdeck:
15481584
type: object
@@ -1558,16 +1594,28 @@ components:
15581594
delivery_metadata:
15591595
type: object
15601596
additionalProperties:
1561-
type: string
1597+
oneOf:
1598+
- type: string
1599+
- type: "null"
15621600
nullable: true
1563-
description: Static key-value pairs merged into event metadata on every attempt.
1601+
description: >-
1602+
Static key-value pairs merged into event metadata on every attempt.
1603+
Uses JSON merge-patch semantics (RFC 7396): send keys to add/update,
1604+
null values to delete keys, null for entire field to clear all.
1605+
Omit or send {} for no change.
15641606
example: { "app-id": "my-app", "region": "us-east-1" }
15651607
metadata:
15661608
type: object
15671609
additionalProperties:
1568-
type: string
1610+
oneOf:
1611+
- type: string
1612+
- type: "null"
15691613
nullable: true
1570-
description: Arbitrary contextual information stored with the destination.
1614+
description: >-
1615+
Arbitrary contextual information stored with the destination.
1616+
Uses JSON merge-patch semantics (RFC 7396): send keys to add/update,
1617+
null values to delete keys, null for entire field to clear all.
1618+
Omit or send {} for no change.
15711619
example: { "internal-id": "123", "team": "platform" }
15721620
DestinationUpdateAWSKinesis:
15731621
type: object
@@ -1584,16 +1632,28 @@ components:
15841632
delivery_metadata:
15851633
type: object
15861634
additionalProperties:
1587-
type: string
1635+
oneOf:
1636+
- type: string
1637+
- type: "null"
15881638
nullable: true
1589-
description: Static key-value pairs merged into event metadata on every attempt.
1639+
description: >-
1640+
Static key-value pairs merged into event metadata on every attempt.
1641+
Uses JSON merge-patch semantics (RFC 7396): send keys to add/update,
1642+
null values to delete keys, null for entire field to clear all.
1643+
Omit or send {} for no change.
15901644
example: { "app-id": "my-app", "region": "us-east-1" }
15911645
metadata:
15921646
type: object
15931647
additionalProperties:
1594-
type: string
1648+
oneOf:
1649+
- type: string
1650+
- type: "null"
15951651
nullable: true
1596-
description: Arbitrary contextual information stored with the destination.
1652+
description: >-
1653+
Arbitrary contextual information stored with the destination.
1654+
Uses JSON merge-patch semantics (RFC 7396): send keys to add/update,
1655+
null values to delete keys, null for entire field to clear all.
1656+
Omit or send {} for no change.
15971657
example: { "internal-id": "123", "team": "platform" }
15981658
DestinationUpdateAzureServiceBus:
15991659
type: object
@@ -1610,16 +1670,28 @@ components:
16101670
delivery_metadata:
16111671
type: object
16121672
additionalProperties:
1613-
type: string
1673+
oneOf:
1674+
- type: string
1675+
- type: "null"
16141676
nullable: true
1615-
description: Static key-value pairs merged into event metadata on every attempt.
1677+
description: >-
1678+
Static key-value pairs merged into event metadata on every attempt.
1679+
Uses JSON merge-patch semantics (RFC 7396): send keys to add/update,
1680+
null values to delete keys, null for entire field to clear all.
1681+
Omit or send {} for no change.
16161682
example: { "app-id": "my-app", "region": "us-east-1" }
16171683
metadata:
16181684
type: object
16191685
additionalProperties:
1620-
type: string
1686+
oneOf:
1687+
- type: string
1688+
- type: "null"
16211689
nullable: true
1622-
description: Arbitrary contextual information stored with the destination.
1690+
description: >-
1691+
Arbitrary contextual information stored with the destination.
1692+
Uses JSON merge-patch semantics (RFC 7396): send keys to add/update,
1693+
null values to delete keys, null for entire field to clear all.
1694+
Omit or send {} for no change.
16231695
example: { "internal-id": "123", "team": "platform" }
16241696

16251697
DestinationUpdateAWSS3:
@@ -1637,16 +1709,28 @@ components:
16371709
delivery_metadata:
16381710
type: object
16391711
additionalProperties:
1640-
type: string
1712+
oneOf:
1713+
- type: string
1714+
- type: "null"
16411715
nullable: true
1642-
description: Static key-value pairs merged into event metadata on every attempt.
1716+
description: >-
1717+
Static key-value pairs merged into event metadata on every attempt.
1718+
Uses JSON merge-patch semantics (RFC 7396): send keys to add/update,
1719+
null values to delete keys, null for entire field to clear all.
1720+
Omit or send {} for no change.
16431721
example: { "app-id": "my-app", "region": "us-east-1" }
16441722
metadata:
16451723
type: object
16461724
additionalProperties:
1647-
type: string
1725+
oneOf:
1726+
- type: string
1727+
- type: "null"
16481728
nullable: true
1649-
description: Arbitrary contextual information stored with the destination.
1729+
description: >-
1730+
Arbitrary contextual information stored with the destination.
1731+
Uses JSON merge-patch semantics (RFC 7396): send keys to add/update,
1732+
null values to delete keys, null for entire field to clear all.
1733+
Omit or send {} for no change.
16501734
example: { "internal-id": "123", "team": "platform" }
16511735
DestinationUpdateGCPPubSub:
16521736
type: object
@@ -1663,16 +1747,28 @@ components:
16631747
delivery_metadata:
16641748
type: object
16651749
additionalProperties:
1666-
type: string
1750+
oneOf:
1751+
- type: string
1752+
- type: "null"
16671753
nullable: true
1668-
description: Static key-value pairs merged into event metadata on every attempt.
1754+
description: >-
1755+
Static key-value pairs merged into event metadata on every attempt.
1756+
Uses JSON merge-patch semantics (RFC 7396): send keys to add/update,
1757+
null values to delete keys, null for entire field to clear all.
1758+
Omit or send {} for no change.
16691759
example: { "app-id": "my-app", "region": "us-east-1" }
16701760
metadata:
16711761
type: object
16721762
additionalProperties:
1673-
type: string
1763+
oneOf:
1764+
- type: string
1765+
- type: "null"
16741766
nullable: true
1675-
description: Arbitrary contextual information stored with the destination.
1767+
description: >-
1768+
Arbitrary contextual information stored with the destination.
1769+
Uses JSON merge-patch semantics (RFC 7396): send keys to add/update,
1770+
null values to delete keys, null for entire field to clear all.
1771+
Omit or send {} for no change.
16761772
example: { "internal-id": "123", "team": "platform" }
16771773

16781774
# Polymorphic Destination Update Schema (for Request Bodies)

0 commit comments

Comments
 (0)