Skip to content

sds-go: add MatchAction UnmarshalJSON - #379

Merged
vinckama merged 2 commits into
mainfrom
vincent.roy/match-action-unmarshal-json
Aug 20, 2026
Merged

sds-go: add MatchAction UnmarshalJSON#379
vinckama merged 2 commits into
mainfrom
vincent.roy/match-action-unmarshal-json

Conversation

@vinckama

@vinckama vinckama commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

MatchAction had MarshalJSON for the Rust-facing rule wire format but no symmetric decoder. Go-marshaled and export-shaped JSON includes both type and match_action inside the object; strict json decoding failed on the inner match_action key and on export placeholders with empty strings.

Add UnmarshalJSON with DisallowUnknownFields and tests covering export placeholders, redact variants, unknown-field rejection, and round-trip with MarshalJSON.

Needed for this to enforce schema with failing on unknown fields

@vinckama
vinckama requested a review from a team as a code owner August 19, 2026 17:57
@vinckama
vinckama force-pushed the vincent.roy/match-action-unmarshal-json branch from e475aec to de328a3 Compare August 20, 2026 11:19
MatchAction had MarshalJSON for the Rust-facing rule wire format but no
symmetric decoder. Go-marshaled and export-shaped JSON includes both type
and match_action inside the object; strict json decoding failed on the
inner match_action key and on export placeholders with empty strings.

Add UnmarshalJSON with DisallowUnknownFields and tests covering export
placeholders, redact variants, unknown-field rejection, and round-trip
with MarshalJSON.
@vinckama
vinckama force-pushed the vincent.roy/match-action-unmarshal-json branch from de328a3 to 3015736 Compare August 20, 2026 12:21
@vinckama
vinckama changed the base branch from main to vincent.roy/bump-h2-rustsec-2026-0258 August 20, 2026 12:22
Base automatically changed from vincent.roy/bump-h2-rustsec-2026-0258 to main August 20, 2026 14:27
@vinckama
vinckama enabled auto-merge August 20, 2026 14:27
@vinckama
vinckama merged commit 30bd0e9 into main Aug 20, 2026
5 checks passed
@vinckama
vinckama deleted the vincent.roy/match-action-unmarshal-json branch August 20, 2026 14:31
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