(responses map[string]*openapi3.ResponseRef)
| 1438 | } |
| 1439 | |
| 1440 | func GetResponsesImports(responses map[string]*openapi3.ResponseRef) (map[string]goImport, error) { |
| 1441 | res := map[string]goImport{} |
| 1442 | for _, r := range responses { |
| 1443 | response := r.Value |
| 1444 | for mediaType, body := range response.Content { |
| 1445 | if !util.IsMediaTypeJson(mediaType) { |
| 1446 | continue |
| 1447 | } |
| 1448 | |
| 1449 | imprts, err := GoSchemaImports(body.Schema) |
| 1450 | if err != nil { |
| 1451 | return nil, err |
| 1452 | } |
| 1453 | maps.Copy(res, imprts) |
| 1454 | } |
| 1455 | } |
| 1456 | return res, nil |
| 1457 | } |
| 1458 | |
| 1459 | func GetParametersImports(params map[string]*openapi3.ParameterRef) (map[string]goImport, error) { |
| 1460 | res := map[string]goImport{} |
no test coverage detected