We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
sha
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
Reproduce steps:
github.rest.repos.compare_commits( owner="test", repo=""test, basehead="abcabcabcabc~1...abcabcabcabc" ).parsed_data
Fails with
---> ).parsed_data File [/usr/local/lib/python3.10/site-packages/githubkit/response.py:94](githubkit/response.py:94), in Response.parsed_data(self) [92](githubkit/response.py:92) @property [93](githubkit/response.py:93) def parsed_data(self) -> MT: ---> [94](githubkit/response.py:94) return type_validate_json(self._data_model, self.content) File [/usr/local/lib/python3.10/site-packages/githubkit/compat.py:43](githubkit/compat.py:43), in type_validate_json(type_, data) [42](githubkit/compat.py:42) def type_validate_json(type_: type[T], data: Any) -> T: ---> [43](githubkit/compat.py:43) return TypeAdapter(type_).validate_json(data) File [/usr/local/lib/python3.10/site-packages/pydantic/type_adapter.py:135](pydantic/type_adapter.py:135), in _frame_depth.<locals>.wrapper.<locals>.wrapped(self, *args, **kwargs) [132](pydantic/type_adapter.py:132) @wraps(func) [133](pydantic/type_adapter.py:133) def wrapped(self: TypeAdapterT, *args: P.args, **kwargs: P.kwargs) -> R: [134](pydantic/type_adapter.py:134) with self._with_frame_depth(depth + 1): # depth + 1 for the wrapper function --> [135](pydantic/type_adapter.py:135) return func(self, *args, **kwargs) File [/usr/local/lib/python3.10/site-packages/pydantic/type_adapter.py:384](pydantic/type_adapter.py:384), in TypeAdapter.validate_json(self, data, strict, context) [368](pydantic/type_adapter.py:368) @_frame_depth(1) [369](pydantic/type_adapter.py:369) def validate_json( [370](pydantic/type_adapter.py:370) self, data: str | bytes, [/](None = None, context: dict[str, Any] | None = None [371](pydantic/type_adapter.py:371) ) -> T: [372](pydantic/type_adapter.py:372) """Usage docs: https://docs.pydantic.dev/2.9/concepts/json/#json-parsing [373](pydantic/type_adapter.py:373) [374](pydantic/type_adapter.py:374) Validate a JSON string or bytes against the model. (...) [382](pydantic/type_adapter.py:382) The validated object. [383](pydantic/type_adapter.py:383) """ --> [384](pydantic/type_adapter.py:384) return self.validator.validate_json(data, strict=strict, context=context) ValidationError: 2 validation errors for CommitComparison files.literal[<UNSET>] Input should be <UNSET> [type=literal_error, input_value=[{'sha': 'abcabcabc...'}], input_type=list] For further information visit https://errors.pydantic.dev/2.9/v/literal_error files.list[DiffEntry].2.sha Input should be a valid string [type=string_type, input_value=None, input_type=NoneType] For further information visit https://errors.pydantic.dev/2.9/v/string_type
Tha main changes in the endpoint is that there's no SHA for the file change:
{'sha': None, <--- This is the issue 'filename': 'test.py', 'status': 'modified', 'additions': 0, 'deletions': 0, 'changes': 0, 'blob_url': '. . .', 'raw_url': '. . .', 'contents_url': '. . .' }
The text was updated successfully, but these errors were encountered:
The diff-entry object's sha field can be None. Could you please also report this to https://github.com/github/rest-api-description/? I will make a schema patch to fix this in githubkit.
diff-entry
None
Sorry, something went wrong.
created: github/rest-api-description#4652
@yanyongyu , I am new to rest-api-description. Feel free to add any details that I missed, thanks.
Successfully merging a pull request may close this issue.
Reproduce steps:
Fails with
Tha main changes in the endpoint is that there's no SHA for the file change:
The text was updated successfully, but these errors were encountered: