Skip to content

no-bespoke-api-case-conversion

Review direct snake_case/camelCase mirror mappings on explicitly API-typed adapter values.

Why

Duplicating wire-name translation can drift from an API client contract. When the SDK owns application-facing names, centralizing conversion avoids maintaining another mirror by hand.

Fix

Move wire-name ownership and case conversion into the generated SDK/model layer; keep application adapters on the generated typed surface.

Examples

Before — flagged Do not reproduce SDK case conversion in an application adapter
src/user-adapter.ts
import type { User } from "./api-contract";
export const toUser = (raw: User) => ({ displayName: raw.display_name });
After — preferred Use the generated client's application-facing property names
src/user-adapter.ts
import type { User } from "./generated-client";
export const toUser = (raw: User) => ({ displayName: raw.displayName });