Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Headers getting overwritten n scala-akka client generation #7258

Closed
ParakhMittal opened this issue Aug 20, 2020 · 1 comment
Closed

Headers getting overwritten n scala-akka client generation #7258

ParakhMittal opened this issue Aug 20, 2020 · 1 comment

Comments

@ParakhMittal
Copy link
Contributor

Description

In scala-akka-client code that is getting generated, addAuthentication method is called after setting headers using header parameter in the below mentioned line
addAuthentication(request.credentials)(
httpRequest.withHeaders(headers(request.headerParams))
)

However, in addAuthentication method, we are using withHeaders method that overwrites the headers set using header parameters.

openapi-generator version

Master 5.0.0

Command line used for generation

akka-scala-client

Steps to reproduce

Add bearer token headers along with other headers in the yaml to generate the client

@ParakhMittal
Copy link
Contributor Author

Fix proposed in the pull request #7259

wing328 pushed a commit that referenced this issue Aug 23, 2020
…issue #7258 fix (#7259)

* Update apiInvoker.mustache

In scala-akka-client code that is getting generated, addAuthentication method is called after setting headers using header parameter in the below mentioned line
addAuthentication(request.credentials)(
      httpRequest.withHeaders(headers(request.headerParams))
    )

However, in addAuthentication method, we are using withHeaders method that overwrites the headers set using header parameters. So, I am proposing to
change the addAuthentication method be replacing withHeaders() method to addHeader() to add authentication header to the list of already existing headers.

* Update ApiInvoker.scala

Added changes to sample for the client generator code change
@wing328 wing328 closed this as completed Aug 23, 2020
jimschubert added a commit that referenced this issue Aug 23, 2020
* master: (720 commits)
  [docs] Update README badges (#7276)
  Update apiInvoker.mustache and sample file for akka-scala client for issue #7258 fix (#7259)
  [Dart] Get all enum values in a list (#7166)
  Update .gitattributes
  [ci] Set ubuntu workflow verification to autoclrf=true, safeclrf=false
  Update check-supported-versions.yaml
  [ci] Update gitattributes and allow skipping docs generation for Windows CI workflows (#7273)
  [core][bug] FILES is now path relative with no prefixes (#7271)
  Update check-supported-versions.yaml
  Update check-supported-versions.yaml (#7268)
  [Java][jersey2] Add jersey injection dependencies (#7240)
  [C][Clang Static Analyzer] Remove the useless variable when assembling URL (#7255)
  Date format dart (#6389)
  minor enhancement to java client generator (#7253)
  typescript: Fix Union Types Import Issue (#6789)
  Modifying the es5 and es6 templates for javascript to handle default values (#6649)
  [python-exp] simplify examples (#7157)
  Support for KumuluzEE microprofile runtime (#5944)
  [C#][netcore] minor improvements and bug fixes (#7244)
  Deprecate Flash (ActionScript) client generator (#7231)
  ...
jimschubert added a commit to mohamedelhabib/openapi-generator that referenced this issue Aug 24, 2020
* master: (219 commits)
  [java] Appropriate instantiation of model with dynamic properties (OpenAPITools#6052)
  [docs] Update README badges (OpenAPITools#7276)
  Update apiInvoker.mustache and sample file for akka-scala client for issue OpenAPITools#7258 fix (OpenAPITools#7259)
  [Dart] Get all enum values in a list (OpenAPITools#7166)
  Update .gitattributes
  [ci] Set ubuntu workflow verification to autoclrf=true, safeclrf=false
  Update check-supported-versions.yaml
  [ci] Update gitattributes and allow skipping docs generation for Windows CI workflows (OpenAPITools#7273)
  [core][bug] FILES is now path relative with no prefixes (OpenAPITools#7271)
  Update check-supported-versions.yaml
  Update check-supported-versions.yaml (OpenAPITools#7268)
  [Java][jersey2] Add jersey injection dependencies (OpenAPITools#7240)
  [C][Clang Static Analyzer] Remove the useless variable when assembling URL (OpenAPITools#7255)
  Date format dart (OpenAPITools#6389)
  minor enhancement to java client generator (OpenAPITools#7253)
  typescript: Fix Union Types Import Issue (OpenAPITools#6789)
  Modifying the es5 and es6 templates for javascript to handle default values (OpenAPITools#6649)
  [python-exp] simplify examples (OpenAPITools#7157)
  Support for KumuluzEE microprofile runtime (OpenAPITools#5944)
  [C#][netcore] minor improvements and bug fixes (OpenAPITools#7244)
  ...
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants