-
Notifications
You must be signed in to change notification settings - Fork 222
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(sdk/go): ensure empty string cannot be passed as path parameters #3722
Conversation
I expect this will fail. We may need to merge after @erka original PR / update more code paths. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3722 +/- ##
==========================================
+ Coverage 64.51% 64.55% +0.03%
==========================================
Files 170 170
Lines 17163 17163
==========================================
+ Hits 11073 11079 +6
+ Misses 5397 5393 -4
+ Partials 693 691 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Bare with me while I fix these tests |
I just pushed an update to this which takes a different approach. TL;DR exploring setting path defaults as protobuf options. |
f612fa1
to
a5d2748
Compare
if v.Key == "" { | ||
v.Key = "default" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See here for example output for new option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
Supports #3716
@erka spotted that empty string can be passed to
GetNamespaces
which leads to the HTTP client making a list namespaces operation when the key is empty. This is due to the fact we strip slash on our paths.This updates the SDK generator to support a new protobuf method option
flipt.options.flipt_client
.This option includes the ability to define path defaults (strings only currently).
When a default is found in the HTTP client generation, it is set to the default if the path parameter is the zero value ("").