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

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

Open
TheCycoONE opened this issue Oct 30, 2021 · 1 comment
Open

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

TheCycoONE opened this issue Oct 30, 2021 · 1 comment
Labels
status: help wanted requesting help from the community type: bug bug in the library

Comments

@TheCycoONE
Copy link

TheCycoONE commented Oct 30, 2021

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
@TheCycoONE TheCycoONE changed the title -o json renames some keys -o json changes naming scheme of top level keys Oct 30, 2021
@shrutiburman
Copy link
Contributor

Thanks for raising this @TheCycoONE and being patient!
To parse API responses twilio-cli uses generated Open API Spec which is based upon api-definitions.
I have cut out a ticket internally to address the case-inconsistency in top level and lower level keys.
+1s and Pull Requests will help us move it up in our backlog.

@shrutiburman shrutiburman added bug status: help wanted requesting help from the community type: bug bug in the library and removed bug labels Nov 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: help wanted requesting help from the community type: bug bug in the library
Projects
None yet
Development

No branches or pull requests

2 participants