(components *openapi3.Components)
| 246 | } |
| 247 | |
| 248 | func gatherComponentHeaders(components *openapi3.Components) []*GatheredSchema { |
| 249 | var result []*GatheredSchema |
| 250 | for _, name := range SortedMapKeys(components.Headers) { |
| 251 | headerRef := components.Headers[name] |
| 252 | if headerRef == nil || headerRef.Value == nil { |
| 253 | continue |
| 254 | } |
| 255 | header := headerRef.Value |
| 256 | if header.Schema != nil && header.Schema.Value != nil { |
| 257 | var goNameOverride string |
| 258 | if headerRef.Ref == "" { |
| 259 | goNameOverride = extractGoNameOverride(header.Extensions) |
| 260 | } |
| 261 | result = append(result, &GatheredSchema{ |
| 262 | Path: SchemaPath{"components", "headers", name}, |
| 263 | Context: ContextComponentHeader, |
| 264 | Ref: headerRef.Ref, |
| 265 | Schema: header.Schema.Value, |
| 266 | ComponentName: name, |
| 267 | GoNameOverride: goNameOverride, |
| 268 | }) |
| 269 | } |
| 270 | } |
| 271 | return result |
| 272 | } |
| 273 | |
| 274 | // gatherClientResponseWrappers creates synthetic schema entries for each |
| 275 | // operation that would generate a client response wrapper type like |
no test coverage detected