@@ -106,7 +106,7 @@ components:
106106 {{- end -}}
107107 {{- range $_ , $service := $services }}
108108 {{- range $i , $method := $service .Methods }}
109- {{- $isSuccinctInput := and $method .Succinct ( eq ( len $method .Inputs ) 1) -}}
109+ {{- $isSuccinctInput := $method .Succinct -}}
110110 {{- if not $isSuccinctInput }}
111111 {{$service .Name }}_{{$method .Name }}_Request:
112112 type: object
@@ -120,7 +120,7 @@ components:
120120 {{- end -}}
121121 {{- end -}}
122122 {{- range $_ , $method := .Methods }}
123- {{- $isSuccinctOutput := and $method .Succinct ( eq ( len $method .Outputs ) 1) -}}
123+ {{- $isSuccinctOutput := $method .Succinct -}}
124124 {{- if not $isSuccinctOutput }}
125125 {{$service .Name }}_{{$method .Name }}_Response:
126126 type: object
@@ -138,8 +138,8 @@ components:
138138paths:
139139{{- range $_ , $service := .Services -}}
140140 {{- range $_ , $method := .Methods }}
141- {{- $isSuccinctInput := and $method .Succinct ( eq ( len $method .Inputs ) 1) -}}
142- {{- $isSuccinctOutput := and $method .Succinct ( eq ( len $method .Outputs ) 1) -}}
141+ {{- $isSuccinctInput := $method .Succinct -}}
142+ {{- $isSuccinctOutput := $method .Succinct -}}
143143 {{- $deprecated := index $method .Annotations " deprecated" }}
144144 /rpc/{{$service .Name }}/{{$method .Name }}:
145145 post:
@@ -170,8 +170,10 @@ paths:
170170 content:
171171 application/json:
172172 schema:
173- {{- if $isSuccinctInput }}
173+ {{- if and $isSuccinctInput ( eq ( len $method .Inputs ) 1) }}
174174 {{ template " fieldType" dict " Type" (index $method .Inputs 0).Type " TypeMap" $typeMap " Indent" " " }}
175+ {{- else if $isSuccinctInput }}
176+ type: object
175177 {{- else }}
176178 $ref : '#/components/schemas/{{$service .Name }}_{{$method .Name }}_Request'
177179 {{- end }}
@@ -182,16 +184,20 @@ paths:
182184 {{- if eq $method .StreamOutput false }}
183185 application/json:
184186 schema:
185- {{- if $isSuccinctOutput }}
187+ {{- if and $isSuccinctOutput ( eq ( len $method .Outputs ) 1) }}
186188 {{ template " fieldType" dict " Type" (index $method .Outputs 0).Type " TypeMap" $typeMap " Indent" " " }}
189+ {{- else if $isSuccinctOutput }}
190+ type: object
187191 {{- else }}
188192 $ref : '#/components/schemas/{{$service .Name }}_{{$method .Name }}_Response'
189193 {{- end }}
190194 {{- else }}
191195 application/x-ndjson:
192196 schema:
193- {{- if $isSuccinctOutput }}
197+ {{- if and $isSuccinctOutput ( eq ( len $method .Outputs ) 1) }}
194198 {{ template " fieldType" dict " Type" (index $method .Outputs 0).Type " TypeMap" $typeMap " Indent" " " }}
199+ {{- else if $isSuccinctOutput }}
200+ type: object
195201 {{- else }}
196202 $ref : '#/components/schemas/{{$service .Name }}_{{$method .Name }}_Response'
197203 {{- end }}
0 commit comments