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

clientgen: fix handling of optionals #726

Merged
merged 2 commits into from
May 31, 2023

Conversation

eandre
Copy link
Member

@eandre eandre commented May 18, 2023

When a value is optional the ts/js clients need to handle the possibility the value is undefined.

Thanks Ryan Content for the report.
Fixes #725

When a value is optional the ts/js clients need to
handle the possibility the value is undefined.

Thanks Ryan Content for the report.
Fixes encoredev#725
@encore-cla
Copy link

encore-cla bot commented May 18, 2023

All committers have signed the CLA.

@eandre eandre requested review from ekerfelt and DomBlack and removed request for ekerfelt May 18, 2023 21:13
DomBlack
DomBlack previously approved these changes May 22, 2023
Copy link
Contributor

@DomBlack DomBlack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we not also golden testing the OpenAPI generated client in the e2e-tests? Are we happy with their query strings being generated correctly here?

@@ -152,7 +153,7 @@ func (g *Generator) newOperationForEncoding(rpc *meta.RPC, method string, reqEnc
AllowEmptyValue: true,
AllowReserved: false,
Deprecated: false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh nice, in the future we could even detect this and include it in the meta

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's a good idea :)

@eandre eandre merged commit 2b82f17 into encoredev:main May 31, 2023
1 check passed
@eandre eandre deleted the clientgen-optional branch May 31, 2023 14:31
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.

Optional query parameter being sent as 'undefined'
2 participants