Repository: ogen-go/ogen
Pull request #364 (2022-05-26 18:27:24)

refactor(gen): do not generate useless empty structs


Patch:
diff --git a/examples/ex_github/oas_client_gen.go b/examples/ex_github/oas_client_gen.go
index 0d80efae..c10629de 100644
--- a/examples/ex_github/oas_client_gen.go
+++ b/examples/ex_github/oas_client_gen.go
@@ -2257,7 +2257,7 @@ func (c *Client) ActionsDisableSelectedRepositoryGithubActionsOrganization(ctx c
 // GitHub Apps must have the `actions:read` permission to use this endpoint.
 //
 // GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}
-func (c *Client) ActionsDownloadArtifact(ctx context.Context, params ActionsDownloadArtifactParams) (res ActionsDownloadArtifactFoundHeaders, err error) {
+func (c *Client) ActionsDownloadArtifact(ctx context.Context, params ActionsDownloadArtifactParams) (res ActionsDownloadArtifactFound, err error) {
 	startTime := time.Now()
 	otelAttrs := []attribute.KeyValue{
 		otelogen.OperationID("actions/download-artifact"),
@@ -2367,7 +2367,7 @@ func (c *Client) ActionsDownloadArtifact(ctx context.Context, params ActionsDown
 // have the `actions:read` permission to use this endpoint.
 //
 // GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs
-func (c *Client) ActionsDownloadJobLogsForWorkflowRun(ctx context.Context, params ActionsDownloadJobLogsForWorkflowRunParams) (res ActionsDownloadJobLogsForWorkflowRunFoundHeaders, err error) {
+func (c *Client) ActionsDownloadJobLogsForWorkflowRun(ctx context.Context, params ActionsDownloadJobLogsForWorkflowRunParams) (res ActionsDownloadJobLogsForWorkflowRunFound, err error) {
 	startTime := time.Now()
 	otelAttrs := []attribute.KeyValue{
 		otelogen.OperationID("actions/download-job-logs-for-workflow-run"),
@@ -2463,7 +2463,7 @@ func (c *Client) ActionsDownloadJobLogsForWorkflowRun(ctx context.Context, param
 // the `actions:read` permission to use this endpoint.
 //
 // GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs
-func (c *Client) ActionsDownloadWorkflowRunLogs(ctx context.Context, params ActionsDownloadWorkflowRunLogsParams) (res ActionsDownloadWorkflowRunLogsFoundHeaders, err error) {
+func (c *Client) ActionsDownloadWorkflowRunLogs(ctx context.Context, params ActionsDownloadWorkflowRunLogsParams) (res ActionsDownloadWorkflowRunLogsFound, err error) {
 	startTime := time.Now()
 	otelAttrs := []attribute.KeyValue{
 		otelogen.OperationID("actions/download-workflow-run-logs"),
@@ -49096,7 +49096,7 @@ func (c *Client) ReposDisableVulnerabilityAlerts(ctx context.Context, params Rep
 // **Note**: For private repositories, these links are temporary and expire after five minutes.
 //
 // GET /repos/{owner}/{repo}/tarball/{ref}
-func (c *Client) ReposDownloadTarballArchive(ctx context.Context, params ReposDownloadTarballArchiveParams) (res ReposDownloadTarballArchiveFoundHeaders, err error) {
+func (c *Client) ReposDownloadTarballArchive(ctx context.Context, params ReposDownloadTarballArchiveParams) (res ReposDownloadTarballArchiveFound, err error) {
 	startTime := time.Now()
 	otelAttrs := []attribute.KeyValue{
 		otelogen.OperationID("repos/download-tarball-archive"),
@@ -49190,7 +49190,7 @@ func (c *Client) ReposDownloadTarballArchive(ctx context.Context, params ReposDo
 // **Note**: For private repositories, these links are temporary and expire after five minutes.
 //
 // GET /repos/{owner}/{repo}/zipball/{ref}
-func (c *Client) ReposDownloadZipballArchive(ctx context.Context, params ReposDownloadZipballArchiveParams) (res ReposDownloadZipballArchiveFoundHeaders, err error) {
+func (c *Client) ReposDownloadZipballArchive(ctx context.Context, params ReposDownloadZipballArchiveParams) (res ReposDownloadZipballArchiveFound, err error) {
 	startTime := time.Now()
 	otelAttrs := []attribute.KeyValue{
 		otelogen.OperationID("repos/download-zipball-archive"),
diff --git a/examples/ex_github/oas_response_decoders_gen.go b/examples/ex_github/oas_response_decoders_gen.go
index 912d20cc..205082a8 100644
--- a/examples/ex_github/oas_response_decoders_gen.go
+++ b/examples/ex_github/oas_response_decoders_gen.go
@@ -499,10 +499,10 @@ func decodeActionsDisableSelectedRepositoryGithubActionsOrganizationResponse(res
 		return res, validate.UnexpectedStatusCode(resp.StatusCode)
 	}
 }
-func decodeActionsDownloadArtifactResponse(resp *http.Response, span trace.Span) (res ActionsDownloadArtifactFoundHeaders, err error) {
+func decodeActionsDownloadArtifactResponse(resp *http.Response, span trace.Span) (res ActionsDownloadArtifactFound, err error) {
 	switch resp.StatusCode {
 	case 302:
-		var wrapper ActionsDownloadArtifactFoundHeaders
+		var wrapper ActionsDownloadArtifactFound
 		h := uri.NewHeaderDecoder(resp.Header)
 		// Parse 'Location' header.
 		{
@@ -539,10 +539,10 @@ func decodeActionsDownloadArtifactResponse(resp *http.Response, span trace.Span)
 		return res, validate.UnexpectedStatusCode(resp.StatusCode)
 	}
 }
-func decodeActionsDownloadJobLogsForWorkflowRunResponse(resp *http.Response, span trace.Span) (res ActionsDownloadJobLogsForWorkflowRunFoundHeaders, err error) {
+func decodeActionsDownloadJobLogsForWorkflowRunResponse(resp *http.Response, span trace.Span) (res ActionsDownloadJobLogsForWorkflowRunFound, err error) {
 	switch resp.StatusCode {
 	case 302:
-		var wrapper ActionsDownloadJobLogsForWorkflowRunFoundHeaders
+		var wrapper ActionsDownloadJobLogsForWorkflowRunFound
 		h := uri.NewHeaderDecoder(resp.Header)
 		// Parse 'Location' header.
 		{
@@ -579,10 +579,10 @@ func decodeActionsDownloadJobLogsForWorkflowRunResponse(resp *http.Response, spa
 		return res, validate.UnexpectedStatusCode(resp.StatusCode)
 	}
 }
-func decodeActionsDownloadWorkflowRunLogsResponse(resp *http.Response, span trace.Span) (res ActionsDownloadWorkflowRunLogsFoundHeaders, err error) {
+func decodeActionsDownloadWorkflowRunLogsResponse(resp *http.Response, span trace.Span) (res ActionsDownloadWorkflowRunLogsFound, err error) {
 	switch resp.StatusCode {
 	case 302:
-		var wrapper ActionsDownloadWorkflowRunLogsFoundHeaders
+		var wrapper ActionsDownloadWorkflowRunLogsFound
 		h := uri.NewHeaderDecoder(resp.Header)
 		// Parse 'Location' header.
 		{
@@ -19069,7 +19069,7 @@ func decodeOrgsCheckMembershipForUserResponse(resp *http.Response, span trace.Sp
 	case 204:
 		return &OrgsCheckMembershipForUserNoContent{}, nil
 	case 302:
-		var wrapper OrgsCheckMembershipForUserFoundHeaders
+		var wrapper OrgsCheckMembershipForUserFound
 		h := uri.NewHeaderDecoder(resp.Header)
 		// Parse 'Location' header.
 		{
@@ -20456,7 +20456,7 @@ func decodeOrgsListMembersResponse(resp *http.Response, span trace.Span) (res Or
 			return res, validate.InvalidContentType(ct)
 		}
 	case 302:
-		var wrapper OrgsListMembersFoundHeaders
+		var wrapper OrgsListMembersFound
 		h := uri.NewHeaderDecoder(resp.Header)
 		// Parse 'Location' header.
 		{
@@ -33442,10 +33442,10 @@ func decodeReposDisableVulnerabilityAlertsResponse(resp *http.Response, span tra
 		return res, validate.UnexpectedStatusCode(resp.StatusCode)
 	}
 }
-func decodeReposDownloadTarballArchiveResponse(resp *http.Response, span trace.Span) (res ReposDownloadTarballArchiveFoundHeaders, err error) {
+func decodeReposDownloadTarballArchiveResponse(resp *http.Response, span trace.Span) (res ReposDownloadTarballArchiveFound, err error) {
 	switch resp.StatusCode {
 	case 302:
-		var wrapper ReposDownloadTarballArchiveFoundHeaders
+		var wrapper ReposDownloadTarballArchiveFound
 		h := uri.NewHeaderDecoder(resp.Header)
 		// Parse 'Location' header.
 		{
@@ -33482,10 +33482,10 @@ func decodeReposDownloadTarballArchiveResponse(resp *http.Response, span trace.S
 		return res, validate.UnexpectedStatusCode(resp.StatusCode)
 	}
 }
-func decodeReposDownloadZipballArchiveResponse(resp *http.Response, span trace.Span) (res ReposDownloadZipballArchiveFoundHeaders, err error) {
+func decodeReposDownloadZipballArchiveResponse(resp *http.Response, span trace.Span) (res ReposDownloadZipballArchiveFound, err error) {
 	switch resp.StatusCode {
 	case 302:
-		var wrapper ReposDownloadZipballArchiveFoundHeaders
+		var wrapper ReposDownloadZipballArchiveFound
 		h := uri.NewHeaderDecoder(resp.Header)
 		// Parse 'Location' header.
 		{
diff --git a/examples/ex_github/oas_response_encoders_gen.go b/examples/ex_github/oas_response_encoders_gen.go
index 5796a5e9..03efb3b9 100644
--- a/examples/ex_github/oas_response_encoders_gen.go
+++ b/examples/ex_github/oas_response_encoders_gen.go
@@ -303,7 +303,7 @@ func encodeActionsDisableSelectedRepositoryGithubActionsOrganizationResponse(res
 	return nil
 
 }
-func encodeActionsDownloadArtifactResponse(response ActionsDownloadArtifactFoundHeaders, w http.ResponseWriter, span trace.Span) error {
+func encodeActionsDownloadArtifactResponse(response ActionsDownloadArtifactFound, w http.ResponseWriter, span trace.Span) error {
 	// Encoding response headers.
 	{
 		h := uri.NewHeaderEncoder(w.Header())
@@ -328,7 +328,7 @@ func encodeActionsDownloadArtifactResponse(response ActionsDownloadArtifactFound
 	return nil
 
 }
-func encodeActionsDownloadJobLogsForWorkflowRunResponse(response ActionsDownloadJobLogsForWorkflowRunFoundHeaders, w http.ResponseWriter, span trace.Span) error {
+func encodeActionsDownloadJobLogsForWorkflowRunResponse(response ActionsDownloadJobLogsForWorkflowRunFound, w http.ResponseWriter, span trace.Span) error {
 	// Encoding response headers.
 	{
 		h := uri.NewHeaderEncoder(w.Header())
@@ -353,7 +353,7 @@ func encodeActionsDownloadJobLogsForWorkflowRunResponse(response ActionsDownload
 	return nil
 
 }
-func encodeActionsDownloadWorkflowRunLogsResponse(response ActionsDownloadWorkflowRunLogsFoundHeaders, w http.ResponseWriter, span trace.Span) error {
+func encodeActionsDownloadWorkflowRunLogsResponse(response ActionsDownloadWorkflowRunLogsFound, w http.ResponseWriter, span trace.Span) error {
 	// Encoding response headers.
 	{
 		h := uri.NewHeaderEncoder(w.Header())
@@ -10544,7 +10544,7 @@ func encodeOrgsCheckMembershipForUserResponse(response OrgsCheckMembershipForUse
 		span.SetStatus(codes.Ok, http.StatusText(204))
 		return nil
 
-	case *OrgsCheckMembershipForUserFoundHeaders:
+	case *OrgsCheckMembershipForUserFound:
 		// Encoding response headers.
 		{
 			h := uri.NewHeaderEncoder(w.Header())
@@ -11336,7 +11336,7 @@ func encodeOrgsListMembersResponse(response OrgsListMembersRes, w http.ResponseW
 		}
 		return nil
 
-	case *OrgsListMembersFoundHeaders:
+	case *OrgsListMembersFound:
 		// Encoding response headers.
 		{
 			h := uri.NewHeaderEncoder(w.Header())
@@ -18590,7 +18590,7 @@ func encodeReposDisableVulnerabilityAlertsResponse(response ReposDisableVulnerab
 	return nil
 
 }
-func encodeReposDownloadTarballArchiveResponse(response ReposDownloadTarballArchiveFoundHeaders, w http.ResponseWriter, span trace.Span) error {
+func encodeReposDownloadTarballArchiveResponse(response ReposDownloadTarballArchiveFound, w http.ResponseWriter, span trace.Span) error {
 	// Encoding response headers.
 	{
 		h := uri.NewHeaderEncoder(w.Header())
@@ -18615,7 +18615,7 @@ func encodeReposDownloadTarballArchiveResponse(response ReposDownloadTarballArch
 	return nil
 
 }
-func encodeReposDownloadZipballArchiveResponse(response ReposDownloadZipballArchiveFoundHeaders, w http.ResponseWriter, span trace.Span) error {
+func encodeReposDownloadZipballArchiveResponse(response ReposDownloadZipballArchiveFound, w http.ResponseWriter, span trace.Span) error {
 	// Encoding response headers.
 	{
 		h := uri.NewHeaderEncoder(w.Header())
diff --git a/examples/ex_github/oas_schemas_gen.go b/examples/ex_github/oas_schemas_gen.go
index 28e68c82..4f9d2599 100644
--- a/examples/ex_github/oas_schemas_gen.go
+++ b/examples/ex_github/oas_schemas_gen.go
@@ -217,30 +217,18 @@ type ActionsDeleteWorkflowRunNoContent struct{}
 type ActionsDisableSelectedRepositoryGithubActionsOrganizationNoContent struct{}
 
 // ActionsDownloadArtifactFound is response for ActionsDownloadArtifact operation.
-type ActionsDownloadArtifactFound struct{}
-
-// ActionsDownloadArtifactFoundHeaders wraps ActionsDownloadArtifactFound with response headers.
-type ActionsDownloadArtifactFoundHeaders struct {
+type ActionsDownloadArtifactFound struct {
 	Location OptString
-	Response ActionsDownloadArtifactFound
 }
 
 // ActionsDownloadJobLogsForWorkflowRunFound is response for ActionsDownloadJobLogsForWorkflowRun operation.
-type ActionsDownloadJobLogsForWorkflowRunFound struct{}
-
-// ActionsDownloadJobLogsForWorkflowRunFoundHeaders wraps ActionsDownloadJobLogsForWorkflowRunFound with response headers.
-type ActionsDownloadJobLogsForWorkflowRunFoundHeaders struct {
+type ActionsDownloadJobLogsForWorkflowRunFound struct {
 	Location OptString
-	Response ActionsDownloadJobLogsForWorkflowRunFound
 }
 
 // ActionsDownloadWorkflowRunLogsFound is response for ActionsDownloadWorkflowRunLogs operation.
-type ActionsDownloadWorkflowRunLogsFound struct{}
-
-// ActionsDownloadWorkflowRunLogsFoundHeaders wraps ActionsDownloadWorkflowRunLogsFound with response headers.
-type ActionsDownloadWorkflowRunLogsFoundHeaders struct {
+type ActionsDownloadWorkflowRunLogsFound struct {
 	Location OptString
-	Response ActionsDownloadWorkflowRunLogsFound
 }
 
 // ActionsEnableSelectedRepositoryGithubActionsOrganizationNoContent is response for ActionsEnableSelectedRepositoryGithubActionsOrganization operation.
@@ -30476,15 +30464,11 @@ type OrgsCheckBlockedUserNoContent struct{}
 func (*OrgsCheckBlockedUserNoContent) orgsCheckBlockedUserRes() {}
 
 // OrgsCheckMembershipForUserFound is response for OrgsCheckMembershipForUser operation.
-type OrgsCheckMembershipForUserFound struct{}
-
-// OrgsCheckMembershipForUserFoundHeaders wraps OrgsCheckMembershipForUserFound with response headers.
-type OrgsCheckMembershipForUserFoundHeaders struct {
+type OrgsCheckMembershipForUserFound struct {
 	Location OptString
-	Response OrgsCheckMembershipForUserFound
 }
 
-func (*OrgsCheckMembershipForUserFoundHeaders) orgsCheckMembershipForUserRes() {}
+func (*OrgsCheckMembershipForUserFound) orgsCheckMembershipForUserRes() {}
 
 // OrgsCheckMembershipForUserNoContent is response for OrgsCheckMembershipForUser operation.
 type OrgsCheckMembershipForUserNoContent struct{}
@@ -30666,15 +30650,11 @@ const (
 )
 
 // OrgsListMembersFound is response for OrgsListMembers operation.
-type OrgsListMembersFound struct{}
-
-// OrgsListMembersFoundHeaders wraps OrgsListMembersFound with response headers.
-type OrgsListMembersFoundHeaders struct {
+type OrgsListMembersFound struct {
 	Location OptString
-	Response OrgsListMembersFound
 }
 
-func (*OrgsListMembersFoundHeaders) orgsListMembersRes() {}
+func (*OrgsListMembersFound) orgsListMembersRes() {}
 
 // OrgsListMembersOKHeaders wraps []SimpleUser with response headers.
 type OrgsListMembersOKHeaders struct {
@@ -35521,21 +35501,13 @@ type ReposDisableLfsForRepoNoContent struct{}
 type ReposDisableVulnerabilityAlertsNoContent struct{}
 
 // ReposDownloadTarballArchiveFound is response for ReposDownloadTarballArchive operation.
-type ReposDownloadTarballArchiveFound struct{}
-
-// ReposDownloadTarballArchiveFoundHeaders wraps ReposDownloadTarballArchiveFound with response headers.
-type ReposDownloadTarballArchiveFoundHeaders struct {
+type ReposDownloadTarballArchiveFound struct {
 	Location OptString
-	Response ReposDownloadTarballArchiveFound
 }
 
 // ReposDownloadZipballArchiveFound is response for ReposDownloadZipballArchive operation.
-type ReposDownloadZipballArchiveFound struct{}
-
-// ReposDownloadZipballArchiveFoundHeaders wraps ReposDownloadZipballArchiveFound with response headers.
-type ReposDownloadZipballArchiveFoundHeaders struct {
+type ReposDownloadZipballArchiveFound struct {
 	Location OptString
-	Response ReposDownloadZipballArchiveFound
 }
 
 // ReposEnableAutomatedSecurityFixesNoContent is response for ReposEnableAutomatedSecurityFixes operation.
diff --git a/examples/ex_github/oas_server_gen.go b/examples/ex_github/oas_server_gen.go
index 0e419d8e..31882461 100644
--- a/examples/ex_github/oas_server_gen.go
+++ b/examples/ex_github/oas_server_gen.go
@@ -407,7 +407,7 @@ type Handler interface {
 	// GitHub Apps must have the `actions:read` permission to use this endpoint.
 	//
 	// GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}
-	ActionsDownloadArtifact(ctx context.Context, params ActionsDownloadArtifactParams) (ActionsDownloadArtifactFoundHeaders, error)
+	ActionsDownloadArtifact(ctx context.Context, params ActionsDownloadArtifactParams) (ActionsDownloadArtifactFound, error)
 	// ActionsDownloadJobLogsForWorkflowRun implements actions/download-job-logs-for-workflow-run operation.
 	//
 	// Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires
@@ -419,7 +419,7 @@ type Handler interface {
 	// have the `actions:read` permission to use this endpoint.
 	//
 	// GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs
-	ActionsDownloadJobLogsForWorkflowRun(ctx context.Context, params ActionsDownloadJobLogsForWorkflowRunParams) (ActionsDownloadJobLogsForWorkflowRunFoundHeaders, error)
+	ActionsDownloadJobLogsForWorkflowRun(ctx context.Context, params ActionsDownloadJobLogsForWorkflowRunParams) (ActionsDownloadJobLogsForWorkflowRunFound, error)
 	// ActionsDownloadWorkflowRunLogs implements actions/download-workflow-run-logs operation.
 	//
 	// Gets a redirect URL to download an archive of log files for a workflow run. This link expires
@@ -431,7 +431,7 @@ type Handler interface {
 	// the `actions:read` permission to use this endpoint.
 	//
 	// GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs
-	ActionsDownloadWorkflowRunLogs(ctx context.Context, params ActionsDownloadWorkflowRunLogsParams) (ActionsDownloadWorkflowRunLogsFoundHeaders, error)
+	ActionsDownloadWorkflowRunLogs(ctx context.Context, params ActionsDownloadWorkflowRunLogsParams) (ActionsDownloadWorkflowRunLogsFound, error)
 	// ActionsEnableSelectedRepositoryGithubActionsOrganization implements actions/enable-selected-repository-github-actions-organization operation.
 	//
 	// Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an
@@ -5186,7 +5186,7 @@ type Handler interface {
 	// **Note**: For private repositories, these links are temporary and expire after five minutes.
 	//
 	// GET /repos/{owner}/{repo}/tarball/{ref}
-	ReposDownloadTarballArchive(ctx context.Context, params ReposDownloadTarballArchiveParams) (ReposDownloadTarballArchiveFoundHeaders, error)
+	ReposDownloadTarballArchive(ctx context.Context, params ReposDownloadTarballArchiveParams) (ReposDownloadTarballArchiveFound, error)
 	// ReposDownloadZipballArchive implements repos/download-zipball-archive operation.
 	//
 	// Gets a redirect URL to download a zip archive for a repository. If you omit `:ref`, the
@@ -5197,7 +5197,7 @@ type Handler interface {
 	// **Note**: For private repositories, these links are temporary and expire after five minutes.
 	//
 	// GET /repos/{owner}/{repo}/zipball/{ref}
-	ReposDownloadZipballArchive(ctx context.Context, params ReposDownloadZipballArchiveParams) (ReposDownloadZipballArchiveFoundHeaders, error)
+	ReposDownloadZipballArchive(ctx context.Context, params ReposDownloadZipballArchiveParams) (ReposDownloadZipballArchiveFound, error)
 	// ReposEnableAutomatedSecurityFixes implements repos/enable-automated-security-fixes operation.
 	//
 	// Enables automated security fixes for a repository. The authenticated user must have admin access
diff --git a/examples/ex_github/oas_unimplemented_gen.go b/examples/ex_github/oas_unimplemented_gen.go
index 012cedac..ab80935a 100644
--- a/examples/ex_github/oas_unimplemented_gen.go
+++ b/examples/ex_github/oas_unimplemented_gen.go
@@ -477,7 +477,7 @@ func (UnimplementedHandler) ActionsDisableSelectedRepositoryGithubActionsOrganiz
 // GitHub Apps must have the `actions:read` permission to use this endpoint.
 //
 // GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}
-func (UnimplementedHandler) ActionsDownloadArtifact(ctx context.Context, params ActionsDownloadArtifactParams) (r ActionsDownloadArtifactFoundHeaders, _ error) {
+func (UnimplementedHandler) ActionsDownloadArtifact(ctx context.Context, params ActionsDownloadArtifactParams) (r ActionsDownloadArtifactFound, _ error) {
 	return r, ht.ErrNotImplemented
 }
 
@@ -492,7 +492,7 @@ func (UnimplementedHandler) ActionsDownloadArtifact(ctx context.Context, params
 // have the `actions:read` permission to use this endpoint.
 //
 // GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs
-func (UnimplementedHandler) ActionsDownloadJobLogsForWorkflowRun(ctx context.Context, params ActionsDownloadJobLogsForWorkflowRunParams) (r ActionsDownloadJobLogsForWorkflowRunFoundHeaders, _ error) {
+func (UnimplementedHandler) ActionsDownloadJobLogsForWorkflowRun(ctx context.Context, params ActionsDownloadJobLogsForWorkflowRunParams) (r ActionsDownloadJobLogsForWorkflowRunFound, _ error) {
 	return r, ht.ErrNotImplemented
 }
 
@@ -507,7 +507,7 @@ func (UnimplementedHandler) ActionsDownloadJobLogsForWorkflowRun(ctx context.Con
 // the `actions:read` permission to use this endpoint.
 //
 // GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs
-func (UnimplementedHandler) ActionsDownloadWorkflowRunLogs(ctx context.Context, params ActionsDownloadWorkflowRunLogsParams) (r ActionsDownloadWorkflowRunLogsFoundHeaders, _ error) {
+func (UnimplementedHandler) ActionsDownloadWorkflowRunLogs(ctx context.Context, params ActionsDownloadWorkflowRunLogsParams) (r ActionsDownloadWorkflowRunLogsFound, _ error) {
 	return r, ht.ErrNotImplemented
 }
 
@@ -6705,7 +6705,7 @@ func (UnimplementedHandler) ReposDisableVulnerabilityAlerts(ctx context.Context,
 // **Note**: For private repositories, these links are temporary and expire after five minutes.
 //
 // GET /repos/{owner}/{repo}/tarball/{ref}
-func (UnimplementedHandler) ReposDownloadTarballArchive(ctx context.Context, params ReposDownloadTarballArchiveParams) (r ReposDownloadTarballArchiveFoundHeaders, _ error) {
+func (UnimplementedHandler) ReposDownloadTarballArchive(ctx context.Context, params ReposDownloadTarballArchiveParams) (r ReposDownloadTarballArchiveFound, _ error) {
 	return r, ht.ErrNotImplemented
 }
 
@@ -6719,7 +6719,7 @@ func (UnimplementedHandler) ReposDownloadTarballArchive(ctx context.Context, par
 // **Note**: For private repositories, these links are temporary and expire after five minutes.
 //
 // GET /repos/{owner}/{repo}/zipball/{ref}
-func (UnimplementedHandler) ReposDownloadZipballArchive(ctx context.Context, params ReposDownloadZipballArchiveParams) (r ReposDownloadZipballArchiveFoundHeaders, _ error) {
+func (UnimplementedHandler) ReposDownloadZipballArchive(ctx context.Context, params ReposDownloadZipballArchiveParams) (r ReposDownloadZipballArchiveFound, _ error) {
 	return r, ht.ErrNotImplemented
 }
 
diff --git a/gen/gen_responses.go b/gen/gen_responses.go
index 1ad607ea..3b77fbc8 100644
--- a/gen/gen_responses.go
+++ b/gen/gen_responses.go
@@ -168,27 +168,20 @@ func (g *Generator) responseToIR(
 			Doc:  doc,
 		}
 
-		// Note: use this in future?
-		//
-		// injectHeaderFields(headers, t)
-		// if withStatusCode {
-		// 	t.Fields = append(t.Fields, &ir.Field{
-		// 		Name: "StatusCode",
-		// 		Type: ir.Primitive(ir.Int, nil),
-		// 	})
-		// }
+		injectHeaderFields(headers, t)
+		if withStatusCode {
+			t.Fields = append(t.Fields, &ir.Field{
+				Name: "StatusCode",
+				Type: ir.Primitive(ir.Int, nil),
+			})
+		}
 
 		if err := ctx.saveType(t); err != nil {
 			return nil, errors.Wrap(err, "save type")
 		}
 
-		responseT, err := wrapResponseType(ctx, name, t, headers, withStatusCode)
-		if err != nil {
-			return nil, errors.Wrap(err, "wrap response type")
-		}
-
 		return &ir.Response{
-			NoContent:      responseT,
+			NoContent:      t,
 			Spec:           resp,
 			Headers:        headers,
 			WithStatusCode: withStatusCode,
diff --git a/internal/sample_api/oas_client_gen.go b/internal/sample_api/oas_client_gen.go
index d85bd539..fae2ee90 100644
--- a/internal/sample_api/oas_client_gen.go
+++ b/internal/sample_api/oas_client_gen.go
@@ -455,7 +455,7 @@ func (c *Client) FoobarPost(ctx context.Context, request OptPet) (res FoobarPost
 // FoobarPut invokes  operation.
 //
 // PUT /foobar
-func (c *Client) FoobarPut(ctx context.Context) (res FoobarPutDefStatusCode, err error) {
+func (c *Client) FoobarPut(ctx context.Context) (res FoobarPutDef, err error) {
 	startTime := time.Now()
 	otelAttrs := []attribute.KeyValue{}
 	ctx, span := c.cfg.Tracer.Start(ctx, "FoobarPut",
@@ -1235,7 +1235,7 @@ func (c *Client) PetNameByID(ctx context.Context, params PetNameByIDParams) (res
 // PetUpdateNameAliasPost invokes  operation.
 //
 // POST /pet/updateNameAlias
-func (c *Client) PetUpdateNameAliasPost(ctx context.Context, request OptPetName) (res PetUpdateNameAliasPostDefStatusCode, err error) {
+func (c *Client) PetUpdateNameAliasPost(ctx context.Context, request OptPetName) (res PetUpdateNameAliasPostDef, err error) {
 	if err := func() error {
 		if request.Set {
 			if err := func() error {
@@ -1305,7 +1305,7 @@ func (c *Client) PetUpdateNameAliasPost(ctx context.Context, request OptPetName)
 // PetUpdateNamePost invokes  operation.
 //
 // POST /pet/updateName
-func (c *Client) PetUpdateNamePost(ctx context.Context, request OptString) (res PetUpdateNamePostDefStatusCode, err error) {
+func (c *Client) PetUpdateNamePost(ctx context.Context, request OptString) (res PetUpdateNamePostDef, err error) {
 	if err := func() error {
 		if request.Set {
 			if err := func() error {
diff --git a/internal/sample_api/oas_response_decoders_gen.go b/internal/sample_api/oas_response_decoders_gen.go
index ee049f4a..7353da71 100644
--- a/internal/sample_api/oas_response_decoders_gen.go
+++ b/internal/sample_api/oas_response_decoders_gen.go
@@ -209,10 +209,10 @@ func decodeFoobarPostResponse(resp *http.Response, span trace.Span) (res FoobarP
 		}
 	}
 }
-func decodeFoobarPutResponse(resp *http.Response, span trace.Span) (res FoobarPutDefStatusCode, err error) {
+func decodeFoobarPutResponse(resp *http.Response, span trace.Span) (res FoobarPutDef, err error) {
 	switch resp.StatusCode {
 	default:
-		return FoobarPutDefStatusCode{
+		return FoobarPutDef{
 			StatusCode: resp.StatusCode,
 		}, nil
 	}
@@ -649,18 +649,18 @@ func decodePetNameByIDResponse(resp *http.Response, span trace.Span) (res string
 		return res, validate.UnexpectedStatusCode(resp.StatusCode)
 	}
 }
-func decodePetUpdateNameAliasPostResponse(resp *http.Response, span trace.Span) (res PetUpdateNameAliasPostDefStatusCode, err error) {
+func decodePetUpdateNameAliasPostResponse(resp *http.Response, span trace.Span) (res PetUpdateNameAliasPostDef, err error) {
 	switch resp.StatusCode {
 	default:
-		return PetUpdateNameAliasPostDefStatusCode{
+		return PetUpdateNameAliasPostDef{
 			StatusCode: resp.StatusCode,
 		}, nil
 	}
 }
-func decodePetUpdateNamePostResponse(resp *http.Response, span trace.Span) (res PetUpdateNamePostDefStatusCode, err error) {
+func decodePetUpdateNamePostResponse(resp *http.Response, span trace.Span) (res PetUpdateNamePostDef, err error) {
 	switch resp.StatusCode {
 	default:
-		return PetUpdateNamePostDefStatusCode{
+		return PetUpdateNamePostDef{
 			StatusCode: resp.StatusCode,
 		}, nil
 	}
diff --git a/internal/sample_api/oas_response_encoders_gen.go b/internal/sample_api/oas_response_encoders_gen.go
index 520df9de..e6b50cf9 100644
--- a/internal/sample_api/oas_response_encoders_gen.go
+++ b/internal/sample_api/oas_response_encoders_gen.go
@@ -125,7 +125,7 @@ func encodeFoobarPostResponse(response FoobarPostRes, w http.ResponseWriter, spa
 		return errors.Errorf("/foobar"+`: unexpected response type: %T`, response)
 	}
 }
-func encodeFoobarPutResponse(response FoobarPutDefStatusCode, w http.ResponseWriter, span trace.Span) error {
+func encodeFoobarPutResponse(response FoobarPutDef, w http.ResponseWriter, span trace.Span) error {
 	w.WriteHeader(response.StatusCode)
 	st := http.StatusText(response.StatusCode)
 	if response.StatusCode >= http.StatusBadRequest {
@@ -376,7 +376,7 @@ func encodePetNameByIDResponse(response string, w http.ResponseWriter, span trac
 	return nil
 
 }
-func encodePetUpdateNameAliasPostResponse(response PetUpdateNameAliasPostDefStatusCode, w http.ResponseWriter, span trace.Span) error {
+func encodePetUpdateNameAliasPostResponse(response PetUpdateNameAliasPostDef, w http.ResponseWriter, span trace.Span) error {
 	w.WriteHeader(response.StatusCode)
 	st := http.StatusText(response.StatusCode)
 	if response.StatusCode >= http.StatusBadRequest {
@@ -387,7 +387,7 @@ func encodePetUpdateNameAliasPostResponse(response PetUpdateNameAliasPostDefStat
 	return nil
 
 }
-func encodePetUpdateNamePostResponse(response PetUpdateNamePostDefStatusCode, w http.ResponseWriter, span trace.Span) error {
+func encodePetUpdateNamePostResponse(response PetUpdateNamePostDef, w http.ResponseWriter, span trace.Span) error {
 	w.WriteHeader(response.StatusCode)
 	st := http.StatusText(response.StatusCode)
 	if response.StatusCode >= http.StatusBadRequest {
diff --git a/internal/sample_api/oas_schemas_gen.go b/internal/sample_api/oas_schemas_gen.go
index 8986eb7c..0b73c3ec 100644
--- a/internal/sample_api/oas_schemas_gen.go
+++ b/internal/sample_api/oas_schemas_gen.go
@@ -248,12 +248,8 @@ func (*ErrorStatusCode) petGetAvatarByNameRes()  {}
 func (*ErrorStatusCode) petUploadAvatarByIDRes() {}
 
 // FoobarPutDef is default response for FoobarPut operation.
-type FoobarPutDef struct{}
-
-// FoobarPutDefStatusCode wraps FoobarPutDef with StatusCode.
-type FoobarPutDefStatusCode struct {
+type FoobarPutDef struct {
 	StatusCode int
-	Response   FoobarPutDef
 }
 
 // Ref: #/components/schemas/Hash
@@ -3031,21 +3027,13 @@ const (
 )
 
 // PetUpdateNameAliasPostDef is default response for PetUpdateNameAliasPost operation.
-type PetUpdateNameAliasPostDef struct{}
-
-// PetUpdateNameAliasPostDefStatusCode wraps PetUpdateNameAliasPostDef with StatusCode.
-type PetUpdateNameAliasPostDefStatusCode struct {
+type PetUpdateNameAliasPostDef struct {
 	StatusCode int
-	Response   PetUpdateNameAliasPostDef
 }
 
 // PetUpdateNamePostDef is default response for PetUpdateNamePost operation.
-type PetUpdateNamePostDef struct{}
-
-// PetUpdateNamePostDefStatusCode wraps PetUpdateNamePostDef with StatusCode.
-type PetUpdateNamePostDefStatusCode struct {
+type PetUpdateNamePostDef struct {
 	StatusCode int
-	Response   PetUpdateNamePostDef
 }
 
 // PetUploadAvatarByIDOK is response for PetUploadAvatarByID operation.
diff --git a/internal/sample_api/oas_server_gen.go b/internal/sample_api/oas_server_gen.go
index 08c9397d..119bba5e 100644
--- a/internal/sample_api/oas_server_gen.go
+++ b/internal/sample_api/oas_server_gen.go
@@ -43,7 +43,7 @@ type Handler interface {
 	// FoobarPut implements  operation.
 	//
 	// PUT /foobar
-	FoobarPut(ctx context.Context) (FoobarPutDefStatusCode, error)
+	FoobarPut(ctx context.Context) (FoobarPutDef, error)
 	// GetHeader implements getHeader operation.
 	//
 	// Test for header param.
@@ -111,11 +111,11 @@ type Handler interface {
 	// PetUpdateNameAliasPost implements  operation.
 	//
 	// POST /pet/updateNameAlias
-	PetUpdateNameAliasPost(ctx context.Context, req OptPetName) (PetUpdateNameAliasPostDefStatusCode, error)
+	PetUpdateNameAliasPost(ctx context.Context, req OptPetName) (PetUpdateNameAliasPostDef, error)
 	// PetUpdateNamePost implements  operation.
 	//
 	// POST /pet/updateName
-	PetUpdateNamePost(ctx context.Context, req OptString) (PetUpdateNamePostDefStatusCode, error)
+	PetUpdateNamePost(ctx context.Context, req OptString) (PetUpdateNamePostDef, error)
 	// PetUploadAvatarByID implements petUploadAvatarByID operation.
 	//
 	// Uploads pet avatar by id.
diff --git a/internal/sample_api/oas_unimplemented_gen.go b/internal/sample_api/oas_unimplemented_gen.go
index e274dc2c..de1b1e37 100644
--- a/internal/sample_api/oas_unimplemented_gen.go
+++ b/internal/sample_api/oas_unimplemented_gen.go
@@ -59,7 +59,7 @@ func (UnimplementedHandler) FoobarPost(ctx context.Context, req OptPet) (r Fooba
 // FoobarPut implements  operation.
 //
 // PUT /foobar
-func (UnimplementedHandler) FoobarPut(ctx context.Context) (r FoobarPutDefStatusCode, _ error) {
+func (UnimplementedHandler) FoobarPut(ctx context.Context) (r FoobarPutDef, _ error) {
 	return r, ht.ErrNotImplemented
 }
 
@@ -166,14 +166,14 @@ func (UnimplementedHandler) PetNameByID(ctx context.Context, params PetNameByIDP
 // PetUpdateNameAliasPost implements  operation.
 //
 // POST /pet/updateNameAlias
-func (UnimplementedHandler) PetUpdateNameAliasPost(ctx context.Context, req OptPetName) (r PetUpdateNameAliasPostDefStatusCode, _ error) {
+func (UnimplementedHandler) PetUpdateNameAliasPost(ctx context.Context, req OptPetName) (r PetUpdateNameAliasPostDef, _ error) {
 	return r, ht.ErrNotImplemented
 }
 
 // PetUpdateNamePost implements  operation.
 //
 // POST /pet/updateName
-func (UnimplementedHandler) PetUpdateNamePost(ctx context.Context, req OptString) (r PetUpdateNamePostDefStatusCode, _ error) {
+func (UnimplementedHandler) PetUpdateNamePost(ctx context.Context, req OptString) (r PetUpdateNamePostDef, _ error) {
 	return r, ht.ErrNotImplemented
 }
 


Test patch:
diff --git a/e2e_test.go b/e2e_test.go
index c0fd1357..eae161af 100644
--- a/e2e_test.go
+++ b/e2e_test.go
@@ -87,11 +87,11 @@ func (s sampleAPIServer) GetHeader(ctx context.Context, params api.GetHeaderPara
 	}, nil
 }
 
-func (s sampleAPIServer) PetUpdateNameAliasPost(ctx context.Context, req api.OptPetName) (api.PetUpdateNameAliasPostDefStatusCode, error) {
+func (s sampleAPIServer) PetUpdateNameAliasPost(ctx context.Context, req api.OptPetName) (api.PetUpdateNameAliasPostDef, error) {
 	panic("implement me")
 }
 
-func (s sampleAPIServer) PetUpdateNamePost(ctx context.Context, req api.OptString) (api.PetUpdateNamePostDefStatusCode, error) {
+func (s sampleAPIServer) PetUpdateNamePost(ctx context.Context, req api.OptString) (api.PetUpdateNamePostDef, error) {
 	panic("implement me")
 }
 
@@ -114,7 +114,7 @@ func (s sampleAPIServer) FoobarGet(ctx context.Context, params api.FoobarGetPara
 	panic("implement me")
 }
 
-func (s sampleAPIServer) FoobarPut(ctx context.Context) (api.FoobarPutDefStatusCode, error) {
+func (s sampleAPIServer) FoobarPut(ctx context.Context) (api.FoobarPutDef, error) {
 	panic("implement me")
 }
 
diff --git a/internal/test_http_responses/oas_client_gen.go b/internal/test_http_responses/oas_client_gen.go
index 396becd7..c7bcee6b 100644
--- a/internal/test_http_responses/oas_client_gen.go
+++ b/internal/test_http_responses/oas_client_gen.go
@@ -138,7 +138,7 @@ func (c *Client) AnyContentTypeBinaryStringSchemaDefault(ctx context.Context) (r
 // Headers200 invokes headers200 operation.
 //
 // GET /headers200
-func (c *Client) Headers200(ctx context.Context) (res Headers200OKHeaders, err error) {
+func (c *Client) Headers200(ctx context.Context) (res Headers200OK, err error) {
 	startTime := time.Now()
 	otelAttrs := []attribute.KeyValue{
 		otelogen.OperationID("headers200"),
@@ -240,7 +240,7 @@ func (c *Client) HeadersCombined(ctx context.Context, params HeadersCombinedPara
 // HeadersDefault invokes headersDefault operation.
 //
 // GET /headersDefault
-func (c *Client) HeadersDefault(ctx context.Context) (res HeadersDefaultDefStatusCodeWithHeaders, err error) {
+func (c *Client) HeadersDefault(ctx context.Context) (res HeadersDefaultDef, err error) {
 	startTime := time.Now()
 	otelAttrs := []attribute.KeyValue{
 		otelogen.OperationID("headersDefault"),
diff --git a/internal/test_http_responses/oas_response_decoders_gen.go b/internal/test_http_responses/oas_response_decoders_gen.go
index 50141069..6f834c4c 100644
--- a/internal/test_http_responses/oas_response_decoders_gen.go
+++ b/internal/test_http_responses/oas_response_decoders_gen.go
@@ -55,10 +55,10 @@ func decodeAnyContentTypeBinaryStringSchemaDefaultResponse(resp *http.Response,
 		}
 	}
 }
-func decodeHeaders200Response(resp *http.Response, span trace.Span) (res Headers200OKHeaders, err error) {
+func decodeHeaders200Response(resp *http.Response, span trace.Span) (res Headers200OK, err error) {
 	switch resp.StatusCode {
 	case 200:
-		var wrapper Headers200OKHeaders
+		var wrapper Headers200OK
 		h := uri.NewHeaderDecoder(resp.Header)
 		// Parse 'TestHeader' header.
 		{
@@ -91,7 +91,7 @@ func decodeHeaders200Response(resp *http.Response, span trace.Span) (res Headers
 func decodeHeadersCombinedResponse(resp *http.Response, span trace.Span) (res HeadersCombinedRes, err error) {
 	switch resp.StatusCode {
 	case 200:
-		var wrapper HeadersCombinedOKHeaders
+		var wrapper HeadersCombinedOK
 		h := uri.NewHeaderDecoder(resp.Header)
 		// Parse 'TestHeader' header.
 		{
@@ -118,7 +118,7 @@ func decodeHeadersCombinedResponse(resp *http.Response, span trace.Span) (res He
 		}
 		return &wrapper, nil
 	default:
-		var wrapper HeadersCombinedDefStatusCodeWithHeaders
+		var wrapper HeadersCombinedDef
 		wrapper.StatusCode = resp.StatusCode
 		h := uri.NewHeaderDecoder(resp.Header)
 		// Parse 'TestHeader' header.
@@ -147,10 +147,10 @@ func decodeHeadersCombinedResponse(resp *http.Response, span trace.Span) (res He
 		return &wrapper, nil
 	}
 }
-func decodeHeadersDefaultResponse(resp *http.Response, span trace.Span) (res HeadersDefaultDefStatusCodeWithHeaders, err error) {
+func decodeHeadersDefaultResponse(resp *http.Response, span trace.Span) (res HeadersDefaultDef, err error) {
 	switch resp.StatusCode {
 	default:
-		var wrapper HeadersDefaultDefStatusCodeWithHeaders
+		var wrapper HeadersDefaultDef
 		wrapper.StatusCode = resp.StatusCode
 		h := uri.NewHeaderDecoder(resp.Header)
 		// Parse 'TestHeader' header.
diff --git a/internal/test_http_responses/oas_response_encoders_gen.go b/internal/test_http_responses/oas_response_encoders_gen.go
index e6c2d99f..38087475 100644
--- a/internal/test_http_responses/oas_response_encoders_gen.go
+++ b/internal/test_http_responses/oas_response_encoders_gen.go
@@ -40,7 +40,7 @@ func encodeAnyContentTypeBinaryStringSchemaDefaultResponse(response AnyContentTy
 	return nil
 
 }
-func encodeHeaders200Response(response Headers200OKHeaders, w http.ResponseWriter, span trace.Span) error {
+func encodeHeaders200Response(response Headers200OK, w http.ResponseWriter, span trace.Span) error {
 	// Encoding response headers.
 	{
 		h := uri.NewHeaderEncoder(w.Header())
@@ -64,7 +64,7 @@ func encodeHeaders200Response(response Headers200OKHeaders, w http.ResponseWrite
 }
 func encodeHeadersCombinedResponse(response HeadersCombinedRes, w http.ResponseWriter, span trace.Span) error {
 	switch response := response.(type) {
-	case *HeadersCombinedOKHeaders:
+	case *HeadersCombinedOK:
 		// Encoding response headers.
 		{
 			h := uri.NewHeaderEncoder(w.Header())
@@ -85,7 +85,7 @@ func encodeHeadersCombinedResponse(response HeadersCombinedRes, w http.ResponseW
 		span.SetStatus(codes.Ok, http.StatusText(200))
 		return nil
 
-	case *HeadersCombinedDefStatusCodeWithHeaders:
+	case *HeadersCombinedDef:
 		// Encoding response headers.
 		{
 			h := uri.NewHeaderEncoder(w.Header())
@@ -115,7 +115,7 @@ func encodeHeadersCombinedResponse(response HeadersCombinedRes, w http.ResponseW
 		return errors.Errorf("/headersCombined"+`: unexpected response type: %T`, response)
 	}
 }
-func encodeHeadersDefaultResponse(response HeadersDefaultDefStatusCodeWithHeaders, w http.ResponseWriter, span trace.Span) error {
+func encodeHeadersDefaultResponse(response HeadersDefaultDef, w http.ResponseWriter, span trace.Span) error {
 	// Encoding response headers.
 	{
 		h := uri.NewHeaderEncoder(w.Header())
diff --git a/internal/test_http_responses/oas_schemas_gen.go b/internal/test_http_responses/oas_schemas_gen.go
index 8a018da9..bc43ffb7 100644
--- a/internal/test_http_responses/oas_schemas_gen.go
+++ b/internal/test_http_responses/oas_schemas_gen.go
@@ -29,45 +29,29 @@ func (s AnyContentTypeBinaryStringSchemaOK) Read(p []byte) (n int, err error) {
 }
 
 // Headers200OK is response for Headers200 operation.
-type Headers200OK struct{}
-
-// Headers200OKHeaders wraps Headers200OK with response headers.
-type Headers200OKHeaders struct {
+type Headers200OK struct {
 	TestHeader string
-	Response   Headers200OK
 }
 
 // HeadersCombinedDef is default response for HeadersCombined operation.
-type HeadersCombinedDef struct{}
-
-// HeadersCombinedDefStatusCodeWithHeaders wraps HeadersCombinedDef with status code and response headers.
-type HeadersCombinedDefStatusCodeWithHeaders struct {
-	StatusCode int
+type HeadersCombinedDef struct {
 	TestHeader string
-	Response   HeadersCombinedDef
+	StatusCode int
 }
 
-func (*HeadersCombinedDefStatusCodeWithHeaders) headersCombinedRes() {}
+func (*HeadersCombinedDef) headersCombinedRes() {}
 
 // HeadersCombinedOK is response for HeadersCombined operation.
-type HeadersCombinedOK struct{}
-
-// HeadersCombinedOKHeaders wraps HeadersCombinedOK with response headers.
-type HeadersCombinedOKHeaders struct {
+type HeadersCombinedOK struct {
 	TestHeader string
-	Response   HeadersCombinedOK
 }
 
-func (*HeadersCombinedOKHeaders) headersCombinedRes() {}
+func (*HeadersCombinedOK) headersCombinedRes() {}
 
 // HeadersDefaultDef is default response for HeadersDefault operation.
-type HeadersDefaultDef struct{}
-
-// HeadersDefaultDefStatusCodeWithHeaders wraps HeadersDefaultDef with status code and response headers.
-type HeadersDefaultDefStatusCodeWithHeaders struct {
-	StatusCode int
+type HeadersDefaultDef struct {
 	TestHeader string
-	Response   HeadersDefaultDef
+	StatusCode int
 }
 
 // NewNilInt returns new NilInt with value set to v.
diff --git a/internal/test_http_responses/oas_server_gen.go b/internal/test_http_responses/oas_server_gen.go
index 7cae8606..e7234343 100644
--- a/internal/test_http_responses/oas_server_gen.go
+++ b/internal/test_http_responses/oas_server_gen.go
@@ -23,7 +23,7 @@ type Handler interface {
 	// Headers200 implements headers200 operation.
 	//
 	// GET /headers200
-	Headers200(ctx context.Context) (Headers200OKHeaders, error)
+	Headers200(ctx context.Context) (Headers200OK, error)
 	// HeadersCombined implements headersCombined operation.
 	//
 	// GET /headersCombined
@@ -31,7 +31,7 @@ type Handler interface {
 	// HeadersDefault implements headersDefault operation.
 	//
 	// GET /headersDefault
-	HeadersDefault(ctx context.Context) (HeadersDefaultDefStatusCodeWithHeaders, error)
+	HeadersDefault(ctx context.Context) (HeadersDefaultDef, error)
 	// MultipleGenericResponses implements multipleGenericResponses operation.
 	//
 	// GET /multipleGenericResponses
diff --git a/internal/test_http_responses/oas_unimplemented_gen.go b/internal/test_http_responses/oas_unimplemented_gen.go
index 8abf6620..ca59d919 100644
--- a/internal/test_http_responses/oas_unimplemented_gen.go
+++ b/internal/test_http_responses/oas_unimplemented_gen.go
@@ -30,7 +30,7 @@ func (UnimplementedHandler) AnyContentTypeBinaryStringSchemaDefault(ctx context.
 // Headers200 implements headers200 operation.
 //
 // GET /headers200
-func (UnimplementedHandler) Headers200(ctx context.Context) (r Headers200OKHeaders, _ error) {
+func (UnimplementedHandler) Headers200(ctx context.Context) (r Headers200OK, _ error) {
 	return r, ht.ErrNotImplemented
 }
 
@@ -44,7 +44,7 @@ func (UnimplementedHandler) HeadersCombined(ctx context.Context, params HeadersC
 // HeadersDefault implements headersDefault operation.
 //
 // GET /headersDefault
-func (UnimplementedHandler) HeadersDefault(ctx context.Context) (r HeadersDefaultDefStatusCodeWithHeaders, _ error) {
+func (UnimplementedHandler) HeadersDefault(ctx context.Context) (r HeadersDefaultDef, _ error) {
 	return r, ht.ErrNotImplemented
 }
 
diff --git a/responses_test.go b/responses_test.go
index 62b3e0f3..1a5133ce 100644
--- a/responses_test.go
+++ b/responses_test.go
@@ -49,26 +49,26 @@ func (t testHTTPResponses) OctetStreamEmptySchema(ctx context.Context) (api.Octe
 	}, nil
 }
 
-func (t testHTTPResponses) Headers200(ctx context.Context) (api.Headers200OKHeaders, error) {
-	return api.Headers200OKHeaders{
+func (t testHTTPResponses) Headers200(ctx context.Context) (api.Headers200OK, error) {
+	return api.Headers200OK{
 		TestHeader: "foo",
 	}, nil
 }
 
 func (t testHTTPResponses) HeadersCombined(ctx context.Context, params api.HeadersCombinedParams) (api.HeadersCombinedRes, error) {
 	if params.Default {
-		return &api.HeadersCombinedDefStatusCodeWithHeaders{
+		return &api.HeadersCombinedDef{
 			StatusCode: 202,
 			TestHeader: "default=true",
 		}, nil
 	}
-	return &api.HeadersCombinedOKHeaders{
+	return &api.HeadersCombinedOK{
 		TestHeader: "default=false",
 	}, nil
 }
 
-func (t testHTTPResponses) HeadersDefault(ctx context.Context) (api.HeadersDefaultDefStatusCodeWithHeaders, error) {
-	return api.HeadersDefaultDefStatusCodeWithHeaders{
+func (t testHTTPResponses) HeadersDefault(ctx context.Context) (api.HeadersDefaultDef, error) {
+	return api.HeadersDefaultDef{
 		StatusCode: 202,
 		TestHeader: "202",
 	}, nil
@@ -141,15 +141,15 @@ func TestResponses(t *testing.T) {
 				Default: false,
 			})
 			a.NoError(err)
-			a.IsType(r, &api.HeadersCombinedOKHeaders{})
-			a.Equal(r.(*api.HeadersCombinedOKHeaders).TestHeader, "default=false")
+			a.IsType(r, &api.HeadersCombinedOK{})
+			a.Equal(r.(*api.HeadersCombinedOK).TestHeader, "default=false")
 
 			r, err = client.HeadersCombined(ctx, api.HeadersCombinedParams{
 				Default: true,
 			})
 			a.NoError(err)
-			a.IsType(r, &api.HeadersCombinedDefStatusCodeWithHeaders{})
-			a.Equal(r.(*api.HeadersCombinedDefStatusCodeWithHeaders).TestHeader, "default=true")
+			a.IsType(r, &api.HeadersCombinedDef{})
+			a.Equal(r.(*api.HeadersCombinedDef).TestHeader, "default=true")
 		}
 	}
 }