Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] Secret Store list command to produce empty array instead of null for json output #1389

Open
vcarvajal-sigsci opened this issue Feb 7, 2025 · 1 comment

Comments

@vcarvajal-sigsci
Copy link

When requesting to list edge resources in json, the secret store produces a null output when empty.

vcarvajal@vcarvajal-fastly:$ fastly secret-store list --quiet --json
null

I'm using the following version:

vcarvajal@vcarvajal-fastly:$ fastly version
Fastly CLI version v10.18.0 (9679de4f)
Built with go version go1.22.11 linux/amd64 (2025-02-07)
Viceroy version: viceroy 0.12.2

Additionally, the output from various other edge resources types will produce an empty array.

vcarvajal@vcarvajal-fastly:$ fastly object-store list --quiet --json
{
  "Data": [],
  "Meta": {
    "limit": "1000",
    "total": "0"
  }
}
vcarvajal@vcarvajal-fastly:$ fastly kv-store list --quiet --json
{
  "Data": [],
  "Meta": {
    "limit": "1000",
    "total": "0"
  }
}
vcarvajal@vcarvajal-fastly:$ fastly config-store list --quiet --json
[]

Describe the solution you'd like

It would be great to have them produce an empty array rather than null.

vcarvajal@vcarvajal-fastly:$ fastly secret-store list --quiet --json
[]
@kpfleming
Copy link
Contributor

Agreed, the lack of consistency here is harmful. In fact the 'kv-store list' command is literally just emitting the raw JSON response from the API endpoint...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants