@@ -30,7 +30,8 @@ func TestBuildOperationString(t *testing.T) {
3030 }
3131 }
3232 }` ),
33- "" ,
33+ `{"responses":null}
34+ ` ,
3435 },
3536 {
3637 "Simple operation with summary" ,
@@ -44,7 +45,8 @@ func TestBuildOperationString(t *testing.T) {
4445 "/test": { "get": { "summary": "The request's query parameters." } }
4546 }
4647 }` ),
47- "Operation summary: The request's query parameters.\n " ,
48+ `{"responses":null,"summary":"The request's query parameters."}
49+ ` ,
4850 },
4951 {
5052 "Simple operation with description" ,
@@ -58,7 +60,8 @@ func TestBuildOperationString(t *testing.T) {
5860 "/test": { "get": { "description": "The request's query parameters, with a description." } }
5961 }
6062 }` ),
61- "Operation description: The request's query parameters, with a description.\n " ,
63+ `{"description":"The request's query parameters, with a description.","responses":null}
64+ ` ,
6265 },
6366 {
6467 "Simple operation with description and summary, prefer description" ,
@@ -72,7 +75,8 @@ func TestBuildOperationString(t *testing.T) {
7275 "/test": { "get": { "description": "The request's query parameters, with a description.", "summary": "The request's query parameters summary." } }
7376 }
7477 }` ),
75- "Operation description: The request's query parameters, with a description.\n " ,
78+ `{"description":"The request's query parameters, with a description.","responses":null,"summary":"The request's query parameters summary."}
79+ ` ,
7680 },
7781 {
7882 "An operation with a parameter using a $ref" ,
@@ -144,14 +148,12 @@ func TestBuildOperationString(t *testing.T) {
144148 }
145149 }
146150 }` ),
147- `Operation summary: The request's query parameters.
148- The list of Parameters:
149- - {"in":"query","name":"genre"}
150- - {"description":"The age of the person","in":"header","name":"age","schema":{"$ref":"#/components/schemas/age0"}}
151- - {"description":"The age of the person","in":"header","name":"name","schema":{"type":"integer"}}
151+ `{"parameters":[{"in":"query","name":"genre"},{"$ref":"#/components/parameters/age"},{"$ref":"#/components/parameters/name"}],"responses":null,"summary":"The request's query parameters."}
152152The list of References:
153+ ===
153154- #/components/schemas/age: {"format":"int32","type":"integer"}
154155- #/components/schemas/age0: {"properties":{"age":{"$ref":"#/components/schemas/age"},"romanage":{"type":"string"}},"type":"object"}
156+ ===
155157` ,
156158 },
157159 {
@@ -189,14 +191,12 @@ The list of References:
189191 }
190192 }
191193 ` ),
192- `Operation summary: The request's query parameters.
193- The request body:
194- {"content":{"application/json":{"schema":{"properties":{"url":{"type":"string"}},"required":["url"],"type":"object"}}},"required":true}
194+ `{"requestBody":{"content":{"application/json":{"schema":{"properties":{"url":{"type":"string"}},"required":["url"],"type":"object"}}},"required":true},"responses":null,"summary":"The request's query parameters."}
195195` ,
196196 },
197197 {
198- "Simple operation - params, request body, with $refs " ,
199- []byte (`{
198+ "Simple operation - params, request body, with $refs " ,
199+ []byte (`{
200200 "openapi": "3.0.0",
201201 "info": {
202202 "title": "Minimal API",
@@ -286,19 +286,15 @@ The request body:
286286 }
287287 }
288288 ` ),
289- `Operation summary: The request's query parameters.
290- The list of Parameters:
291- - {"in":"query","name":"genre"}
292- - {"description":"The age of the person","in":"header","name":"age","schema":{"$ref":"#/components/schemas/age0"}}
293- - {"description":"The age of the person","in":"header","name":"name","schema":{"type":"integer"}}
294- The request body:
295- {"content":{"application/json":{"schema":{"properties":{"age":{"$ref":"#/components/schemas/age"},"city":{"$ref":"#/components/schemas/city"},"url":{"type":"string"}},"required":["url"],"type":"object"}}},"required":true}
289+ `{"parameters":[{"in":"query","name":"genre"},{"$ref":"#/components/parameters/age"},{"$ref":"#/components/parameters/name"}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"age":{"$ref":"#/components/schemas/age"},"city":{"$ref":"#/components/schemas/city"},"url":{"type":"string"}},"required":["url"],"type":"object"}}},"required":true},"responses":null,"summary":"The request's query parameters."}
296290The list of References:
291+ ===
297292- #/components/schemas/age: {"format":"int32","type":"integer"}
298293- #/components/schemas/age0: {"properties":{"age":{"$ref":"#/components/schemas/age"},"romanage":{"type":"string"}},"type":"object"}
299294- #/components/schemas/city: {"type":"string"}
295+ ===
300296` ,
301- },
297+ },
302298 }
303299
304300 for _ , tt := range tests {
0 commit comments