Bring the fiber and iris strict-server interface templates back into parity
with the canonical stdhttp template (`strict-interface.tmpl`). Four pieces of
drift were addressed:
1. Nullable / optional response-header serialization. Both templates now use
the same three-way switch on `.IsNullable` / `.IsOptional` / default that
PR #2301 introduced for stdhttp, so unspecified nullable values and nil
optional pointers are skipped instead of being stringified into the wire
header.
2. Response-header struct field types. The `{{$opid}}{{$statusCode}}ResponseHeaders`
struct now uses `{{.GoTypeDef}}` (pointer/nullable-aware) rather than the
raw `{{.Schema.TypeDecl}}`, matching the type that the typed-body Visit
function expects.
3. `$ref` Text responses. The fixed-status-code + ref branch now matches
Multipart and Text together (PR #2225), so `$ref` text responses alias
directly to the component response type. Iris additionally drops its
unconditional `type X string` short-circuit, which previously masked
`$ref`, `$hasHeaders`, and `$fixedStatusCode` for any text response.
4. `$ref` name qualification (fiber only). Switch from `ucFirst` to
`ucFirstWithPkgName` so external-ref response types carry their package
qualifier, matching stdhttp and iris.
Regenerated fixtures under `internal/test/strict-server/{fiber,iris}/server.gen.go`
demonstrate the change for items (1) and (2); items (3) and (4) have no
existing fiber/iris fixture coverage.
The no-content `Visit*Response` branch still renders headers unconditionally
in all three templates (including stdhttp); that gap is tracked separately
(#2349) and not addressed here.
Fixes: #2331
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
No description provided.