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

@hey-api/client-fetch Returns response as Blob for Accept: "application/ld+json" #1288

Open
zilvinas-abromavicius-surfshark opened this issue Nov 14, 2024 · 2 comments
Labels
bug 🔥 Something isn't working prioritized 🚚 This issue has been prioritized and will be worked on soon
Milestone

Comments

@zilvinas-abromavicius-surfshark

Description

It seems that when passing header to Accept ld+json format, the response returned is a Blob instead of a json.
E.g. I initialize the client as such:

  const client = createClient({
    baseUrl,
    headers: {
      Accept: "application/ld+json",
    },
  });

And when logging, I get such result for response.data: data: Blob { size: 162241, type: 'application/ld+json;charset=utf-8' },

Reproducible example or configuration

No response

OpenAPI specification (optional)

No response

System information (optional)

No response

@zilvinas-abromavicius-surfshark zilvinas-abromavicius-surfshark added the bug 🔥 Something isn't working label Nov 14, 2024
@scripness
Copy link

scripness commented Nov 14, 2024

To fix that I use: parseAs: 'json' in client.setConfig.

Also while we're here, is there a way to tell the client to prioritize ld+json? For example when we run some operation in response to the generated service we get as typescript response the json object while in reality (since we set the headers to ld+json) it comes with the extra fields.

@mrlubos mrlubos added the prioritized 🚚 This issue has been prioritized and will be worked on soon label Nov 14, 2024
@mrlubos mrlubos added this to the Parser milestone Nov 14, 2024
@zilvinas-abromavicius-surfshark
Copy link
Author

To fix that I use: parseAs: 'json' in client.setConfig.

Also while we're here, is there a way to tell the client to prioritize ld+json? For example when we run some operation in response to the generated service we get as typescript response the json object while in reality (since we set the headers to ld+json) it comes with the extra fields.

Thanks a lot, this seems to resolve the issue for now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🔥 Something isn't working prioritized 🚚 This issue has been prioritized and will be worked on soon
Projects
None yet
Development

No branches or pull requests

3 participants