Skip to content

Commit e0b09d0

Browse files
authored
Merge pull request #2865 from wn-mitch/main
Minor transformer docs update
2 parents 0a49c3a + ba4d9bf commit e0b09d0

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

.changeset/old-pianos-beg.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@docs/openapi-ts": patch
3+
---
4+
5+
docs: add bigint section to transformers

docs/openapi-ts/plugins/transformers.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,24 @@ export default {
8181

8282
This will generate types that use `Date` instead of `string` and appropriate transformers. Note that third-party date packages are not supported at the moment.
8383

84+
## BigInt
85+
86+
The `@hey-api/transformers` plugin will natively type all BigInts as `bigint` instead of `number`, which can affect arithmetic operations if your application previously used `number`. To force BigInts to be numbers, use the `bigint` configuration option.
87+
88+
```js
89+
export default {
90+
input: 'hey-api/backend', // sign up at app.heyapi.dev
91+
output: 'src/client',
92+
plugins: [
93+
// ...other plugins
94+
{
95+
bigint: true, // [!code ++]
96+
name: '@hey-api/transformers',
97+
},
98+
],
99+
};
100+
```
101+
84102
## Example
85103

86104
A generated response transformer might look something like this. Please note the example has been edited for brevity.

0 commit comments

Comments
 (0)