mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
api/t/network: generate Inspect, Summary structs
Replace the hand-rolled Network, Summary and Inspect struct types in api/types/network with types generated from the Swagger definition. Disable the generation of all unwanted marshalers and unmarshalers. Signed-off-by: Cory Snider <csnider@mirantis.com>
This commit is contained in:
@@ -74,7 +74,7 @@
|
||||
{{- end }}
|
||||
{{ template "mapOrSliceGetter" . }}
|
||||
{{- end }}
|
||||
{{ template "schemaSerializer" . }}
|
||||
{{/* {{ template "schemaSerializer" . }} */}}
|
||||
{{- end }}
|
||||
{{- if and .IncludeValidator (not .IsSuperAlias) (not .IsEmbedded) }}{{/* aliased types type A = B do not redefine methods */}}
|
||||
{{- if and (not (or .IsInterface .IsStream)) (or .Required .HasValidations .HasBaseType) }}
|
||||
@@ -111,7 +111,7 @@ func ({{.ReceiverName}} {{ if or .IsTuple .IsComplexObject .IsAdditionalProperti
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .WantsMarshalBinary }}
|
||||
{{ template "marshalBinarySerializer" . }}
|
||||
{{/* {{ template "marshalBinarySerializer" . }} */}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- define "mapOrSliceGetter" }}{{/* signature for AdditionalProperties and AdditionalItems getter funcs */}}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
{{ define "marshalBinarySerializer" }}{{ end }}
|
||||
@@ -3,7 +3,8 @@
|
||||
// {{ template "docstring" . }}
|
||||
{{- template "propertyValidationDocString" .}}
|
||||
{{- end}}
|
||||
{{ pascalize .Name}} {{ template "schemaType" . }} {{ .PrintTags }}
|
||||
{{- /* Work around bug where "IPv4" and "IPv6" specifically get mangled to "IPV4" and "IPV6", respectively. */}}
|
||||
{{ pascalize .Name | replace "IPV4" "IPv4" | replace "IPV6" "IPv6" }} {{ template "schemaType" . }} {{ .PrintTags }}
|
||||
{{ end }}
|
||||
|
||||
{{- define "tuplefield" }}
|
||||
|
||||
Reference in New Issue
Block a user