Repository navigation
fix(output): project the rows of a single --page, not its envelope - #454
Merged
Merged
Conversation
ktn-jamf
force-pushed
the
fix/page-select-projection
branch
from
October 26, 2026 22:43
70187e9 to
8b0d186
Compare
--page answers {results, totalCount}, so --select and --field projected the
envelope's own two keys: --select id printed {} and --field id matched
nothing, both at exit 0. UnwrapPage reads the rows when a projection is set,
as --all already does. Both keys are required so a record that carries a
results field is left alone.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
neilmartin83
force-pushed
the
fix/page-select-projection
branch
from
October 28, 2026 18:17
8b0d186 to
b7d633b
Compare
grahampugh
approved these changes
Oct 29, 2026
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.
Stacked on #453.
Problem
--pageanswers{results, totalCount}, so--selectand--fieldprojected the envelope's own two keys:Both exit 0. Without
--page, the same flags project each row.Change
output.UnwrapPagereads the rows of a single page when a projection (--select,--compact) or--fieldis set, the way--allalready does. BothtotalCountandresultsmust be present, so a record that merely carries aresultsfield is left alone. The unwrapped output no longer carriestotalCount.Verification
go test ./...,golangci-lint run,gofumptclean.platform-nmartinandpro-nmartin:--page 0 --page-size 2 --select idreturns ids64and46in json and csv, and--field idprints them.🤖 Generated with Claude Code