Skip to content

Commit f9c4bbf

Browse files
authored
fix(AIP-160): clarify unset field in traversal behavior (#1469)
* fix(AIP-160): clarify unset field in traversal behavior * chore: include nuance of != in unset case
1 parent ae9ae94 commit f9c4bbf

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

aip/general/0160.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,13 @@ the service **should** return an error with `INVALID_ARGUMENT`. A service
138138
**may** permit traversal to undefined keys on maps and structs, and **should**
139139
document how it behaves in this situation.
140140

141+
When evaluating an expression involving a traversal, if any non-primitive field
142+
in the chain is not set on the entry being evaluated, the entry **should** be
143+
skipped i.e. not match the filter expression. This applies even when the
144+
comparison is a `!=`, which would imply matching on empty values. In the
145+
examples above, if resource field `a` is not set on the resource instance, that
146+
instance is skipped as a non-match.
147+
141148
**Important:** The `.` operator **must not** be used to traverse through a
142149
repeated field or list, except for specific use with the `:` operator.
143150

@@ -224,4 +231,5 @@ Schematic validation refers, but is not limited to, the following:
224231

225232
## Changelog
226233

234+
- **2025-01-07**: Clarify behavior for unset field in traversal operator chain.
227235
- **2024-12-11**: Move non-compliant filter guidance to Validation section.

0 commit comments

Comments
 (0)