Skip to content

fix: support exactOptionalPropertyTypes on client SDKs#278

Merged
mnahkies merged 3 commits into
mainfrom
mn/fix/exactOptionalPropertyTypes
Dec 8, 2024
Merged

fix: support exactOptionalPropertyTypes on client SDKs#278
mnahkies merged 3 commits into
mainfrom
mn/fix/exactOptionalPropertyTypes

Conversation

@mnahkies

@mnahkies mnahkies commented Dec 8, 2024

Copy link
Copy Markdown
Owner

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.

@mnahkies mnahkies changed the title fix:: support exactOptionalPropertyTypes fix: support exactOptionalPropertyTypes Dec 8, 2024
@mnahkies mnahkies changed the title fix: support exactOptionalPropertyTypes fix: support exactOptionalPropertyTypes on client SDKs Dec 8, 2024
@mnahkies mnahkies marked this pull request as ready for review December 8, 2024 12:46
@mnahkies mnahkies merged commit 5483b12 into main Dec 8, 2024
@mnahkies mnahkies deleted the mn/fix/exactOptionalPropertyTypes branch December 8, 2024 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant