You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: generators/typescript/README.md
+50
Original file line number
Diff line number
Diff line change
@@ -360,6 +360,56 @@ If `doNotHandleUnrecognizedErrors` is enabled and you throw a non-Fern error, th
360
360
and passed on with `next(error)`. It's your responsibility to set up error-catching middleware that handles
361
361
the error and returns a response to the client.
362
362
363
+
#### ✨ `retainOriginalCasing`
364
+
365
+
**Type:** boolean
366
+
367
+
**Default:** `false`
368
+
369
+
When enabled, property names in the generated code will retain their original casing from the API definition instead of being converted to camelCase.
370
+
371
+
```yaml
372
+
# generators.yml
373
+
config:
374
+
retainOriginalCasing: true
375
+
```
376
+
377
+
**Before (default behavior):**
378
+
If your API definition has a property named `display_name`, it would be converted to `displayName` in the generated TypeScript code.
379
+
380
+
**After (with retainOriginalCasing):**
381
+
The property `display_name` will remain as `display_name` in the generated TypeScript interfaces.
382
+
383
+
**Example with OpenAPI input:**
384
+
```yaml
385
+
# OpenAPI schema
386
+
components:
387
+
schemas:
388
+
User:
389
+
type: object
390
+
properties:
391
+
user_id:
392
+
type: string
393
+
display_name:
394
+
type: string
395
+
```
396
+
397
+
Generated TypeScript with `retainOriginalCasing: true`:
398
+
```typescript
399
+
export interface User {
400
+
user_id: string;
401
+
display_name: string;
402
+
}
403
+
```
404
+
405
+
Generated TypeScript with default settings (`retainOriginalCasing: false`):
406
+
```typescript
407
+
export interface User {
408
+
userId: string;
409
+
displayName: string;
410
+
}
411
+
```
412
+
363
413
## Versions
364
414
365
415
Find the latest version number and changelog for this generator in [this SDK Generators table](https://github.com/fern-api/fern?tab=readme-ov-file#sdk-generators). The changelog shows earlier version numbers, if any. You can directly use these version numbers in your generator configuration files.
0 commit comments