XAMPPRocky / octocrab

A modern, extensible GitHub API Client for Rust.
Other
1.07k stars 261 forks source link

***BUG*** octocrab::users can not parse name=null users #648

Closed Kapple14 closed 3 months ago

Kapple14 commented 4 months ago

Hi! 👋

First, thanks a lot for creating this beautiful library. I am currently using it to create a small GitHub repository analyzer and receive this error for most of the fetched users:

image

Description

The error is raised due to a mismatch between the internal User struct and the API user reference. The name field is optional for GitHub users, but it is currently mandatory in the Octocrab library. This discrepancy leads to errors when processing users who do not have a name set in their GitHub profile.

Suggested Fix

Please make the name field optional in the User struct. This change would align the struct with the GitHub API documentation, which specifies that the name field is optional.

Reference:

For verification, please refer to the official GitHub API documentation: https://docs.github.com/en/rest/users/users?apiVersion=2022-11-28

maflcko commented 3 months ago

Please make the name field optional in the User struct. This change would align the struct with the GitHub API documentation, which specifies that the name field is optional.

If you have a fix ready, you can submit it as a pull request. After it passes review and CI, it can be merged.

Kapple14 commented 3 months ago

Created at: https://github.com/XAMPPRocky/octocrab/pull/650