File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -7,14 +7,17 @@ package gowsdl
77var typesTmpl = `
88{{define "SimpleType"}}
99 {{$type := replaceReservedWords .Name | makePublic}}
10+ {{if .Doc}} {{.Doc | comment}} {{end}}
1011 type {{$type}} {{toGoType .Restriction.Base}}
12+ {{if .Restriction.Enumeration}}
1113 const (
1214 {{with .Restriction}}
1315 {{range .Enumeration}}
1416 {{if .Doc}} {{.Doc | comment}} {{end}}
1517 {{$type}}{{$value := replaceReservedWords .Value}}{{$value | makePublic}} {{$type}} = "{{goString .Value}}" {{end}}
1618 {{end}}
1719 )
20+ {{end}}
1821{{end}}
1922
2023{{define "ComplexContent"}}
@@ -65,11 +68,14 @@ var typesTmpl = `
6568 {{removeNS .Ref | replaceReservedWords | makePublic}} {{if eq .MaxOccurs "unbounded"}}[]{{end}}{{.Ref | toGoType}} ` + "`" + `xml:"{{.Ref | removeNS}},omitempty"` + "`" + `
6669 {{else}}
6770 {{if not .Type}}
68- {{template "ComplexTypeInline" .}}
69- {{else}}
70- {{if .Doc}}
71- {{.Doc | comment}} {{"\n"}}
71+ {{if .SimpleType}}
72+ {{if .Doc}} {{.Doc | comment}} {{end}}
73+ {{ .Name | makeFieldPublic}} {{toGoType .SimpleType.Restriction.Base}} ` + "`" + `xml:"{{.Name}},omitempty"` + "`" + `
74+ {{else}}
75+ {{template "ComplexTypeInline" .}}
7276 {{end}}
77+ {{else}}
78+ {{if .Doc}}{{.Doc | comment}} {{end}}
7379 {{replaceReservedWords .Name | makeFieldPublic}} {{if eq .MaxOccurs "unbounded"}}[]{{end}}{{.Type | toGoType}} ` + "`" + `xml:"{{.Name}},omitempty"` + "`" + ` {{end}}
7480 {{end}}
7581 {{end}}
Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ type XSDAttribute struct {
110110// and information about the values of attributes or text-only elements.
111111type XSDSimpleType struct {
112112 Name string `xml:"name,attr"`
113+ Doc string `xml:"annotation>documentation"`
113114 Restriction XSDRestriction `xml:"restriction"`
114115}
115116
You can’t perform that action at this time.
0 commit comments