github.com/6543-forks/go-swagger@v0.26.0/generator/templates/schemaembedded.gotmpl (about) 1 {{ define "schemaEmbedded" }} 2 type {{ pascalize .Name }} struct { 3 {{ if .ElemType.IsNullable }}*{{ end }}{{ .ElemType.GoType }} 4 } 5 6 func ({{.ReceiverName }} {{ if or .IsTuple .IsComplexObject }}*{{ end }}{{ if .Discriminates }}{{ camelize .Name }}{{ else if .IsExported }}{{ pascalize .Name }}{{ else }}{{ .Name }}{{ end }}) Validate(formats strfmt.Registry) error { 7 var f interface{} = {{ .ReceiverName }}.{{ dropPackage .ElemType.GoType }} 8 if v, ok := f.(runtime.Validatable) ; ok { 9 return v.Validate(formats) 10 } 11 return nil 12 } 13 {{- end }}