Open saheljalal opened 2 years ago
Can yo give any example of adding struct tag ?
@RishiKumarRay Sure, you can check the yaml package for more details here: https://github.com/go-yaml/yaml
The general idea for struct tags are to add them as part of the type definition like done here for both JSON and YAML:
type Foo struct {
SomeVar int `json:"someVar" yaml:"someVar"`
AnotherVar string `json:"anotherVar" yaml:"anotherVar"`
}
This allows marshal and unmarshal to read/write the fields as specified. Otherwise they default and in this case become lowercase keys.
For this ticket, there is a small caveat that we need to make sure we migrate from the legacy format (during first read) and then can write the new manifest. This will handle the upgrade case.
Hope this helps.
Forgot to add YAML struct tags so the default marshaling will just turn
CamelCase
fields into lowercase likecamelcase
.This isn't nice so let's fix it to have the common convention of camel case keys.