Skip to content

[BUG] [Python][Template] client default headers override explicitly passed headers #9648

@RonnyPfannschmidt

Description

@RonnyPfannschmidt

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

# header parameters
header_params = header_params or {}
header_params.update(self.default_headers)

this piece of code ensures that the given parameters for a call always override the rest
i believe it should start with a copy of the defaults and update with the given parameters

but i'd like to get upstream confirmation

openapi-generator version

all i'm aware of (4.x.y, 5.x.y)

OpenAPI declaration file content or url

not needed yet

Generation Details

not needed yet

Steps to reproduce
  1. create a client object with some default headers
  2. call the api with a override to the headers
  3. observe the overrides being replaced with the defaults
Related issues/PRs

haven't found any

Suggest a fix

based on upstream response i'll either contribute a fix or change the way we call the code in our project

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions