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

[BUG]: With parseSuccessResponseBody set to false, the return type is improperly set #665

Closed
1 task done
danielhjacobs opened this issue Feb 6, 2024 · 4 comments
Closed
1 task done
Labels
Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented

Comments

@danielhjacobs
Copy link

danielhjacobs commented Feb 6, 2024

What happened?

With this code:

  const asset = await octokit.rest.repos.getReleaseAsset({
    owner: repository.owner,
    repo: repository.repo,
    asset_id: asset_id,
    headers: {
      accept: "application/octet-stream",
    },
    request: {
      parseSuccessResponseBody: false, // required to access response as stream
    },
  });
  return await new Response(asset.data).json();

I got the error Argument of type '{ url: string; browser_download_url: string; id: number; node_id: string; name: string; label: string | null; state: "uploaded" | "open"; content_type: string; size: number; download_count: number; created_at: string; updated_at: string; uploader: { ...; } | null; }' is not assignable to parameter of type 'BodyInit | null | undefined'

Versions

Octokit 3.1.2, Node 20.

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@danielhjacobs danielhjacobs added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Feb 6, 2024
Copy link

github-actions bot commented Feb 6, 2024

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@wolfy1339
Copy link
Member

We are aware of the issue. Already tracking it over in octokit/types.ts#606

@danielhjacobs danielhjacobs changed the title [BUG]: With parseSuccessResponseBody set to false, the return type is still set to OctokitResponse [BUG]: With parseSuccessResponseBody set to false, the return type is improperly set Feb 6, 2024
@danielhjacobs
Copy link
Author

Closing as duplicate

@danielhjacobs danielhjacobs closed this as not planned Won't fix, can't repro, duplicate, stale Feb 6, 2024
@github-project-automation github-project-automation bot moved this from 🆕 Triage to ✅ Done in 🧰 Octokit Active Feb 6, 2024
@wolfy1339
Copy link
Member

I created a PR that helps with this issue, octokit/types.ts#608

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented
Projects
Archived in project
Development

No branches or pull requests

2 participants