Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix constraint type checks for command responses. #30218

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix constraint type checks for command responses.
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 committed Nov 4, 2023
commit ae1bfff1f723e894490b7b876ccef9ed398107ef
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
Loading