-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomponents.go
More file actions
29 lines (27 loc) · 1.25 KB
/
components.go
File metadata and controls
29 lines (27 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package openapi
// Components represents the components object in OpenAPI
type Components struct {
Schemas map[string]*Schema `json:"schemas,omitempty"`
Responses map[string]Response `json:"responses,omitempty"`
Parameters map[string]Parameter `json:"parameters,omitempty"`
Examples map[string]Example `json:"examples,omitempty"`
RequestBodies map[string]RequestBody `json:"requestBodies,omitempty"`
Headers map[string]Header `json:"headers,omitempty"`
SecuritySchemes map[string]SecurityScheme `json:"securitySchemes,omitempty"`
Links map[string]Link `json:"links,omitempty"`
Callbacks map[string]Callback `json:"callbacks,omitempty"`
}
// NewComponents creates a new components object
func NewComponents() *Components {
return &Components{
Schemas: make(map[string]*Schema),
Responses: make(map[string]Response),
Parameters: make(map[string]Parameter),
Examples: make(map[string]Example),
RequestBodies: make(map[string]RequestBody),
Headers: make(map[string]Header),
SecuritySchemes: make(map[string]SecurityScheme),
Links: make(map[string]Link),
Callbacks: make(map[string]Callback),
}
}