Skip to content

pkg/filters: make field filters work with snake case fields#1223

Merged
willfindlay merged 1 commit into
mainfrom
pr/willfindlay/field-filters-support-snake-case
Jul 14, 2023
Merged

pkg/filters: make field filters work with snake case fields#1223
willfindlay merged 1 commit into
mainfrom
pr/willfindlay/field-filters-support-snake-case

Conversation

@willfindlay

@willfindlay willfindlay commented Jul 13, 2023

Copy link
Copy Markdown
Contributor

Protobuf does not support snake case in the JSON representation of FieldMasks. This is a problem for us because our canonical representation of fields is in snake_case and we don't want to create confusion. To make things consistent, this patch introduces a hack to perform the snake case to camel case conversion just before we unmarshal from JSON.

Field filters for masking event export fields now support path names defined in snake_case as well as camelCase.
@willfindlay
willfindlay requested a review from a team as a code owner July 13, 2023 17:48
@willfindlay
willfindlay requested a review from olsajiri July 13, 2023 17:48
Protobuf does not support snake case in the JSON representation of FieldMasks. This is
a problem for us because our canonical representation of fields is in snake_case and we
don't want to create confusion. To make things consistent, this patch introduces a hack to
perform the snake case to camel case conversion just before we unmarshal from JSON.

Signed-off-by: William Findlay <will@isovalent.com>
@willfindlay
willfindlay force-pushed the pr/willfindlay/field-filters-support-snake-case branch from 068bb58 to 8cda5ea Compare July 14, 2023 13:28
@willfindlay willfindlay added the release-note/minor This PR introduces a minor user-visible change label Jul 14, 2023
@willfindlay
willfindlay merged commit 831dff9 into main Jul 14, 2023
@willfindlay
willfindlay deleted the pr/willfindlay/field-filters-support-snake-case branch July 14, 2023 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/minor This PR introduces a minor user-visible change

2 participants