Commit d61cc66
fix(formatter): use primitive type instead of schema name in get_response_type (#3916)
When a named component schema has a primitive type (e.g. type: string),
get_response_type() used schema_name() directly, emitting the schema name
as a versioned type — but no type is generated for primitive schemas,
causing a compile error in generated examples.
Fix: check simple_type() first; if the schema resolves to a primitive,
use that type directly. Consistent with how type_to_typescript() already
guards against this case.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 99a6b60 commit d61cc66
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
| 454 | + | |
454 | 455 | | |
455 | | - | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
456 | 462 | | |
0 commit comments