Skip to content

Commit

Permalink
fix: support exactOptionalPropertyTypes on client SDKs (#278)
Browse files Browse the repository at this point in the history
previously we were always treating it as `false`, rather than using the
value we read from the `tsconfig.json` file. this was intentional at the
time in #131
> - For `typescript-koa` include `| undefined` on optional properties
when `exactOptionalPropertyTypes` is configured
> - This shouldn't be required for the clients, as in this case the
consumer can choose to omit keys
>     - Though maybe it's more ergonomic to follow this behavior anyway?

However it turns out this can cause issues with the `zod` schemas when
runtime validation is enabled, and so it's better to follow this `|
undefined` pattern on the clients as well. It's probably more ergonomic
as well tbh.
  • Loading branch information
mnahkies authored Dec 8, 2024
1 parent 7177a14 commit 5483b12
Show file tree
Hide file tree
Showing 20 changed files with 39,792 additions and 31,854 deletions.
22 changes: 12 additions & 10 deletions e2e/src/generated/client/axios/models.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 12 additions & 10 deletions e2e/src/generated/client/fetch/models.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5483b12

Please sign in to comment.