Skip to content

Reject extra documents in parameter files#78

Open
apstndb wants to merge 2 commits into
mainfrom
fix/strict-param-file-documents
Open

Reject extra documents in parameter files#78
apstndb wants to merge 2 commits into
mainfrom
fix/strict-param-file-documents

Conversation

@apstndb

@apstndb apstndb commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Require JSON parameter files to contain one top-level mapping and reject trailing content, a second value, and JSON null.
  • Reject additional value-bearing YAML documents instead of silently ignoring parameters after the first document.
  • Preserve existing empty-file, comments-only YAML, empty-document, and empty-mapping behavior with focused format-specific regression tests.

Validation

  • go test ./params/...
  • go test -race ./params/...
  • go test -count=1 ./...
  • go vet ./...
  • golangci-lint run ./...
  • git diff --check

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the parameter file loading logic in params/load.go to enforce that JSON and YAML files contain exactly one top-level mapping. It adds validation to reject top-level null values and multiple documents/values. Additionally, new unit tests are introduced in params/load_test.go to verify these validation rules. There are no review comments, so I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

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.

1 participant