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

fix: format option of requests when using extractResponseBody #742

Merged
merged 1 commit into from
Jul 28, 2024

Conversation

TaopaiC
Copy link
Contributor

@TaopaiC TaopaiC commented May 19, 2024

When using the --extract-response-body option, the format option of requests disappears.

For example (from tests/spec/extractResponseBody.js):

When running with extractResponseBody: true, the generated code looks like this:

this.request<FindPetsByStatusDataTTT, void>({
  path: `/pet/findByStatus`,
  method: "GET",
  query: query,
  secure: true,
  ...params,
}),

However, when running without extractResponseBody: true, the generated code includes the format option:

this.request<PetTTT[], void>({
  path: `/pet/findByStatus`,
  method: "GET",
  query: query,
  secure: true,
  format: "json",   // <- this
  ...params,
}),

I attempted to copy contentKind to make the format is in the generated request options. I'm not sure if this is the good approach.

@smorimoto
Copy link
Collaborator

Could you rebase to latest main branch?

@TaopaiC
Copy link
Contributor Author

TaopaiC commented Jun 25, 2024

Hi @smorimoto , I rebase the code to latest main branch.

@smorimoto smorimoto requested a review from js2me June 27, 2024 22:56
@smorimoto smorimoto added the bug Something isn't working label Jun 27, 2024
@TaopaiC
Copy link
Contributor Author

TaopaiC commented Jul 26, 2024

(rebase to latest main branch)

@smorimoto smorimoto merged commit 8bad1ae into acacode:main Jul 28, 2024
1 check passed
@TaopaiC TaopaiC deleted the extract-response-format branch July 28, 2024 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants