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

Function gatherComponentSchemas

pkg/codegen/gather.go:133–154  ·  view source on GitHub ↗
(components *openapi3.Components)

Source from the content-addressed store, hash-verified

131}
132
133func gatherComponentSchemas(components *openapi3.Components) []*GatheredSchema {
134 var result []*GatheredSchema
135 for _, name := range SortedSchemaKeys(components.Schemas) {
136 schemaRef := components.Schemas[name]
137 if schemaRef == nil || schemaRef.Value == nil {
138 continue
139 }
140 var goNameOverride string
141 if schemaRef.Ref == "" {
142 goNameOverride = extractGoNameOverride(schemaRef.Value.Extensions)
143 }
144 result = append(result, &GatheredSchema{
145 Path: SchemaPath{"components", "schemas", name},
146 Context: ContextComponentSchema,
147 Ref: schemaRef.Ref,
148 Schema: schemaRef.Value,
149 ComponentName: name,
150 GoNameOverride: goNameOverride,
151 })
152 }
153 return result
154}
155
156func gatherComponentParameters(components *openapi3.Components) []*GatheredSchema {
157 var result []*GatheredSchema

Callers 1

GatherSchemasFunction · 0.85

Calls 2

SortedSchemaKeysFunction · 0.85
extractGoNameOverrideFunction · 0.85

Tested by

no test coverage detected