Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore json = - fields #5

Merged
merged 3 commits into from
Jul 20, 2023
Merged

Ignore json = - fields #5

merged 3 commits into from
Jul 20, 2023

Conversation

VojtechVitek
Copy link
Contributor

Comment on lines +27 to +56
{{- range $_, $field := $type.Fields -}}
{{- $isExportable := true -}}
{{- range $meta := $field.Meta -}}
{{- if exists $meta "json" -}}
{{- if eq (printf "%v" (get $meta "json")) "-" -}}
{{- $isExportable = false}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- if $isExportable }}
this._data['{{template "fieldName" dict "Field" $field }}'] = _data['{{template "fieldName" dict "Field" $field }}']
{{- end -}}
{{end}}
}
}
{{ range $type.Fields -}}
get {{template "fieldName" dict "Field" . }}() {
return this._data['{{template "fieldName" dict "Field" . }}']
{{ range $_, $field := $type.Fields -}}
{{- $isExportable := true -}}
{{- range $meta := $field.Meta -}}
{{- if exists $meta "json" -}}
{{- if eq (printf "%v" (get $meta "json")) "-" -}}
{{- $isExportable = false}}
{{- end -}}
{{- end -}}
{{- end }}
{{- if $isExportable }}
get {{template "fieldName" dict "Field" $field }}() {
return this._data['{{template "fieldName" dict "Field" $field }}']
}
set {{template "fieldName" dict "Field" . }}(value) {
this._data['{{template "fieldName" dict "Field" . }}'] = value
set {{template "fieldName" dict "Field" $field }}(value) {
this._data['{{template "fieldName" dict "Field" $field }}'] = value
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be so much easier if we had

"serverOnly" flag

@VojtechVitek VojtechVitek merged commit 62b5fa3 into master Jul 20, 2023
3 checks passed
@VojtechVitek VojtechVitek deleted the fix_66 branch July 20, 2023 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"-" fieldtag generates valid Go but invalid Javascript client
1 participant