(bodies map[string]*openapi3.RequestBodyRef)
| 1419 | } |
| 1420 | |
| 1421 | func GetRequestBodiesImports(bodies map[string]*openapi3.RequestBodyRef) (map[string]goImport, error) { |
| 1422 | res := map[string]goImport{} |
| 1423 | for _, r := range bodies { |
| 1424 | response := r.Value |
| 1425 | for mediaType, body := range response.Content { |
| 1426 | if !util.IsMediaTypeJson(mediaType) { |
| 1427 | continue |
| 1428 | } |
| 1429 | |
| 1430 | imprts, err := GoSchemaImports(body.Schema) |
| 1431 | if err != nil { |
| 1432 | return nil, err |
| 1433 | } |
| 1434 | maps.Copy(res, imprts) |
| 1435 | } |
| 1436 | } |
| 1437 | return res, nil |
| 1438 | } |
| 1439 | |
| 1440 | func GetResponsesImports(responses map[string]*openapi3.ResponseRef) (map[string]goImport, error) { |
| 1441 | res := map[string]goImport{} |
no test coverage detected