update templates
This commit is contained in:
parent
cc9cf10201
commit
5f52f1b913
|
@ -121,14 +121,14 @@
|
|||
}
|
||||
|
||||
type {{$opID}}Input struct {
|
||||
{{if $operation.Request.Params.Properties | len -}}
|
||||
{{$data := $operation.Request.Params}}
|
||||
{{if $operation.Request.Query.Properties | len -}}
|
||||
{{$data := $operation.Request.Query}}
|
||||
{{template "RenderProperties" passThrough $data `location:"params"`}}
|
||||
{{- end -}}
|
||||
}
|
||||
|
||||
func (v *{{$opID}}Input) Validate() error {
|
||||
{{template "ValidateCustomizedType" $operation.Request.Params}}
|
||||
{{template "ValidateCustomizedType" $operation.Request.Query}}
|
||||
{{template "ValidateCustomizedType" $operation.Request.Headers}}
|
||||
{{template "ValidateCustomizedType" $operation.Request.Elements}}
|
||||
|
||||
|
@ -137,9 +137,12 @@
|
|||
|
||||
type {{$opID}}Output struct {
|
||||
Message *string `json:"message" name:"message"`
|
||||
{{- if $operation.Response.Elements.Properties | len -}}
|
||||
{{$data := $operation.Response.Elements}}
|
||||
{{template "RenderProperties" passThrough $data `location:"elements"`}}
|
||||
|
||||
{{range $keyStatus, $valueStatus := $operation.Responses -}}
|
||||
{{if $valueStatus.Elements.Properties | len}}
|
||||
{{$data := $valueStatus.Elements}}
|
||||
{{template "RenderProperties" passThrough $data `location:"elements"` $operation.Name}}
|
||||
{{end}}
|
||||
{{- end -}}
|
||||
}
|
||||
{{end}}
|
||||
|
|
Loading…
Reference in New Issue