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

Some commands don't emit JSON when SF_CONTENT_TYPE=JSON #2331

Closed
jstvz opened this issue Jul 28, 2023 · 3 comments
Closed

Some commands don't emit JSON when SF_CONTENT_TYPE=JSON #2331

jstvz opened this issue Jul 28, 2023 · 3 comments
Labels
bug Issue or pull request that identifies or fixes a bug investigating We're actively investigating this issue validated Version information for this issue has been validated

Comments

@jstvz
Copy link

jstvz commented Jul 28, 2023

Note
Before you submit your issue, make sure that:

  • You're using the latest version of Salesforce CLI.
  • You've searched both open and closed issues for related posts.
  • You've used the doctor command to diagnose common issues.
  • You understand that GitHub Issues don't adhere to any agreement or SLA.
    • If you require immediate assistance, use official channels such as Salesforce Customer Support.

Summary

Setting SF_CONTENT_TYPE=JSON for at least two commands results in human readable output.

Steps To Reproduce

export SF_CONTENT_TYPE='json'
sf version | jq .cliVersion
sf commands | jq '.[0].id'

Expected result

Output should match --json output

$ export SF_CONTENT_TYPE='json'
$ sf version | jq .cliVersion
"@salesforce/cli/2.1.7"
$ sf commands --json | jq '.[0].id'
"alias:list"

Actual result

$ export SF_CONTENT_TYPE='json'
$ sf version | jq .cliVersion
parse error: Invalid numeric literal at line 1, column 22
$ sf commands | jq '.[0].id'
parse error: Invalid numeric literal at line 1, column 9

System Information

$ $SHELL --version
zsh 5.9 (x86_64-apple-darwin22.0)
{
  "cliVersion": "@salesforce/cli/2.1.7",
  "architecture": "darwin-x64",
  "nodeVersion": "node-v16.18.0",
  "osVersion": "Darwin 22.5.0",
  "shell": "zsh",
  "rootPath": "/Users/jestevez/.volta/tools/image/packages/@salesforce/cli/lib/node_modules/@salesforce/cli",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 2.3.2 (core)",
    "@oclif/plugin-commands 2.2.18 (core)",
    "@oclif/plugin-help 5.2.13 (core)",
    "@oclif/plugin-not-found 2.3.31 (core)",
    "@oclif/plugin-plugins 3.1.6 (core)",
    "@oclif/plugin-search 0.0.20 (core)",
    "@oclif/plugin-update 3.1.26 (core)",
    "@oclif/plugin-version 1.3.7 (core)",
    "@oclif/plugin-warn-if-update-available 2.0.43 (core)",
    "@oclif/plugin-which 2.2.25 (core)",
    "@salesforce/cli 2.1.7 (core)",
    "apex 2.3.6 (core)",
    "auth 2.8.9 (core)",
    "data 2.5.1 (core)",
    "deploy-retrieve 1.16.0 (core)",
    "env 2.1.18 (user)",
    "info 2.6.31 (core)",
    "limits 2.3.26 (core)",
    "login 1.2.20 (core)",
    "org 2.9.25 (core)",
    "packaging 1.21.1 (user)",
    "schema 2.3.20 (core)",
    "settings 1.4.20 (core)",
    "sobject 0.1.37 (core)",
    "source 2.10.25 (core)",
    "telemetry 2.2.3 (core)",
    "templates 55.5.5 (core)",
    "trust 2.4.32 (core)",
    "user 2.3.24 (core)"
  ]
}

Additional information

@jstvz jstvz added the investigating We're actively investigating this issue label Jul 28, 2023
@github-actions
Copy link

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

@github-actions github-actions bot added the validated Version information for this issue has been validated label Jul 28, 2023
@iowillhoit
Copy link
Contributor

Confirmed, I'll get a ticket created. Thanks @jstvz

@iowillhoit iowillhoit added the bug Issue or pull request that identifies or fixes a bug label Jul 28, 2023
@git2gus
Copy link

git2gus bot commented Jul 28, 2023

This issue has been linked to a new work item: W-13848014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue or pull request that identifies or fixes a bug investigating We're actively investigating this issue validated Version information for this issue has been validated
Projects
None yet
Development

No branches or pull requests

3 participants