Commit 8e02fab
registerRouteSpec built one object literal carrying the key `request` twice: path parameters
in the first, body and query in a conditional spread further down. A property arriving through
a later spread replaces an earlier one of the same name, and TypeScript does not flag it
because the duplicate is a spread rather than a literal duplicate key. So any route declaring
BOTH a templated segment and a request body or query published no `parameters` array at all --
exactly what pathParameters() exists to prevent, since a templated segment with no matching
parameter is a schema-validation warning and leaves a generated client holding a URL it cannot
fill.
Latent only because every production entry today is response-only. The first migrated
POST /v1/repos/:owner/:repo/... would have dropped owner and repo silently, and the existing
test registered precisely that combination while asserting only that requestBody was defined.
The fix is to build `request` once; the emitter, pathParameters(), and toSpecPath() are
untouched. The regenerated openapi.json is byte-identical, as expected while no caller passes
a request. Four cases pin it -- body, query, both, and the unchanged no-request arm -- and each
of the first three fails against the pre-fix emitter. The existing spec-only assertion now
also checks its `id` parameter, and a new case covers the ORB and webhook auth levels, whose
own security schemes had no test.
Co-authored-by: loopover-orb[bot] <296761690+loopover-orb[bot]@users.noreply.github.com>
1 parent 03909f6 commit 8e02fab
2 files changed
Lines changed: 77 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
180 | 188 | | |
181 | 189 | | |
182 | 190 | | |
| |||
191 | 199 | | |
192 | 200 | | |
193 | 201 | | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
175 | 191 | | |
176 | 192 | | |
177 | 193 | | |
| |||
206 | 222 | | |
207 | 223 | | |
208 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
209 | 277 | | |
210 | 278 | | |
211 | 279 | | |
| |||
0 commit comments