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]: Tarball/Zipball - Return a Task not any content #71

Closed
1 task done
MarkEnverus opened this issue May 16, 2024 · 3 comments · Fixed by octokit/source-generator#115
Closed
1 task done
Assignees
Labels
Type: Bug Something isn't working as documented

Comments

@MarkEnverus
Copy link

What happened?

https://docs.github.com/en/rest/repos/contents?apiVersion=2022-11-28#download-a-repository-archive-tar
downloading a repo gets a Location header and downloads the binary content in Zip/Tar - currently the API only returns a Task so not data is returned

await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false);

Versions

.net v8
0.0.14 dotnet-sdk

Code of Conduct

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

👋 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! 🚀

@kfcampbell kfcampbell self-assigned this Aug 20, 2024
@kfcampbell kfcampbell removed the Status: Triage This is being looked at and prioritized label Aug 20, 2024
@kfcampbell
Copy link
Member

This is interesting! GitHub returns a 302 that redirects to the actual content. That 302 (and the type of the actual content) isn't getting picked up at generation time. Kiota does follow 302s in the redirect handler by default, which we do implement, so the redirect should be getting followed.

What's interesting is that in the specification, the redirect looks like this:

        "responses": {
          "302": {
            "description": "Response",
            "headers": {
              "Location": {
                "example": "https://codeload.github.com/me/myprivate/legacy.zip/master?login=me&token=thistokenexpires",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },

@kfcampbell
Copy link
Member

I've filed microsoft/kiota#5208 with Kiota to double-check, but I believe this is a spec issue: we shouldn't be showing the redirect as a response in the spec, and instead we should be showing where the redirect lands us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working as documented
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants