Skip to content

The SDK uses request parameters in camel case instead of snake case #1

@alexkojin

Description

@alexkojin

first_message param rejected, only works with camelCase

Hey folks — ran into an odd one when creating an assistant using the Ruby SDK.

If I use first_message (snake_case), I get this error:

#<Faraday::BadRequestError response={status:400, body:
  {"message":["property first_message should not exist"],
   "error":"Bad Request","statusCode":400}}>

But if I switch to firstMessage (camelCase), everything works fine.

Here’s a quick repro:

require 'vapi_server_sdk'

client = Vapi::Client.new(token: Rails.application.credentials.vapi.api_key)

assistant = client.assistants.create(request: {
  name: "test",
  first_message: "Hi there, this is Alex from. How can I help you today?",
})

Looks like the SDK expects Ruby-style snake_case, but the API only accepts camelCase.
Probably a serialization mismatch somewhere in [lib/vapi_server_sdk/assistants/client.rb](https://github.com/VapiAI/server-sdk-ruby/blob/main/lib/vapi_server_sdk/assistants/client.rb#L599).

SDK version: 0.9.1
Ruby: 3.4
Rails: 7.2

Would be great if the SDK handled the conversion automatically so we can stick to idiomatic Ruby naming or change code documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions