Skip to content

feat: omit 'undefined' when generating SSDK and @required trait is used #537

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

Closed

Conversation

RossWilliams
Copy link

Issue #, if available:

Addresses issues raised in #503 for SSDK code

Description of changes:

Currently when the client SDK is generated, @required shapes have their
types rendered with ' | undefined'. This allows removing @required as
a non-breaking change for client SDK users.

However, the server SDK (SSDK) has no need for backwards compatibility,
it can be updated as the service evolves. When generating SSDK types
the project does not need to include ' | undefined' for required types.

This update changes the structure member writer when the SSDK is
generated to not include ' | undefined" when it is a required member.
Client SDK remains unaffected.

Server SDK does not appear to have any tests. Test frameworks do
not seem to support SSDK generation at this moment. only implementation
code is included.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Currently when the client SDK is generated, @required shapes have their
types rendered with ' | undefined'. This allows removing @required as
a non-breaking change for client SDK users.

However, the server SDK (SSDK) has no need for backwards compatibility,
it can be updated as the service evolves. When generating SSDK types
the project does not need to include ' | undefined' for required types.

This update changes the structure member writer to only include
' | undefined" when it is a required member and a non-server sdk is
generated.

Server SDK does not appear to have any tests. Test frameworks do
not seem to support SSDK generation at this moment. only implementation
code is included.
@RossWilliams RossWilliams requested a review from a team as a code owner April 26, 2022 13:45
@RossWilliams
Copy link
Author

This causes type issues inside the deserialise functions. Its not feasible to make these changes without a lot of internal plumbing.

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