diff --git a/pkg/generators/golang/json_generator.go b/pkg/generators/golang/json_generator.go index 018db16..4fe0651 100644 --- a/pkg/generators/golang/json_generator.go +++ b/pkg/generators/golang/json_generator.go @@ -1306,11 +1306,13 @@ func (g *JSONSupportGenerator) generateReadValue(variable string, typ *concepts. break } switch field { - case "kind": - text := iterator.ReadString() - {{ .Variable }}.link = text == {{ $structName }}LinkKind - case "href": - {{ .Variable }}.href = iterator.ReadString() + {{ if .Type.IsClass }} + case "kind": + text := iterator.ReadString() + {{ .Variable }}.link = text == {{ $structName }}LinkKind + case "href": + {{ .Variable }}.href = iterator.ReadString() + {{ end }} case "items": {{ .Variable }}.items = {{ readTypeFunc .Type }}(iterator) default: diff --git a/pkg/generators/golang/types_generator.go b/pkg/generators/golang/types_generator.go index f239fb1..a839a9f 100644 --- a/pkg/generators/golang/types_generator.go +++ b/pkg/generators/golang/types_generator.go @@ -456,8 +456,10 @@ func (g *TypesGenerator) generateStructTypeSource(typ *concepts.Type) { // {{ $listName }} is a list of values of the '{{ .Type.Name }}' type. type {{ $listName }} struct { - href string - link bool + {{ if .Type.IsClass }} + href string + link bool + {{ end }} items []*{{ $objectName }} }