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

[github] Fixed 422 error in list repositories for the authenticated user #25

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kavin-kr
Copy link

@kavin-kr kavin-kr commented Jul 1, 2022

In GitHub's list repo for authenticated user api, using type parameter along with visibility or affiliation will cause 422 error. Hence marked ReposListVisibility and ReposListType as optional params to skip in query params.

ref: https://docs.github.com/en/rest/repos/repos#list-repositories-for-the-authenticated-user

@kavin-kr
Copy link
Author

kavin-kr commented Jul 1, 2022

If needed, we can use Into<Option> impl for ReposListVisibility and ReposListType to maintain backward compatibility.

@kavin-kr kavin-kr force-pushed the fix/list-all-repos branch from 46a1893 to 749eb3b Compare March 28, 2023 17:12
@kavin-kr kavin-kr changed the title Fixed 422 error in list repositories for the authenticated user [github] Fixed 422 error in list repositories for the authenticated user Mar 28, 2023
@kavin-kr
Copy link
Author

kavin-kr commented Mar 28, 2023

@augustuswm Can you take a look into this PR? This PR was opened a long ago.
If there are any changes needed, feel free to mention it, I'll do it

@eufelipemateus
Copy link

Same problem here.

@patrick-fitzgerald
Copy link

I'm running into this issue too e.g:

  let repos = github
      .repos()
      .list_all_for_authenticated_user(
          ReposListVisibility::All,
          "",
          ReposListType::Member,
          octorust::types::ReposListOrgSort::FullName,
          octorust::types::Order::Asc,
          None,
          None,
      )
      .await
      .unwrap() 
      .body;

Error:

Error HTTP Error. Code: 422 Unprocessable Entity, message: {"message":"If you specify visibility or affiliation, you cannot specify type.","documentation_url":"https://docs.github.com/rest/reference/repos#list-repositories-for-the-authenticated-user","status":"422"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants