ghodss/yaml

Cast Variable Values As String

Closed this issue · 1 comments

Not sure if this is the right place to report this or not, but I'm running into an issue in a downstream project. The exact error is:

json: cannot unmarshal number into Go value of type string

kubernetes/kubernetes#12889

And the source code

If you believe this is not the right place and you have a moment, please point me in the right direction.

Thanks much!

If you use YAML, coercion from int to string should happen automatically because in yaml, quotes are optional. If you use JSON though, we try to be type safe and alert if you are passing one type into a struct which expects a different type. As such this is expected behavior.

Feel free to reopen if I've misunderstood.