yaml2go icon indicating copy to clipboard operation
yaml2go copied to clipboard

go2yaml

Open edbighead opened this issue 3 years ago • 4 comments

Is there any way to do a go struct -> yaml conversion ? Need to generate some docs for the structs 🤔

edbighead avatar Jun 09 '21 07:06 edbighead

@edbighead could you please share an example? Trying to understand the use case

PrasadG193 avatar Mar 07 '22 11:03 PrasadG193

@edbighead could you please share an example? Trying to understand the use case

Having a bunch of nested go structs, let's say for a kube deployment https://github.com/kubernetes/api/blob/b8c40e080bc5e830097df540d4ef804034cb5bdb/apps/v1/types.go#L318-L332

I would need to write some markdown docs with all possible available yaml fields, like https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/#describing-a-kubernetes-object

edbighead avatar Mar 07 '22 11:03 edbighead

@edbighead the only challenge I see is the values field values. We can extract the field names but the values will still have to do populate manually.

PrasadG193 avatar Mar 11 '22 10:03 PrasadG193

@edbighead the only challenge I see is the values field values. We can extract the field names but the values will still have to do populate manually.

it will be handy to have just value types:

spec:
  name: "string"
  isEnabled: true
  count: 60
  children:
    - "string"
    - "string"

edbighead avatar Mar 11 '22 10:03 edbighead