Memory v1, Intelligence v3 and Conversations v2 instances return nil for multi-word fields (camelCase responses read as snake_case)

Open
#814 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
ruby
Domain
api

Research direction

Start with the initialize and property readers in lib/twilio-ruby/rest/intelligence/v3/operator.rb and lib/twilio-ruby/rest/conversations/v2/configuration.rb, then compare them with a one-word field that already works, such as id. Check whether the same snake_case lookup pattern appears in the Memory v1 store instance. Reproduce by building an instance from a hash with displayName and statusUrl keys, as the issue shows. Done when display_name and status_url return the camelCase values, which requires either a key-conversion step or per-field camelCase keys, and the existing specs still pass.

Written by the indexing model from the issue text.

Description

Version: twilio-ruby 7.11.3, Ruby 3.4

Description

These APIs return camelCase JSON, for example displayName, statusUrl and conversationGroupingType. The generated instance classes read snake_case keys instead, such as payload['display_name'] and payload['status_url'], and nothing converts the keys. Every multi-word attribute is therefore nil. One-word fields like id, author, status and related work.

Affected, at least:

  • Twilio::REST::Intelligence::V3::OperatorInstance
  • Twilio::REST::Intelligence::V3::ConfigurationInstance
  • Twilio::REST::Conversations::V2::ConfigurationInstance
  • Twilio::REST::Memory::V1::StoreInstance

Reproduction against a live account

client = Twilio::REST::Client.new(account_sid, auth_token)
client.intelligence.v3.operators.list(limit: 5).each { |o| p [o.id, o.display_name, o.author] }
# => ["intelligence_operator_...", nil, "TWILIO"]   (display_name is nil for every operator)
client.conversations.v2.configurations.list(limit: 5).each { |c| p [c.id, c.display_name] }
# => ["conv_configuration_...", nil]

The same request made with curl returns "displayName": "..." for each item.

Reproduction without an account

c = Twilio::REST::Client.new('ACxxx', 'token')
op = Twilio::REST::Intelligence::V3::OperatorInstance.new(c.intelligence.v3, { 'id' => 'intelligence_operator_1', 'displayName' => 'x' })
op.display_name # => nil
cf = Twilio::REST::Conversations::V2::ConfigurationInstance.new(c.conversations.v2, { 'statusUrl' => 'https://...' })
cf.status_url   # => nil

Impact

The Conversation Orchestrator quickstart's Ruby example (puts configuration.status_url) prints nothing. Code can't find existing resources by display name, or poll the operation status URL.

Expected

Instances map the API's camelCase keys, either by converting keys or by reading payload['displayName'].

Dominant language
Ruby
Stars
1.4k
Forks
472
Avg merge
16h 45m
Merged PRs (30d)
3

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from twilio/twilio-ruby

All issues in twilio/twilio-ruby

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.