Skip to content

Make accept header consistent with sync version#6922

Merged
wing328 merged 2 commits intoOpenAPITools:masterfrom
mh03r932:mh03r932-patch-1
Jul 17, 2020
Merged

Make accept header consistent with sync version#6922
wing328 merged 2 commits intoOpenAPITools:masterfrom
mh03r932:mh03r932-patch-1

Conversation

@mh03r932
Copy link
Copy Markdown
Contributor

@mh03r932 mh03r932 commented Jul 13, 2020

Make the accept and content-type header consistent with the sync version

This should fix issue #6821

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project beforehand.
  • Run the shell script ./bin/generate-samples.shto update all Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/config/java*. For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

@wing328
Copy link
Copy Markdown
Member

wing328 commented Jul 13, 2020

Please run ./bin/generate-samples.sh ./bin/configs/csharp-netcore-OpenAPIClient to update the samples (install Git bash if you're using Windows)

cc @mandrean (2017/08) @frankyjuang (2019/09) @shibayan (2020/02)

* make sync and async version use same logic
* generate samples for csharp-netcore using generate-samples.sh
@mh03r932
Copy link
Copy Markdown
Contributor Author

Done.
Sorry I could not do this before since I was using githubs online editor.

FYI I forced pushed that because I made a C&P error and wanted to keep this PR to a single commit.

if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);

var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts);
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modify from tabs to spaces to match the indentation of the existing code.

Copy link
Copy Markdown
Contributor Author

@mh03r932 mh03r932 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense

Copy link
Copy Markdown
Contributor Author

@mh03r932 mh03r932 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, I changed it accordingly

* change tabs to spaces to match existing code
@wing328
Copy link
Copy Markdown
Member

wing328 commented Jul 17, 2020

CircleCI failure already fixed in the master.

@wing328 wing328 merged commit ffdd700 into OpenAPITools:master Jul 17, 2020
@wing328 wing328 changed the title fix: make accept header consistent with sync vers. Make accept header consistent with sync version Jul 17, 2020
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.

3 participants