github.com/percona-lab/go-swagger@v0.19.0/generator/templates/structfield.gotmpl (about)

     1  {{ define "structfield" }}
     2    {{- if not $.IsBaseType -}}
     3      // {{ template "docstring" . }}
     4      {{- template "propertyValidationDocString" .}}
     5    {{- end}}
     6  {{ pascalize .Name}} {{ template "schemaType" . }} `json:"
     7  {{- if $.HasBaseType -}}
     8    -
     9  {{- else }}
    10    {{- .OriginalName }}
    11    {{- if and (not .Required) .IsEmptyOmitted }},omitempty{{ end }}
    12  {{- end }}"
    13  {{- if .XMLName }} xml:"{{ .XMLName }}"{{ end }}
    14  {{- if .CustomTag }} {{ .CustomTag }}{{ end }}`
    15  {{ end }}
    16  
    17  {{- define "tuplefield" }}
    18    {{- if not $.IsBaseType -}}
    19      // {{ template "docstring" . }}
    20      {{- template "propertyValidationDocString" .}}
    21  {{ end }}
    22  {{- pascalize .Name}} {{ template "schemaType" . }} `json:"-"
    23  {{- if .CustomTag }} {{ .CustomTag }}{{ end }}` // custom serializer
    24  {{ end }}
    25  
    26  {{- define "structfieldIface" }}
    27    {{- if not $.IsBaseType -}}
    28      // {{ template "docstring" . }}
    29      {{- template "propertyValidationDocString" .}}
    30    {{- end }}
    31  {{ pascalize .Name}}() {{ template "schemaType" . }}
    32  Set{{ pascalize .Name}}({{ template "schemaType" . }})
    33  {{ end }}
    34  {{ define "tuplefieldIface" }}
    35    {{- if not $.IsBaseType -}}
    36      // {{ template "docstring" . }}
    37      {{- template "propertyValidationDocString" . }}
    38  {{ end }}
    39  {{- pascalize .Name}}() {{ template "schemaType" . }}
    40  Set{{ pascalize .Name}}({{ template "schemaType" . }})
    41  {{ end }}
    42  
    43  {{- define "privstructfield" }}
    44    {{- camelize .Name}}Field {{ template "schemaType" . }}
    45  {{ end }}
    46  
    47  {{- define "privtuplefield" }}
    48    {{- camelize .Name}}Field {{ template "schemaType" . }}
    49  {{ end }}