MCPcopy Index your code
hub / github.com/oapi-codegen/oapi-codegen / GetSchemaImports

Function GetSchemaImports

pkg/codegen/codegen.go:1401–1419  ·  view source on GitHub ↗
(schemas map[string]*openapi3.SchemaRef, excludeSchemas []string)

Source from the content-addressed store, hash-verified

1399}
1400
1401func 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
1421func GetRequestBodiesImports(bodies map[string]*openapi3.RequestBodyRef) (map[string]goImport, error) {
1422 res := map[string]goImport{}

Callers 1

Calls 1

GoSchemaImportsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…