Add yaml struct tags for serialization to yaml #202
Labels
lifecycle/rotten
Rotten items. These items have been stale for 60 days and are now closed.
lifecycle/stale
Stale items. These items have not been updated for 90 days.
edit: I found
sigs.k8s.io/yaml
which is used in this project for serialization/deserialization. This makes this functionality less important, but I'll leave it open in case there's any discussion to be had. Feel free to close issue if it's not applicable.Apologies if this has been discussed before; I remember an issue in the past around this topic but can no longer find it.
Is your feature request related to a problem? Please describe.
Currently, go structs defined in
pkg/apis
definejson
tags for all fields to control serialization. However, go-yaml does not read these tags and instead depends on a similarly-structuredyaml
tag. The defaults for go-yaml are different (and quite bad) which makes serializing/deserializing instances of api structs difficult:will output:
Describe the solution you'd like
Define matching
yaml
struct tags on go structs.Describe alternatives you've considered
The issue can be worked around by using a package like https://github.com/ghodss/yaml/ but it appears to be unmaintained.
Additional context
I had to work around this issue in PR devfile/devworkspace-operator#188
The text was updated successfully, but these errors were encountered: