Skip to content

Conversation

@jsklan
Copy link
Contributor

@jsklan jsklan commented Jan 12, 2026

Description

Fixes a bug where nullable enum query parameters were being set to null instead of being dropped when undefined was passed to the client's endpoint method.

Link to Devin run: https://app.devin.ai/sessions/14148495a6164918b8e1c446d85c413d
Requested by: @jsklan

Changes Made

  • Modified TypeReferenceToStringExpressionConverter.convertWithNullCheckIfOptional() to return undefined instead of null for nullable types when the value is undefined
  • Updated versions.yml with changelog entry for v3.43.9
  • Updated seed fixture nullable-optional to reflect the corrected generated code

Before:

const _queryParams: Record<string, unknown> = {
    role: role !== undefined ? role : null,  // null gets sent as empty value
    secondaryRole: secondaryRole !== undefined ? secondaryRole : null,
};

After:

const _queryParams: Record<string, unknown> = {
    role: role !== undefined ? role : undefined,  // undefined gets dropped
    secondaryRole: secondaryRole !== undefined ? secondaryRole : undefined,
};

Testing

  • Ran seed tests for nullable-optional fixture - passed
  • Ran seed tests for enum fixture (3 configs) - passed
  • Ran seed tests for exhaustive fixture (21 configs) - passed
  • Lint checks passed

Human Review Checklist

  • Verify this change doesn't unintentionally affect request body serialization where null might be semantically meaningful (the method convertWithNullCheckIfOptional could be called from other contexts)
  • Confirm the expected behavior: when a user passes undefined to a nullable query param, it should be dropped from the request rather than sent as an empty value

…f sending null

Co-Authored-By: judah@buildwithfern.com <jsklan.development@gmail.com>
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@devin-ai-integration devin-ai-integration bot changed the title fix(ts-sdk): drop nullable enum query params when undefined instead of sending null fix(typescript): drop nullable enum query params when undefined instead of sending null Jan 12, 2026
# Conflicts:
#	generators/typescript/sdk/versions.yml
@fern-support fern-support merged commit 1038d9a into main Jan 15, 2026
120 checks passed
@fern-support fern-support deleted the devin/1768260975-fix-nullable-enum-query-params branch January 15, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants