github.com/AngusLu/go-swagger@v0.28.0/generator/templates/model.gotmpl (about)

     1  {{ template "header" . }}
     2  {{- if .IncludeModel }}
     3    {{- if .IsExported }}
     4  // {{ pascalize .Name }} {{ template "docstring" . }}
     5      {{- template "annotations" . }}
     6    {{- end }}
     7    {{- template "schema" . }}
     8  {{- end }}
     9  
    10  {{ range .ExtraSchemas }}
    11    {{- if .IncludeModel }}
    12      {{- if .IsExported }}
    13  // {{ pascalize .Name }} {{ template "docstring" . }}
    14        {{- template "annotations" . }}
    15      {{- end }}
    16      {{- template "schema" . }}
    17    {{- end }}
    18  {{- end }}
    19  {{- define "annotations" }}{{/* annotations to generate spec from source */}}
    20    {{- if not .IsBaseType }}
    21  //
    22  // swagger:model {{ .Name }}
    23    {{- else }}
    24  //
    25  // swagger:discriminator {{ .Name }} {{ .DiscriminatorField }}
    26    {{- end }}
    27  {{- end }}