Skip to content

Commit 0fa5474

Browse files
authored
add json matcher to log matcher (#103)
1 parent 5ea82a7 commit 0fa5474

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/bitdrift_public/protobuf/matcher/v1/log_matcher.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ message LogMatcher {
4141
value_matcher.v1.SemVerValueMatch sem_ver_value_match = 4;
4242
value_matcher.v1.IsSetMatch is_set_match = 5;
4343
value_matcher.v1.DoubleValueMatch double_value_match = 6;
44+
value_matcher.v1.JsonPathValueMatch json_value_match = 7;
4445
}
4546
}
4647

src/bitdrift_public/protobuf/value_matcher/v1/value_matcher.proto

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,22 @@ message SemVerValueMatch {
6262
string match_value = 2 [(validate.rules).string = {min_len: 1}];
6363
}
6464

65+
message JsonPathValueMatch {
66+
Operator operator = 1 [(validate.rules).enum.defined_only = true];
67+
message JsonPath {
68+
message KeyOrIndex {
69+
oneof key_or_index {
70+
option (validate.required) = true;
71+
72+
string key = 1 [(validate.rules).string = {min_len: 1}];
73+
int32 index = 2;
74+
}
75+
}
76+
77+
string path = 1 [(validate.rules).string = {min_len: 1}];
78+
}
79+
string match_value = 2 [(validate.rules).string = {min_len: 1}];
80+
}
81+
6582
// Matcher to evaluate whether a value is set.
6683
message IsSetMatch {}

0 commit comments

Comments
 (0)