Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[TypeScript-Node] support setting the content-type header per-call #1868

Merged
merged 7 commits into from
Jan 16, 2019
Merged

[TypeScript-Node] support setting the content-type header per-call #1868

merged 7 commits into from
Jan 16, 2019

Conversation

silasbw
Copy link
Contributor

@silasbw silasbw commented Jan 9, 2019

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: master, 3.4.x, 4.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

This approach is inspired by the typescript-fetch implementation in swagger-codegen.

Fixes #1867

This approach is inspired by the typescript-fetch implementation in
swagger-codegen.

Fixes #1867
@silasbw
Copy link
Contributor Author

silasbw commented Jan 9, 2019

CC @topce @wing328

@wing328
Copy link
Member

wing328 commented Jan 10, 2019

cc @TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) @macjohnny (2018/01) @nicokoenig (2018/09) @topce (2018/10)

@silasbw
Copy link
Contributor Author

silasbw commented Jan 10, 2019

@macjohnny applied your suggestions, ty.

About naming .headerParams vs .headers, one argument for using .headers is that a few popular libraries/APIs use the name headers for a similar purpose (Fetch API, request, axios). Using .headers instead of .headerParams might be "the least surprising".

@macjohnny
Copy link
Member

@silasbw ok, using .headers sounds reasonable, too.

@wing328
Copy link
Member

wing328 commented Jan 16, 2019

@silasbw thanks for the PR, which has been merged into master.

Is it correct to say that this is a breaking change (without fallback) as I saw the changes in the method signature?

@wing328 wing328 added this to the 4.0.0 milestone Jan 16, 2019
@silasbw
Copy link
Contributor Author

silasbw commented Jan 16, 2019

I don't think it's breaking, because the change includes a default value for argument it adds to the function signature..

@wing328
Copy link
Member

wing328 commented Jan 16, 2019

@silasbw 👌 thanks for the explanation.

A-Joshi pushed a commit to ihsmarkitoss/openapi-generator that referenced this pull request Feb 27, 2019
…penAPITools#1868)

* [TypeScript-Node] support setting the content-type header per-call

This approach is inspired by the typescript-fetch implementation in
swagger-codegen.

Fixes OpenAPITools#1867

* Update modules/openapi-generator/src/main/resources/typescript-node/api-single.mustache

Co-Authored-By: silasbw <[email protected]>

* Update modules/openapi-generator/src/main/resources/typescript-node/api-single.mustache

Co-Authored-By: silasbw <[email protected]>

* Update Petstore sample

* Fix types

* update "npm" petstore example

* Rename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants