Skip to content

fix: format option of requests when using extractResponseBody#742

Merged
smorimoto merged 1 commit into
acacode:mainfrom
TaopaiC:extract-response-format
Jul 28, 2024
Merged

fix: format option of requests when using extractResponseBody#742
smorimoto merged 1 commit into
acacode:mainfrom
TaopaiC:extract-response-format

Conversation

@TaopaiC

@TaopaiC TaopaiC commented May 19, 2024

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Collaborator

Could you rebase to latest main branch?

@TaopaiC

TaopaiC commented Jun 25, 2024

Copy link
Copy Markdown
Contributor Author

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

TaopaiC commented Jul 26, 2024

Copy link
Copy Markdown
Contributor Author

(rebase to latest main branch)

@smorimoto
smorimoto merged commit 8bad1ae into acacode:main Jul 28, 2024
@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