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

Function OperationSchemaImports

pkg/codegen/codegen.go:1277–1294  ·  view source on GitHub ↗
(s *Schema)

Source from the content-addressed store, hash-verified

1275}
1276
1277func OperationSchemaImports(s *Schema) (map[string]goImport, error) {
1278 res := map[string]goImport{}
1279
1280 for _, p := range s.Properties {
1281 imprts, err := GoSchemaImports(&openapi3.SchemaRef{Value: p.Schema.OAPISchema})
1282 if err != nil {
1283 return nil, err
1284 }
1285 maps.Copy(res, imprts)
1286 }
1287
1288 imprts, err := GoSchemaImports(&openapi3.SchemaRef{Value: s.OAPISchema})
1289 if err != nil {
1290 return nil, err
1291 }
1292 maps.Copy(res, imprts)
1293 return res, nil
1294}
1295
1296func OperationImports(ops []OperationDefinition) (map[string]goImport, error) {
1297 res := map[string]goImport{}

Callers 1

OperationImportsFunction · 0.85

Calls 1

GoSchemaImportsFunction · 0.85

Tested by

no test coverage detected