-
Notifications
You must be signed in to change notification settings - Fork 2
/
kind.go
212 lines (208 loc) · 6.35 KB
/
kind.go
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
package openapi
type Kind uint16
const (
KindUndefined Kind = iota
KindDocument // *Document
KindComponents // *Components
KindExample // *Example
KindExampleMap // *ExampleMap
KindExampleComponent // *Component[*Example]
KindSchema // *Schema
KindSchemaSlice // *SchemaSlice
KindSchemaMap // *SchemaMap
KindSchemaRef // *SchemaRef
KindDiscriminator // *Discriminator
KindHeader // *Header
KindHeaderMap // *HeaderMap
KindHeaderSlice // *HeaderSlice
KindHeaderComponent // *Component[*Header]
KindLink // *Link
KindLinkComponent // *Component[*Link]
KindLinkMap // *LinkMap
KindResponse // *Response
KindResponseMap // *ResponseMap
KindResponseComponent // *Component[*Response]
KindParameter // *Parameter
KindParameterComponent // *Component[*Parameter]
KindParameterSlice // *ParameterSlice
KindParameterMap // *ParameterMap
KindPaths // *Paths
KindPathItem // *PathItem
KindPathItemComponent // *Component[*PathItem]
KindPathItemMap // *PathItemMap
KindRequestBody // *RequestBody
KindRequestBodyMap // *RequestBodyMap
KindRequestBodyComponent // *Component[*RequestBody]
KindCallbacks // *Callbacks
KindCallbacksComponent // *Component[*Callbacks]
KindCallbacksMap // *CallbacksMap
KindSecurityRequirementSlice // *SecurityRequirements
KindSecurityRequirement // *SecurityRequirement
KindSecurityRequirementItem // *SecurityRequirementItem
KindSecurityScheme // *SecurityScheme
KindSecuritySchemeComponent // *Component[*SecurityScheme]
KindSecuritySchemeMap // *SecuritySchemeMap
KindOperation // *Operation
KindOperationRef // *OperationRef
KindLicense // *License
KindTag // *Tag
KindTagSlice // *TagSlice
KindMediaType // *MediaType
KindMediaTypeMap // *MediaTypeMap
KindInfo // *Info
KindContact // *Contact
KindEncoding // *Encoding
KindEncodingMap // *EncodingMap
KindExternalDocs // *ExternalDocs
KindReference // *Reference
KindServer // *Server
KindServerComponent // *Component[*Server]
KindServerSlice // *ServerSlice
KindServerVariable // *ServerVariable
KindServerVariableMap // *ServerVariableMap
KindOAuthFlow // *OAuthFlow
KindOAuthFlows // *OAuthFlows
KindXML // *XML
KindScope // *Scope
KindScopes // *Scopes
)
func (k Kind) String() string {
switch k {
case KindUndefined:
return "Undefined"
case KindDocument:
return "Document"
case KindComponents:
return "Components"
case KindExample:
return "Example"
case KindExampleMap:
return "ExampleMap"
case KindExampleComponent:
return "ExampleComponent"
case KindSchema:
return "Schema"
case KindSchemaSlice:
return "SchemaSlice"
case KindSchemaMap:
return "SchemaMap"
case KindSchemaRef:
return "SchemaRef"
case KindDiscriminator:
return "Discriminator"
case KindHeader:
return "Header"
case KindHeaderMap:
return "HeaderMap"
case KindHeaderSlice:
return "HeaderSlice"
case KindHeaderComponent:
return "HeaderComponent"
case KindLink:
return "Link"
case KindLinkComponent:
return "LinkComponent"
case KindLinkMap:
return "LinkMap"
case KindResponse:
return "Response"
case KindResponseMap:
return "ResponseMap"
case KindResponseComponent:
return "ResponseComponent"
case KindParameter:
return "Parameter"
case KindParameterComponent:
return "ParameterComponent"
case KindParameterSlice:
return "ParameterSlice"
case KindParameterMap:
return "ParameterMap"
case KindPaths:
return "Paths"
case KindPathItem:
return "PathItem"
case KindPathItemComponent:
return "PathItemComponent"
case KindPathItemMap:
return "PathItemMap"
case KindRequestBody:
return "RequestBody"
case KindRequestBodyMap:
return "RequestBodyMap"
case KindRequestBodyComponent:
return "RequestBodyComponent"
case KindCallbacks:
return "Callbacks"
case KindCallbacksComponent:
return "CallbacksComponent"
case KindCallbacksMap:
return "CallbacksMap"
case KindSecurityRequirementSlice:
return "SecurityRequirementSlice"
case KindSecurityRequirement:
return "SecurityRequirement"
case KindSecurityRequirementItem:
return "SecurityRequirementItem"
case KindSecurityScheme:
return "SecurityScheme"
case KindSecuritySchemeComponent:
return "SecuritySchemeComponent"
case KindSecuritySchemeMap:
return "SecuritySchemeMap"
case KindOperation:
return "Operation"
case KindOperationRef:
return "OperationRef"
case KindLicense:
return "License"
case KindTag:
return "Tag"
case KindTagSlice:
return "TagSlice"
case KindMediaType:
return "MediaType"
case KindMediaTypeMap:
return "MediaTypeMap"
case KindInfo:
return "Info"
case KindContact:
return "Contact"
case KindEncoding:
return "Encoding"
case KindEncodingMap:
return "EncodingMap"
case KindExternalDocs:
return "ExternalDocs"
case KindReference:
return "Reference"
case KindServer:
return "Server"
case KindServerComponent:
return "ServerComponent"
case KindServerSlice:
return "ServerSlice"
case KindServerVariable:
return "ServerVariable"
case KindServerVariableMap:
return "ServerVariableMap"
case KindOAuthFlow:
return "OAuthFlow"
case KindOAuthFlows:
return "OAuthFlows"
case KindXML:
return "XML"
case KindScope:
return "Scope"
case KindScopes:
return "Scopes"
default:
return "Invalid"
}
}
func objSliceKind(n node) Kind {
if sn, ok := n.(objSlicedNode); ok {
return sn.objSliceKind()
}
return KindUndefined
}