Repository navigation
Accept null values in Release, User, and License fields - #255
Merged
Merged
Conversation
GitHub's API description allows `null` for a release's `name`, `body`, and `published_at`, a user's `gravatar_id`, and a license's `url` and `spdx_id`. The converters read them as strings, so a response with null in any of them failed to convert, including any model that requires a user whose gravatar is null. These fields are now `(String | None)`; a release's `body` is also `None` when it is absent, since the schema doesn't require it. With `License.url` nullable, `Repository.license` no longer needs to turn a license that fails to convert into `None`. GitHub's "Other" license now comes through, and a malformed license fails the repository conversion, as the other optional nested objects already do. This covers the fields chosen in #250. That issue stays open for the other fields GitHub's schema marks nullable. Closes #233 Closes #235
This was referenced Dec 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub's API description allows
nullfor a release'sname,body,and
published_at, a user'sgravatar_id, and a license'surlandspdx_id. The converters read them as strings, so a response with nullin any of them failed to convert, including any model that requires a
user whose gravatar is null. These
fields are now
(String | None); a release'sbodyis alsoNonewhenit is absent, since the schema doesn't require it.
With
License.urlnullable,Repository.licenseno longer needs to turna license that fails to convert into
None. GitHub's "Other" license nowcomes through, and a malformed license fails the repository conversion,
as the other optional nested objects already do.
This covers the fields chosen in #250. That issue stays open for the
other fields GitHub's schema marks nullable.
Closes #233
Closes #235