(schemas map[string]*openapi3.SchemaRef, excludeSchemas []string)
| 1399 | } |
| 1400 | |
| 1401 | func GetSchemaImports(schemas map[string]*openapi3.SchemaRef, excludeSchemas []string) (map[string]goImport, error) { |
| 1402 | res := map[string]goImport{} |
| 1403 | excludeSchemasMap := make(map[string]bool) |
| 1404 | for _, schema := range excludeSchemas { |
| 1405 | excludeSchemasMap[schema] = true |
| 1406 | } |
| 1407 | for schemaName, schema := range schemas { |
| 1408 | if _, ok := excludeSchemasMap[schemaName]; ok { |
| 1409 | continue |
| 1410 | } |
| 1411 | |
| 1412 | imprts, err := GoSchemaImports(schema) |
| 1413 | if err != nil { |
| 1414 | return nil, err |
| 1415 | } |
| 1416 | maps.Copy(res, imprts) |
| 1417 | } |
| 1418 | return res, nil |
| 1419 | } |
| 1420 | |
| 1421 | func GetRequestBodiesImports(bodies map[string]*openapi3.RequestBodyRef) (map[string]goImport, error) { |
| 1422 | res := map[string]goImport{} |
no test coverage detected
searching dependent graphs…