Skip to content

fix: return request output format when list is empty#584

Merged
craicoverflow merged 1 commit intoredhat-developer:mainfrom
craicoverflow:return-json-when-none
Apr 16, 2021
Merged

fix: return request output format when list is empty#584
craicoverflow merged 1 commit intoredhat-developer:mainfrom
craicoverflow:return-json-when-none

Conversation

@craicoverflow
Copy link
Contributor

Fixes #579

Verification Steps

Run rhoas kafka list, rhoas kafka topic list, rhoas serviceaccount list and rhoas kafka consumergroup list, passing -o json and -o yml (requires 2 runs).

When there are no items, the JSON or YAML will be returned.

$ ./rhoas kafka list -o yaml
kind: KafkaRequestList
page: 1
size: 0
total: 0
items: []

$ ./rhoas kafka topic list -o json
{
  "count": 0,
  "items": [],
  "limit": 0,
  "offset": 0
}

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • Documentation added for the feature
  • CI and all relevant tests are passing
  • Code Review completed
  • Verified independently by reviewer

BREAKING CHANGE: The `list` commands now return the original response
object in JSON or YAML, instead of nil, depending on the format requested.
@craicoverflow craicoverflow merged commit 52e7fd4 into redhat-developer:main Apr 16, 2021
@craicoverflow craicoverflow deleted the return-json-when-none branch April 16, 2021 09:28
craicoverflow pushed a commit that referenced this pull request Apr 20, 2021
BREAKING CHANGE: The `list` commands now return the original response
object in JSON or YAML, instead of nil, depending on the format requested.
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.

Get topic list as JSON returns message instead of empty list

1 participant