Skip to content

Add Payload() hook to generated ResponseData - #103

Merged
cubahno merged 1 commit into
mainfrom
ig/add-resp-hook
Aug 8, 2026
Merged

Add Payload() hook to generated ResponseData#103
cubahno merged 1 commit into
mainfrom
ig/add-resp-hook

Conversation

@cubahno

@cubahno cubahno commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Added a Payload() any method to each generated *XxxResponseData struct (in response-data.tmpl), and switched the JSON-encoding call sites in adapter.tmpl to use resp.Payload() instead of resp.Body directly.

This gives consumers a way to customize the JSON-encoded response shape (e.g. wrap it in an envelope) by overriding just handler/response-data.tmpl via user-templates, without needing to fork adapter.tmpl too.

Regenerated all example server/testcase directories; no behavioral change with the default templates.

@cubahno cubahno self-assigned this Aug 8, 2026
@cubahno
cubahno merged commit 72ced06 into main Aug 8, 2026
3 checks passed
@cubahno
cubahno deleted the ig/add-resp-hook branch August 8, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant