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

Function gatherComponentParameters

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

Source from the content-addressed store, hash-verified

154}
155
156func gatherComponentParameters(components *openapi3.Components) []*GatheredSchema {
157 var result []*GatheredSchema
158 for _, name := range SortedMapKeys(components.Parameters) {
159 paramRef := components.Parameters[name]
160 if paramRef == nil || paramRef.Value == nil {
161 continue
162 }
163 param := paramRef.Value
164 if param.Schema != nil && param.Schema.Value != nil {
165 var goNameOverride string
166 if paramRef.Ref == "" {
167 goNameOverride = extractGoNameOverride(param.Extensions)
168 }
169 result = append(result, &GatheredSchema{
170 Path: SchemaPath{"components", "parameters", name},
171 Context: ContextComponentParameter,
172 Ref: paramRef.Ref,
173 Schema: param.Schema.Value,
174 ComponentName: name,
175 GoNameOverride: goNameOverride,
176 })
177 }
178 }
179 return result
180}
181
182func gatherComponentResponses(components *openapi3.Components) []*GatheredSchema {
183 var result []*GatheredSchema

Callers 1

GatherSchemasFunction · 0.85

Calls 2

SortedMapKeysFunction · 0.85
extractGoNameOverrideFunction · 0.85

Tested by

no test coverage detected