Incorrect typescript typing in SDK
# support
b
Hi folks, the types in the Typescript SDK are quite off compared to the API spec. I've run into numerous fields that are either missing or incorrectly typed and I am having to keep my own type definitions, limiting the usefulness of the SDK. I've noticed that the API hasn't had commits for several months. Do you intend to resolve these issues or is the SDK not supported? Just for the latest example: ToolsCreateRequest.server.backoffPlan is incorrectly typed - it's supposed to be an enum that is either "fixed" or "exponential". Instead, it is a
Record<string, unknown>
, meaning I have to overwrite yet another field.
Further, it looks like the McpTool spec doesn't support a
name
field, which doesn't line up with what happens in the UI (I can set a name field there). This appears to be both an API and an SDK deficiency.
k
Submit an issue or pull request to the SDK’s generator repository with the correct type for backoffPlan ("fixed" | "exponential"), as the SDK is auto-generated and manual fixes won’t persist. This ensures the fix is properly integrated and benefits others using the SDK..
b
I'd love to do that, but as you mentioned, the SDK is auto-generated. If your API spec is updated with correct information, I'm sure Fern will generate the correct types (or you'd be able to put in a request with Fern). My manual fixes come in the form of typescript overrides and as such will persist through updates. Further, There doesn't seem to be a generator repository in Vapi's public repos. Realistically, I don't have the time to go through and fix the types on VAPI's behalf here - this is really a request to VAPI to do your housekeeping or implement a continuous deployment process for the SDK that auto-releases each time you push a change to the spec. It shouldn't be this far out of date, and I don't think asking the community to implement manual changes is a realistic way to keep it up to date. My typescript overrides are a hack and wouldn't serve the community.
a
Hey, thanks for bringing to our attention that the TypeScript SDK is either out of sync with the API specification or significantly behind. I'll proceed with the updates and ensure that this information is updated. You can either reach out to us or we'll notify you accordingly for TypeScript SDK API specifications update.
I apologize for not being able to delve deeper into this matter. I'll make sure to look into it as soon as I have some free time.
b
Got it. Just let me know when you're able to take a look. Based on the recent commits I'm seeing to the official sdk repo, it's looking a bit like the API spec is broken.
a
Hey BuckAMayzing, I apologize for not looking into this earlier. I understand it's a significant issue for you, and I've been actively dealing with it. However, due to work-related tasks, it often gets deprioritized. I wanted to clarify that I'm not ignoring or neglecting your concern; it's just that a few other matters have taken precedence.
Hey BuckAMayzing, could you please create a Github issue so that our SDK team can look over into it? They will update you within resolution.
b
Whoops. I missed this. I'll make sure that I submit github issues for this type of thing going forward.