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

fix(emails): visibility can be null #756

Merged
merged 1 commit into from
Mar 24, 2025

Conversation

dndx
Copy link
Contributor

@dndx dndx commented Mar 10, 2025

According to the /user/emails schema, the visibility field in the response can be null. The UserEmailInfo made it mandatory, causing deserialization failures during requests against real GitHub APIs like this:

invalid type: null, expected string or map

According to the [`/user/emails` schema](https://docs.github.com/en/rest/users/emails?apiVersion=2022-11-28#list-email-addresses-for-the-authenticated-user),
the `visibility` field in the response can be `null`. The
`UserEmailInfo` made it mandatory, causing deserialization failures
during requests against real GitHub APIs like this:

```
invalid type: null, expected string or map
```
@dndx dndx force-pushed the fix/visibility_optional branch from 234c7f8 to e868271 Compare March 10, 2025 04:55
@omarabid
Copy link
Contributor

@dndx This caught me by surprise and wasted me a good couple hours. Interestingly, this should always (?) fail because the no-reply email generated by github (I assume for all users?) has null for visibility.

@XAMPPRocky
Copy link
Owner

Thank you for your PR, and congrats on your first contribution! 🎉

@XAMPPRocky XAMPPRocky merged commit 31f625d into XAMPPRocky:main Mar 24, 2025
20 checks passed
@github-actions github-actions bot mentioned this pull request Mar 24, 2025
@dndx dndx deleted the fix/visibility_optional branch March 24, 2025 09:07
@github-actions github-actions bot mentioned this pull request Mar 26, 2025
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