Commit 4399578
fix(formatter): use primitive type instead of schema name in get_response_type (#3723)
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 class type and adding a model import — but no class 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 and suppress the model import. Consistent with how
type_to_java() already guards against this case.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 49ec47c commit 4399578
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
692 | 692 | | |
693 | 693 | | |
694 | 694 | | |
| 695 | + | |
695 | 696 | | |
696 | | - | |
| 697 | + | |
697 | 698 | | |
698 | 699 | | |
699 | | - | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
700 | 704 | | |
701 | 705 | | |
702 | 706 | | |
| |||
0 commit comments