Skip to content

Commit 16e3eec

Browse files
Update changelogs from fern repo (#812)
Co-authored-by: Swimburger <[email protected]>
1 parent 8cf9034 commit 16e3eec

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## 2.11.0
2+
**`(feat):`** Generate `Request` and `Response` types variations for types that have readonly and/or writeonly properties.
3+
For example, a type `User` will have a `User.Request` type that omits readonly properties and a `User.Response` type that omits writeonly properties.
4+
5+
Set `generateReadWriteOnlyTypes` to `true` in the `config` of your generator configuration to enable this feature.
6+
```ts
7+
import { User, FooClient } from "foo";
8+
9+
const client = new FooClient(...);
10+
const createUser: User.Request = {
11+
name: "Jon",
12+
// id: "123", // Error: id is read-only and thus omitted
13+
};
14+
const createdUser: User.Response = await client.createUser(createUser);
15+
// createdUser.id is available here
16+
```
17+
18+

0 commit comments

Comments
 (0)