Skip to content

Bug: pull request simple field head.repo schema incorrect #6

Closed
@tisonkun

Description

@tisonkun
g = ... # obtain the client
prs = g.paginate(g.rest.pulls.list, owner='apache', repo='pulsar', state='open')
pr = next(prs)

gives:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/homebrew/lib/python3.10/site-packages/githubkit/paginator.py", line 76, in __next__
    contents = self._get_next_page()
  File "/opt/homebrew/lib/python3.10/site-packages/githubkit/paginator.py", line 112, in _get_next_page
    cast(Response[List[RT]], response).parsed_data
  File "/opt/homebrew/lib/python3.10/site-packages/githubkit/response.py", line 50, in parsed_data
    return parse_raw_as(self._data_model, self._response.content)
  File "pydantic/tools.py", line 82, in pydantic.tools.parse_raw_as
  File "pydantic/tools.py", line 38, in pydantic.tools.parse_obj_as
  File "pydantic/main.py", line 342, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 7 validation errors for ParsingModel[List[githubkit.rest.models.PullRequestSimple]]
__root__ -> 27 -> head -> repo
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 36 -> head -> repo
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 39 -> head -> repo
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 44 -> head -> repo
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 67 -> head -> repo
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 85 -> head -> repo
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 94 -> head -> repo
  none is not an allowed value (type=type_error.none.not_allowed)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Rest APIbugSomething isn't workingschemaschema related

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions