Skip to content

-o json changes naming scheme of top level keys #171

@TheCycoONE

Description

@TheCycoONE

Issue Summary

When the json output mode is used, top level keys are converted from snake case to camel case. Lower level keys are not modified.

Steps to Reproduce

  1. Fetch CustomerProfile evaluation with curl: curl https://trusthub.twilio.com/v1/CustomerProfiles/BUba422222159fd9b24ec6ab18f391650d/Evaluations/EL97cbd107e00509fdb56c0bc30fec6991 -u '<redacted>'
  2. Fetch same evaluation with CLI, using 'raw' json output: twilio api:trusthub:v1:customer-profiles:evaluations:fetch --sid=EL97cbd107e00509fdb56c0bc30fec6991 --customer-profile-sid=BUba422222159fd9b24ec6ab18f391650d -o json --profile=brand-test
  3. Compare the json

Example

From twilio cli

...
    "accountSid": "AC6a4293256e150602674ce979da94c34c",
    "customerProfileSid": "BUba422222159fd9b24ec6ab18f391650d",
    "dateCreated": "2021-10-30T00:41:32.000Z",
    "policySid": "RNdfbf3fae0e1107f8aded0e7cead80bf5",
    "results": [
...

From CURL

...
"account_sid": "AC6a4293256e150602674ce979da94c34c", "date_created": "2021-10-30T00:41:32Z", "sid": "EL97cbd107e00509fdb56c0bc30fec6991", "policy_sid": "RNdfbf3fae0e1107f8aded0e7cead80bf5", "customer_profile_sid": "BUba422222159fd9b24ec6ab18f391650d"}
...

Example from twilio cli of nested field:

...
        "fields": [
          {
            "object_field": "bundle_sid",
            "error_code": null,
            "friendly_name": "Supporting Bundle Status",
            "passed": true,
            "failure_reason": null
          }
...

Technical details:

  • twilio-cli-core version: twilio-cli/2.32.1 darwin-x64 node-v14.16.1
  • node version: v14.16.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions