Commit e8e6404
committed
fix(generator): all 54 specs compile; scope CI to anthropic + openai
The remaining 5 failing specs from #19 all flip to PASS with this batch.
Verified locally: scripts/spec-compile.sh runs all 54 → 54 PASS, 1 SKIP
(gitea / Swagger 2.0).
## Bugs fixed
1. **Path-template variables not declared as parameters.** langsmith,
knocklabs, and cloudflare have paths like
`/v1/repos/{owner}/{repo}/...` where the spec declares only `repo`
(or none). Generated code emitted
`format!("/repos/{owner}/{}", repo)` and `owner` wasn't in scope
(E0425). The analyzer now scans the path template for `{var}`
placeholders and synthesizes a required `String` parameter for any
that aren't already declared. Logs a warning per occurrence.
Closed langsmith (21 errs → 0) and knocklabs (5 → 0).
2. **OneOf nullable-pattern wrapper collisions.** Discord's
`QuarantineUserAction.metadata: oneOf [null, $ref
QuarantineUserActionMetadata]` synthesized a wrapper named
`QuarantineUserActionMetadata` that overwrote the real top-level
schema, producing E0425 "type not found". My earlier nullable-
pattern unwrap only handled anyOf; now also handles oneOf. Same
collision-suffix dance on the wrapper name when it's needed.
Closed discord (19 → 0).
3. **Same path-template variable used twice.** Cloudflare has
`/accounts/{account_id}/.../accounts/{account_id}` — same name
used twice. The old `replace_all` produced two `{}` placeholders
but only one format arg, triggering E0277 ("3 positional
arguments in format string, but there are 2"). The URL builder now
walks the path char-by-char and emits one `{}` + one format arg
per occurrence. Closed 2 of cloudflare's 14 errors.
4. **Rust-name self-reference via spec-name collision.** Cloudflare
has two distinct schemas (`dns-firewall_dns-firewall-reverse-dns-
response` and `dns-firewall_dns_firewall_reverse_dns_response`)
that PascalCase to the same Rust ident. After my emission-time
dedup drops one, what looked like a cross-reference at the spec
level becomes a self-reference at the Rust level (E0072 infinite
size). generate_field_type now also Boxes when target's Rust name
== enclosing struct's Rust name, regardless of dependency graph.
Closed cloudflare (14 → 0).
5. **Type-alias chain self-reference.** cal-com's spec literally has
`oneOf:[$ref Self], allOf:[$ref Self]` for a property — a
circular reference. Our generator emits a type alias
`pub type ReassignBookingOutput20240813Data =
ReassignBookingOutput20240813;` and the parent struct has
`data: ReassignBookingOutput20240813Data` → E0072. Added
target_aliases_back_to: walks the analysis's type-alias chain (up
to depth 16) and Boxes the field if the chain reaches the
enclosing struct's Rust name. Closed cal-com (3 → 0).
## CI scope
Trimmed `spec-compile` job from 49 specs to **just anthropic + openai**
(the production-target specs). Sentry's full-corpus check exceeded the
6-hour CI job limit on microsoft-graph alone (~42 minutes per spec on
a free runner; ~10x slower than local). Local
`scripts/spec-compile.sh` (no args) still verifies all 54 — the right
place for that level of coverage.
All 205 unit tests still pass; clippy (`-D warnings`) + fmt clean.
Refs #141 parent 8b20770 commit e8e6404
4 files changed
Lines changed: 212 additions & 50 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| 67 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1368 | 1368 | | |
1369 | 1369 | | |
1370 | 1370 | | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
1371 | 1402 | | |
1372 | | - | |
1373 | 1403 | | |
1374 | 1404 | | |
1375 | 1405 | | |
1376 | 1406 | | |
1377 | 1407 | | |
1378 | | - | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
1379 | 1428 | | |
1380 | 1429 | | |
1381 | 1430 | | |
| |||
3911 | 3960 | | |
3912 | 3961 | | |
3913 | 3962 | | |
| 3963 | + | |
| 3964 | + | |
| 3965 | + | |
| 3966 | + | |
| 3967 | + | |
| 3968 | + | |
| 3969 | + | |
| 3970 | + | |
| 3971 | + | |
| 3972 | + | |
| 3973 | + | |
| 3974 | + | |
| 3975 | + | |
| 3976 | + | |
| 3977 | + | |
| 3978 | + | |
| 3979 | + | |
| 3980 | + | |
| 3981 | + | |
| 3982 | + | |
| 3983 | + | |
| 3984 | + | |
| 3985 | + | |
| 3986 | + | |
| 3987 | + | |
| 3988 | + | |
| 3989 | + | |
| 3990 | + | |
| 3991 | + | |
| 3992 | + | |
| 3993 | + | |
| 3994 | + | |
| 3995 | + | |
| 3996 | + | |
| 3997 | + | |
| 3998 | + | |
| 3999 | + | |
| 4000 | + | |
| 4001 | + | |
| 4002 | + | |
| 4003 | + | |
| 4004 | + | |
| 4005 | + | |
| 4006 | + | |
| 4007 | + | |
| 4008 | + | |
| 4009 | + | |
| 4010 | + | |
| 4011 | + | |
| 4012 | + | |
| 4013 | + | |
3914 | 4014 | | |
3915 | 4015 | | |
3916 | 4016 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1306 | 1306 | | |
1307 | 1307 | | |
1308 | 1308 | | |
1309 | | - | |
1310 | | - | |
1311 | | - | |
1312 | | - | |
1313 | | - | |
| 1309 | + | |
1314 | 1310 | | |
1315 | 1311 | | |
1316 | 1312 | | |
1317 | 1313 | | |
1318 | 1314 | | |
1319 | 1315 | | |
1320 | | - | |
1321 | | - | |
1322 | | - | |
1323 | | - | |
1324 | | - | |
1325 | | - | |
1326 | | - | |
1327 | | - | |
1328 | | - | |
1329 | | - | |
1330 | | - | |
1331 | | - | |
1332 | | - | |
1333 | | - | |
1334 | | - | |
1335 | | - | |
1336 | | - | |
1337 | | - | |
1338 | | - | |
1339 | | - | |
1340 | | - | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
1341 | 1338 | | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
1342 | 1362 | | |
1343 | 1363 | | |
1344 | 1364 | | |
1345 | 1365 | | |
1346 | | - | |
1347 | 1366 | | |
1348 | 1367 | | |
1349 | 1368 | | |
1350 | 1369 | | |
1351 | | - | |
1352 | 1370 | | |
1353 | 1371 | | |
1354 | 1372 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1409 | 1409 | | |
1410 | 1410 | | |
1411 | 1411 | | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
1412 | 1443 | | |
1413 | 1444 | | |
1414 | 1445 | | |
| |||
1440 | 1471 | | |
1441 | 1472 | | |
1442 | 1473 | | |
1443 | | - | |
1444 | | - | |
1445 | | - | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
1446 | 1496 | | |
1447 | 1497 | | |
1448 | 1498 | | |
| |||
0 commit comments