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:
Cory Snider
2025-08-26 17:56:30 -04:00
parent c208f90796
commit ea1c2530da
13 changed files with 509 additions and 240 deletions

View File

@@ -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 */}}

View File

@@ -1 +0,0 @@
{{ define "marshalBinarySerializer" }}{{ end }}

View File

@@ -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" }}