File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
fern/products/sdks/overview/typescript/changelog Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 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+
You can’t perform that action at this time.
0 commit comments