MCPcopy
hub / github.com/dosco/graphjin / TestClassifySkipReasons

Function TestClassifySkipReasons

core/openapi/classifier_test.go:152–262  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

150}
151
152func TestClassifySkipReasons(t *testing.T) {
153 cases := []struct {
154 name string
155 src string
156 wantSkip string
157 }{
158 {
159 name: "binary response",
160 src: `
161openapi: 3.0.0
162info: { title: t, version: '1' }
163paths:
164 /export:
165 get:
166 operationId: exportFile
167 responses:
168 '200':
169 description: ok
170 content: { application/octet-stream: { schema: { type: string, format: binary } } }
171`,
172 wantSkip: "non-JSON",
173 },
174 {
175 name: "async with Location",
176 src: `
177openapi: 3.0.0
178info: { title: t, version: '1' }
179paths:
180 /jobs:
181 get:
182 operationId: getJob
183 responses:
184 '200':
185 description: ok
186 headers:
187 Location: { schema: { type: string } }
188 content: { application/json: { schema: { type: object } } }
189`,
190 wantSkip: "async pattern",
191 },
192 {
193 name: "mutating verb",
194 src: `
195openapi: 3.0.0
196info: { title: t, version: '1' }
197paths:
198 /widgets:
199 post:
200 operationId: createWidget
201 responses:
202 '201':
203 description: created
204 content: { application/json: { schema: { type: object } } }
205`,
206 wantSkip: "mutating verb",
207 },
208 {
209 name: "nested path param",

Callers

nothing calls this directly

Calls 3

loadDocFunction · 0.85
classifyAllFunction · 0.85
containsFunction · 0.70

Tested by

no test coverage detected