Skip to content

Commit

Permalink
Fix constraint type checks for command responses. (#30218)
Browse files Browse the repository at this point in the history
For a command response, the YAML parser was ending up with the wrong type
definition (the one for the whole command response, not the one for the one
field) when a type-dependent constraint was used on a field of the response.
This led to issues when a type-dependent constraint (like "contains") was used
with a list of structs: the field names for the structs were not found, since
the object used for lookup had field names for the command itself, not for the
field in question.

Fixes #30204
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Jan 16, 2024
1 parent 80ab70c commit 2504114
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/py_matter_yamltests/matter_yamltests/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ def _update_with_definition(self, container: dict, mapping_type):
# the the value type for the target field.
if is_typed_constraint(constraint):
value[key][constraint] = self._update_value_with_definition(
constraint_value, mapping_type)
constraint_value, mapping)
else:
# This key, value pair does not rely on cluster specifications.
pass
Expand Down

0 comments on commit 2504114

Please sign in to comment.