Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support exactOptionalPropertyTypes on client SDKs #278

Merged
merged 3 commits into from
Dec 8, 2024

Conversation

mnahkies
Copy link
Owner

@mnahkies mnahkies commented Dec 8, 2024

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
4 checks passed
@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