@@ -16,20 +16,25 @@ type {{$alias.UpSingular}} struct {
16
16
{ {- /* render column alias and column type */ -} }
17
17
{ { $colAlias } } { { $column .Type -} }
18
18
19
- { {- /* handle struct tags */ -} }
19
+ { {- /*
20
+ handle struct tags
21
+ StructTagCasing will be replaced with $.StructTagCases
22
+ however we need to keep this backward compatible
23
+ $.StructTagCasing will only be used when it' s set to "alias"
24
+ */ -}}
20
25
`
21
26
{{- if eq $.StructTagCasing "alias" -}}
22
27
{{- generateTags $.Tags $colAlias -}}
23
- { {- generateTagWithCase " json" $colAlias " default " $column .Nullable -} }
24
- { {- generateTagWithCase " yaml" $colAlias " default " $column .Nullable -} }
25
- { {- generateTagWithCase " toml" $colAlias " default " $column .Nullable -} }
26
- { {- generateTagWithCase " boil" $colAlias " default " $column .Nullable -} }
28
+ {{- generateTagWithCase "json" $column.Name $ colAlias "alias " $column.Nullable -}}
29
+ {{- generateTagWithCase "yaml" $column.Name $ colAlias "alias " $column.Nullable -}}
30
+ {{- generateTagWithCase "toml" $column.Name $ colAlias "alias " $column.Nullable -}}
31
+ {{- generateTagWithCase "boil" $column.Name $ colAlias "alias " $column.Nullable -}}
27
32
{{- else -}}
28
33
{{- generateTags $.Tags $column.Name }}
29
- { {- generateTagWithCase " json" $column .Name $.StructTagCases.Json $column .Nullable -} }
30
- { {- generateTagWithCase " yaml" $column .Name $.StructTagCases.Yaml $column .Nullable -} }
31
- { {- generateTagWithCase " toml" $column .Name $.StructTagCases.Toml $column .Nullable -} }
32
- { {- generateTagWithCase " boil" $column .Name $.StructTagCases.Boil $column .Nullable -} }
34
+ {{- generateTagWithCase "json" $column.Name $colAlias $ .StructTagCases.Json $column.Nullable -}}
35
+ {{- generateTagWithCase "yaml" $column.Name $colAlias $ .StructTagCases.Yaml $column.Nullable -}}
36
+ {{- generateTagWithCase "toml" $column.Name $colAlias $ .StructTagCases.Toml $column.Nullable -}}
37
+ {{- generateTagWithCase "boil" $column.Name $colAlias $ .StructTagCases.Boil $column.Nullable -}}
33
38
{{- end -}}
34
39
`
35
40
{{ end -}}
0 commit comments