fix(codegen): handle 'Field ID' header in command param tables#3692
Merged
fix(codegen): handle 'Field ID' header in command param tables#3692
Conversation
Matter 1.5.1 AudioOutput cluster spec uses "Field ID" column header in SelectOutput and RenameOutput parameter tables. Header normalizes to column key "fieldid", but FieldSchema.id was bare Integer with no alias, so the lookup failed and both commands generated with no parameters. Add "fieldid" alias so the parser recognizes that header. Regenerated intermediate spec and standard model — AudioOutput SelectOutput now has Index and RenameOutput has Index + Name as the spec defines. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes Matter spec codegen to recognize command/struct field tables that use a non-standard Field ID column header (normalized to fieldid), which previously caused the AudioOutput cluster’s SelectOutput / RenameOutput commands to be generated without request parameters.
Changes:
- Updated the spec table field schema to alias
fieldid→idduring table translation. - Regenerated the Matter 1.5.1 spec model and standard model so AudioOutput command request fields are emitted.
- Regenerated TypeScript cluster typings so
selectOutput/renameOutputnow require the correct request payload types.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| support/codegen/src/mom/spec/translate-datatype.ts | Adds fieldid alias for the canonical id column when translating field tables. |
| support/models/src/v1.5.1/spec.ts | Regenerated v1.5.1 spec model to include AudioOutput command request fields. |
| packages/model/src/standard/elements/audio-output.element.ts | Regenerated standard element model to include command parameter fields for AudioOutput. |
| packages/model/src/standard/resources/audio-output.resource.ts | Regenerated resource metadata; SelectOutput now includes its Index field documentation. |
| packages/types/src/clusters/audio-output.d.ts | Regenerated cluster typings; adds request types and updates command signatures to accept them. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
06-05-audio-output-cluster.md) is the only spec file using| Field ID |as the column header for command parameter tables — every other cluster uses| ID |. Header normalization stripped non-word chars and lowercased, producing column keyfieldid.FieldSchema.idintranslate-datatype.tswas bareInteger(no alias), so the lookup failed and SelectOutput / RenameOutput generated with no parameters.Alias(Integer, "fieldid")so the parser recognizes the variant header. Regeneratedsupport/models/src/v1.5.1/spec.tsand the standard model —AudioOutput.SelectOutputnow hasIndex,AudioOutput.RenameOutputnow hasIndex+Name, andpackages/types/src/clusters/audio-output.d.tsexposesSelectOutputRequest/RenameOutputRequestwith the proper signatures.🤖 Generated with Claude Code