fix: reject unknown structured collection keys#55
Conversation
There was a problem hiding this comment.
Pull request overview
This PR tightens strict-mode validation to reject unknown keys that appear inside directly provided structured collection values (e.g., map[string]Struct values provided as nested maps, and []Struct elements provided as nested objects), and adds regression tests to prevent strict-mode bypasses for these cases.
Changes:
- Extend strict-mode unknown-key detection to recursively validate nested keys inside structured
struct,[]struct, andmap[string]structvalues provided directly in source data. - Add helper functions to collect valid key→type mappings and to recursively validate nested structured values.
- Add regression tests covering unknown nested keys in direct map values and slice elements under strict mode.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| loader.go | Adds strict-mode recursion to detect unknown nested keys inside structured collection values. |
| loader_test.go | Adds regression tests ensuring strict mode rejects unknown nested keys in direct map values and slice elements. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Codex Review: Didn't find any major issues. Hooray! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0fafc07413
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Summary
Validation