Skip to content

Enforce top-level additionalProperties: false in load_param_table_yaml()#214

Merged
james-ball-qualcomm merged 2 commits intomainfrom
copilot/sub-pr-212-again
Mar 15, 2026
Merged

Enforce top-level additionalProperties: false in load_param_table_yaml()#214
james-ball-qualcomm merged 2 commits intomainfrom
copilot/sub-pr-212-again

Conversation

Copy link
Contributor

Copilot AI commented Mar 15, 2026

load_param_table_yaml() validated columns[*] entries but silently ignored unknown top-level keys, allowing typos like colums: to go undetected despite schemas/param-table-schema.json specifying additionalProperties: false at the top level.

Changes

  • tools/create_param_appendix.py: After loading the YAML, compute the set difference against {"columns", "$schema"} and fatal() if any unexpected keys are present.
allowed_top_level_keys = {"columns", "$schema"}
unexpected_top_level_keys = sorted(set(data.keys()) - allowed_top_level_keys)
if unexpected_top_level_keys:
    fatal(
        f"Unexpected top-level properties in {pathname}: "
        f"{', '.join(unexpected_top_level_keys)}"
    )

A file with a key like colums: now produces a clear fatal error instead of silently proceeding with the columns: data.


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Co-authored-by: james-ball-qualcomm <140646808+james-ball-qualcomm@users.noreply.github.com>
Copilot AI changed the title [WIP] [WIP] Address feedback from review on organizing params by chapter Enforce top-level additionalProperties: false in load_param_table_yaml() Mar 15, 2026
Base automatically changed from org-param-app-by-ch to main March 15, 2026 16:53
@james-ball-qualcomm james-ball-qualcomm marked this pull request as ready for review March 15, 2026 17:05
Copilot AI review requested due to automatic review settings March 15, 2026 17:05
@james-ball-qualcomm james-ball-qualcomm merged commit 581cb90 into main Mar 15, 2026
3 checks passed
@james-ball-qualcomm james-ball-qualcomm deleted the copilot/sub-pr-212-again branch March 15, 2026 17:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens validation of the parameter table layout YAML consumed by tools/create_param_appendix.py, ensuring the YAML’s top-level shape matches the schemas/param-table-schema.json contract.

Changes:

  • Added top-level key validation for the parameter table YAML, only allowing columns and optional $schema.
  • Emit a fatal error when unexpected top-level properties are present.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +125 to +131
allowed_top_level_keys = {"columns", "$schema"}
unexpected_top_level_keys = sorted(set(data.keys()) - allowed_top_level_keys)
if unexpected_top_level_keys:
fatal(
f"Unexpected top-level properties in {pathname}: "
f"{', '.join(unexpected_top_level_keys)}"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants