#190-FetchInteger: Fix
https://github.com/helmfile/vals/issues/190 Handles int and bool types when returned as string map value.
@artiodev thanks so much. could you add some tests?
@yxxhero Done
@mumoshu WDYT?
Hello @mumoshu,
You're right! This is the result I want, but I think is quite difficult to have.
ResultBool: "true" ResultInteger: "1" ResultBool: true ResultInteger: 1
Maybe it could be change the Lookup function using Generics type?
However at the moment this solution could be enough for me.
Thanks!
Hey @artiodev! Thanks for confirming!
From vals' design perspective, I believe that both work if each is enabled only in an opt-in manner.
Would you like it, if it looked like this:
| fetched value | ref URL param | result |
|---|---|---|
| 1 | error (because vals expects string by default) | |
| 1 | as=int | 1 |
| 1 | as=string | "1" |
| true | error (because vals expects string by default) | |
| true | as=int | error (because we won't define true->int conversion or vice versa) |
| true | as=bool | true |
| true | as=string | "true" |
We initially implement as=int and as=bool only because I suppose, in many cases, you don't need to turn anything into strings with vals. Put another way, we won't have as=string until it's absolutely necessary.
Does that make sense to you?
cc/ @yxxhero
Hey @artiodev! Thanks for confirming!
From vals' design perspective, I believe that both work if each is enabled only in an opt-in manner.
Would you like it, if it looked like this:
fetched value ref URL param result 1 error (because vals expects string by default) 1 as=int 1 1 as=string "1" true error (because vals expects string by default) true as=int error (because we won't define true->int conversion or vice versa) true as=bool true true as=string "true" We initially implement
as=intandas=boolonly because I suppose, in many cases, you don't need to turn anything into strings with vals. Put another way, we won't haveas=stringuntil it's absolutely necessary.Does that make sense to you?
cc/ @yxxhero
yeah. it's better.
yeah, This solution is even better
hi any chance to get this marge ?
@elkh510 This is WIP, it currently has a breaking change behavior that needs to be moved as a opt-in behavior.