Skip to content

fix(api): emit empty list fields in REST JSON responses - #1485

Open
sudhishmk wants to merge 1 commit into
tektoncd:mainfrom
sudhishmk:fix/list-records-empty-json-1076
Open

sudhishmk wants to merge 1 commit into
tektoncd:mainfrom
sudhishmk:fix/list-records-empty-json-1076

Conversation

@sudhishmk

Copy link
Copy Markdown

Fixes #1076

Summary

  • Enable EmitUnpopulated on the gRPC gateway JSON marshaler so empty list responses include records/results and next_page_token fields.

Changes

The gRPC gateway JSON marshaler omitted zero-value fields, so empty ListRecords/ListResults responses serialized as {} instead of {"records":[],"next_page_token":""}. Enable EmitUnpopulated to match the OpenAPI spec and grpc-gateway defaults.

Test plan

  • go test ./cmd/api/ -run 'TestAPIJSONMarshaler' -v
  • make fmt
  • make golangci-lint
  • ./test/presubmit-tests.sh --unit-tests
  • [ ]
    /kind bug

@tekton-robot tekton-robot added the kind/bug Categorizes issue or PR as related to a bug. label Sep 9, 2026
@tekton-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign enarha after the PR has been reviewed.
You can assign the PR to them by writing /assign @enarha in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot
tekton-robot requested review from enarha and khrm September 9, 2026 17:19
@tekton-robot tekton-robot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 9, 2026
@sudhishmk

Copy link
Copy Markdown
Author

/release-note-none

@tekton-robot tekton-robot added release-note-none Denotes a PR that doesnt merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Categorizes issue or PR as related to a bug. release-note-none Denotes a PR that doesnt merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

List Records returns {}

2 participants