fix: include additional types for array response type#1930
Conversation
Although this now appears to be fixed, we should add a test case for it.
The PR added a test under issues/issue1277 (no hyphen) and the upstream defect/1277 branch added one under issues/issue-1277 (with hyphen, matching the convention used by every other issue test). Drop the non-hyphenated copy and fold the only meaningful additions from it (info block and response description) into the hyphenated version, which is also broader (generates client + chi-server + strict-server, vs chi-server + strict-server only). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
I merged @jamietanna 's test case, and merged it with yours and merged I tested this, and it looks like it works, and is minimal. |
Greptile SummaryThis PR fixes #1277 by adding a Confidence Score: 5/5Safe to merge — the template change is minimal, targeted, and validated by a new generated test fixture. The fix is a single-line addition of an existing pattern ( No files require special attention.
|
| Filename | Overview |
|---|---|
| pkg/codegen/templates/strict/strict-interface.tmpl | Adds AdditionalTypes loop after each content response definition so inline item types (e.g. array element structs) are emitted in the strict server output — the core fix for #1277. |
| internal/test/issues/issue-1277/spec.yaml | New test spec defining a GET /test endpoint that returns an array of inline objects with additionalProperties — exactly the pattern that triggered #1277. |
| internal/test/issues/issue-1277/config.yaml | Codegen config for issue-1277 test; enables models, client, chi-server, and strict-server generation to exercise the full output surface. |
| internal/test/issues/issue-1277/generate.go | Standard go:generate directive for regenerating the issue-1277 test fixture. |
Reviews (1): Last reviewed commit: "test(issue-1277): consolidate duplicate ..." | Re-trigger Greptile
fixes #1277