(t *testing.T)
| 150 | } |
| 151 | |
| 152 | func TestClassifySkipReasons(t *testing.T) { |
| 153 | cases := []struct { |
| 154 | name string |
| 155 | src string |
| 156 | wantSkip string |
| 157 | }{ |
| 158 | { |
| 159 | name: "binary response", |
| 160 | src: ` |
| 161 | openapi: 3.0.0 |
| 162 | info: { title: t, version: '1' } |
| 163 | paths: |
| 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: ` |
| 177 | openapi: 3.0.0 |
| 178 | info: { title: t, version: '1' } |
| 179 | paths: |
| 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: ` |
| 195 | openapi: 3.0.0 |
| 196 | info: { title: t, version: '1' } |
| 197 | paths: |
| 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", |
nothing calls this directly
no test coverage detected