Skip to content

fix(output): allow literal-dotted keys in --output-fields paths#336

Merged
JoshMock merged 2 commits into
mainfrom
fix/output-fields-literal-dot-keys
May 18, 2026
Merged

fix(output): allow literal-dotted keys in --output-fields paths#336
JoshMock merged 2 commits into
mainfrom
fix/output-fields-literal-dot-keys

Conversation

@flobernd

Copy link
Copy Markdown
Member

Summary

  • Cat APIs return flat objects whose keys contain literal dots (docs.count, store.size), but --output-fields parsing split every dot as a nesting separator, silently dropping those fields.
  • getNestedValue now prefers a literal-key match before falling back to dot-notation descent; pickFields preserves the literal key verbatim in the projected output.
  • Existing nested-path behaviour for normal JSON responses is unchanged; a literal key wins over an equivalent nested path when both are present.

Closes #325

Cat APIs return flat objects whose keys contain literal dots (e.g. `docs.count`,
`store.size`), but `--output-fields` parsing split every dot as a nesting
separator, silently dropping those fields. Prefer a literal-key match before
falling back to dot-notation descent so cat-style projections work as expected.
@github-actions

github-actions Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 7.13s
✅ REPOSITORY gitleaks yes no no 54.84s
✅ REPOSITORY git_diff yes no no 0.62s
✅ REPOSITORY secretlint yes no no 27.08s
✅ REPOSITORY trivy yes no no 19.58s
✅ TYPESCRIPT eslint 2 0 0 5.9s

See detailed reports in MegaLinter artifacts
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

@JoshMock JoshMock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👏

@JoshMock JoshMock enabled auto-merge (squash) May 18, 2026 17:32
@JoshMock JoshMock merged commit aecf689 into main May 18, 2026
18 of 19 checks passed
@JoshMock JoshMock deleted the fix/output-fields-literal-dot-keys branch May 18, 2026 17:39
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.

--output-fields silently drops cat-API fields with literal dots in keys

2 participants