minder CLI's -oyaml output prints JSON tags
Describe the issue
Some attributes have a different JSON and YAML tags, such as display name which has display_name in YAML and displayName in JSON. However, our -oyaml output seems to use the JSON tags which means that if you save the YAML to a file, try to modify and reupload it won't work.
To Reproduce
minder profile get -i 1991faab-68d4-443f-9015-2f8fb398d28f -oyaml
profile:
alert: "on"
context:
project: d643f41b-3397-472f-8c01-1ea45e598427
displayName: Let's make sure dependabot is enabled for python
id: 1991faab-68d4-443f-9015-2f8fb398d28f
name: dependabot-enabled-profile
remediate: "on"
repository:
- def:
apply_if_file: requirements.txt
package_ecosystem: pypi
schedule_interval: weekly
name: dependabot_configured
type: dependabot_configured
the example above should use display_name but uses displayName
What version are you using?
No response
This part seems wrong:
Some attributes have a different JSON and YAML tags
Since JSON is valid YAML in general...
It's a limitation on the JSON/YAML unmarshal. buf sets up JSON tags but not YAML in the golang structures it generates. They do have a library that's meant for YAML handling though https://github.com/bufbuild/protoyaml-go so we might wanna switch to that.
This was fixed for ruletypes and profiles via https://github.com/mindersec/minder/pull/4936 and https://github.com/mindersec/minder/pull/4960