@@ -111,10 +111,10 @@ func TestHandler_Http(t *testing.T) {
111111 return runtimetest .NewHttpApp (
112112 openapitest .NewConfig ("3.0.0" ,
113113 openapitest .WithInfo ("foo" , "" , "" ),
114- openapitest .WithPath ("/foo/{bar}" , openapitest . NewPath (
114+ openapitest .WithPath ("/foo/{bar}" ,
115115 openapitest .WithPathParam ("bar" , openapitest .WithParamSchema (schematest .New ("string" ))),
116- openapitest .WithOperation ("get" , openapitest . NewOperation () ),
117- )) ,
116+ openapitest .WithOperation ("get" ),
117+ ),
118118 ),
119119 )
120120 },
@@ -127,13 +127,13 @@ func TestHandler_Http(t *testing.T) {
127127 return runtimetest .NewHttpApp (
128128 openapitest .NewConfig ("3.0.0" ,
129129 openapitest .WithInfo ("foo" , "" , "" ),
130- openapitest .WithPath ("/foo/{bar}" , openapitest . NewPath (
131- openapitest .WithOperation ("get" , openapitest . NewOperation (
130+ openapitest .WithPath ("/foo/{bar}" ,
131+ openapitest .WithOperation ("get" ,
132132 openapitest .WithRequestBody ("foo" , true ,
133133 openapitest .WithRequestContent ("application/json" , openapitest .NewContent (openapitest .WithSchema (schematest .New ("string" )))),
134134 ),
135- )) ,
136- ))) ,
135+ ),
136+ )),
137137 )
138138 },
139139 requestUrl : "http://foo.api/api/services/http/foo" ,
@@ -145,11 +145,11 @@ func TestHandler_Http(t *testing.T) {
145145 return runtimetest .NewHttpApp (
146146 openapitest .NewConfig ("3.0.0" ,
147147 openapitest .WithInfo ("foo" , "" , "" ),
148- openapitest .WithPath ("/foo" , openapitest . NewPath (
149- openapitest .WithOperation ("get" , openapitest . NewOperation (
148+ openapitest .WithPath ("/foo" ,
149+ openapitest .WithOperation ("get" ,
150150 openapitest .WithSecurity (map [string ][]string {"foo" : {}}),
151- )) ,
152- )) ,
151+ ),
152+ ),
153153 openapitest .WithComponentSecurity ("foo" , & openapi.ApiKeySecurityScheme {
154154 Type : "apiKey" ,
155155 In : "header" ,
@@ -168,9 +168,9 @@ func TestHandler_Http(t *testing.T) {
168168 openapitest .NewConfig ("3.0.0" ,
169169 openapitest .WithGlobalSecurity (map [string ][]string {"foo" : {}}),
170170 openapitest .WithInfo ("foo" , "" , "" ),
171- openapitest .WithPath ("/foo" , openapitest . NewPath (
172- openapitest .WithOperation ("get" , openapitest . NewOperation () ),
173- )) ,
171+ openapitest .WithPath ("/foo" ,
172+ openapitest .WithOperation ("get" ),
173+ ),
174174 openapitest .WithComponentSecurity ("foo" , & openapi.ApiKeySecurityScheme {
175175 Type : "apiKey" ,
176176 In : "header" ,
@@ -188,20 +188,17 @@ func TestHandler_Http(t *testing.T) {
188188 return runtimetest .NewHttpApp (
189189 openapitest .NewConfig ("3.0.0" ,
190190 openapitest .WithInfo ("foo" , "" , "" ),
191- openapitest .WithPath ("/foo/{bar}" , openapitest . NewPath (
192- openapitest .WithOperation ("get" , openapitest . NewOperation (
191+ openapitest .WithPath ("/foo/{bar}" ,
192+ openapitest .WithOperation ("get" ,
193193 openapitest .WithResponse (http .StatusOK ,
194194 openapitest .WithResponseDescription ("foo description" ),
195195 openapitest .WithContent (
196- "application/json" ,
197- openapitest .NewContent (
198- openapitest .WithSchema (schematest .New ("string" )),
199- ),
200- ),
196+ "application/json" , openapitest .WithSchema (schematest .New ("string" ))),
201197 openapitest .WithResponseHeader ("foo" , "bar" , schematest .New ("string" )),
202198 ),
203- )),
204- ))),
199+ ),
200+ ),
201+ ),
205202 )
206203 },
207204 requestUrl : "http://foo.api/api/services/http/foo" ,
@@ -220,25 +217,22 @@ func TestHandler_Http(t *testing.T) {
220217 },
221218 Value : openapitest .NewPath (
222219 openapitest .WithPathInfo ("foo" , "bar" ),
223- openapitest .WithOperation ("get" , openapitest . NewOperation (
224- openapitest .WithResponseRef (http .StatusOK ,
220+ openapitest .WithOperation ("get" ,
221+ openapitest .UseResponseRef (http .StatusOK ,
225222 & openapi.ResponseRef {
226223 Reference : dynamic.Reference {
227224 Ref : "#/components/pathItems/foo" ,
228225 Description : "Description" ,
229226 },
230227 Value : openapitest .NewResponse (openapitest .WithResponseDescription ("foo description" ),
231228 openapitest .WithContent (
232- "application/json" ,
233- openapitest .NewContent (
234- openapitest .WithSchema (schematest .New ("string" )),
235- ),
229+ "application/json" , openapitest .WithSchema (schematest .New ("string" )),
236230 ),
237231 openapitest .WithResponseHeader ("foo" , "bar" , schematest .New ("string" )),
238232 ),
239233 },
240234 ),
241- )) ,
235+ ),
242236 ),
243237 }),
244238 )
@@ -254,19 +248,17 @@ func TestHandler_Http(t *testing.T) {
254248 return runtimetest .NewHttpApp (
255249 openapitest .NewConfig ("3.0.0" ,
256250 openapitest .WithInfo ("foo" , "" , "" ),
257- openapitest .WithPath ("/foo/{bar}" , openapitest . NewPath (
258- openapitest .WithOperation ("get" , openapitest . NewOperation (
251+ openapitest .WithPath ("/foo/{bar}" ,
252+ openapitest .WithOperation ("get" ,
259253 openapitest .WithResponse (http .StatusOK ,
260254 openapitest .WithResponseDescription ("foo description" ),
261255 openapitest .WithContent (
262- "application/json" ,
263- openapitest .NewContent (
264- openapitest .WithSchema (schematest .New ("string" , schematest .And ("number" ))),
265- ),
256+ "application/json" , openapitest .WithSchema (schematest .New ("string" , schematest .And ("number" ))),
266257 ),
267258 ),
268- )),
269- ))),
259+ ),
260+ ),
261+ ),
270262 )
271263 },
272264 requestUrl : "http://foo.api/api/services/http/foo" ,
@@ -278,19 +270,16 @@ func TestHandler_Http(t *testing.T) {
278270 return runtimetest .NewHttpApp (
279271 openapitest .NewConfig ("3.0.0" ,
280272 openapitest .WithInfo ("foo" , "" , "" ),
281- openapitest .WithPath ("/foo/{bar}" , openapitest . NewPath (
282- openapitest .WithOperation ("get" , openapitest . NewOperation (
273+ openapitest .WithPath ("/foo/{bar}" ,
274+ openapitest .WithOperation ("get" ,
283275 openapitest .WithResponse (http .StatusOK ,
284276 openapitest .WithResponseDescription ("foo description" ),
285277 openapitest .WithContent (
286- "application/json" ,
287- openapitest .NewContent (
288- openapitest .WithSchema (schematest .New ("string" , schematest .WithDefault ("foobar" ))),
289- ),
278+ "application/json" , openapitest .WithSchema (schematest .New ("string" , schematest .WithDefault ("foobar" ))),
290279 ),
291280 ),
292281 )),
293- )) ),
282+ ),
294283 )
295284 },
296285 requestUrl : "http://foo.api/api/services/http/foo" ,
@@ -302,11 +291,11 @@ func TestHandler_Http(t *testing.T) {
302291 return runtimetest .NewHttpApp (
303292 openapitest .NewConfig ("3.0.0" ,
304293 openapitest .WithInfo ("foo" , "" , "" ),
305- openapitest .WithPath ("/foo/{bar}" , openapitest . NewPath (
306- openapitest .WithOperation ("get" , openapitest . NewOperation (
294+ openapitest .WithPath ("/foo/{bar}" ,
295+ openapitest .WithOperation ("get" ,
307296 openapitest .WithTagName ("foo" ),
308- )) ,
309- )) ,
297+ ),
298+ ),
310299 openapitest .WithTag ("foo" , "sum" , "desc" ),
311300 ),
312301 )
0 commit comments