Fixed JSON rendering for example object

This commit is contained in:
quobix
2024-07-05 13:34:58 -04:00
parent c2b58717b8
commit bdee05a412
2 changed files with 19 additions and 1 deletions

View File

@@ -60,7 +60,9 @@ func (e *Example) MarshalYAML() (interface{}, error) {
// MarshalJSON will marshal this into a JSON byte slice
func (e *Example) MarshalJSON() ([]byte, error) {
var g map[string]any
e.Value.Decode(&g)
nb := high.NewNodeBuilder(e, e.low)
r := nb.Render()
r.Decode(&g)
return json.Marshal(g)
}