Skip to content

[Bug]: Duplicated default headers in ApiClient for Java RestTemplate #1389

@megabajt

Description

@megabajt

Description

It should be possible to set default header for each HTTP request. Currently generated ApiClient class for resttemplate library does not allow that and creates duplicates.

The same issue was fixed 8 years ago in version 2 of the swagger-codegen: swagger-api/swagger-codegen#6981 however the fix was never backported to the version 3.

For example, after executing:
apiClient.addDefaultHeader("TestHeader", "foo");
apiClient.addDefaultHeader("TestHeader", "bar");
Only TestHeader with value bar should be added to the request.

Version

all

Language / Generator Affected

Java - resttemplate library

Related Issues / Repos

swagger-api/swagger-codegen#6976

Checklist

  • I have searched the existing issues to avoid duplicates.
  • I have included a minimal reproducible spec or configuration.
  • I have clearly described the steps to reproduce the issue.
  • I have specified which generator or template is affected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions