oxidecomputer / third-party-api-clients

A place for keeping all our generated third party API clients.
https://docs.rs/octorust
MIT License
132 stars 55 forks source link

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

Open kavin-kr opened 2 years ago

kavin-kr commented 2 years ago

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 commented 2 years ago

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

kavin-kr commented 1 year ago

@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 commented 6 months ago

Same problem here.

patrick-fitzgerald commented 3 months ago

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"}