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

Bug: pull request simple field labels description schema incorrect #7

Closed
tisonkun opened this issue Nov 4, 2022 · 8 comments
Closed
Labels
bug Something isn't working Rest API schema schema related

Comments

@tisonkun
Copy link

tisonkun commented Nov 4, 2022

@yanyongyu There are still some other failures in the schema after #6 fixed. Let me show you the completed code snippet I used:

g = GitHub(TokenAuthStrategy(<My-Personal-Token>))
prs = g.paginate(g.rest.pulls.list, owner='apache', repo='pulsar', state='open')

origins = []
for pr in prs:
    pr: PullRequestSimple
    requested_reviewers = pr.requested_reviewers
    for reviewers in requested_reviewers:
        origins.append((reviewers.login, pr.html_url))

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: 58 validation errors for ParsingModel[List[githubkit.rest.models.PullRequestSimple]]
__root__ -> 37 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 38 -> labels -> 3 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 40 -> labels -> 3 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 41 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 42 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 43 -> labels -> 1 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 44 -> labels -> 5 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 45 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 46 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 47 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 48 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 49 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 50 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 51 -> labels -> 3 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 52 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 53 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 54 -> labels -> 3 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 55 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 56 -> labels -> 4 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 57 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 58 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 59 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 60 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 61 -> labels -> 1 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 62 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 63 -> labels -> 4 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 64 -> labels -> 3 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 65 -> labels -> 1 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 66 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 67 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 68 -> labels -> 3 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 69 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 70 -> labels -> 3 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 71 -> labels -> 3 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 72 -> labels -> 3 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 73 -> labels -> 3 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 74 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 75 -> labels -> 3 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 76 -> labels -> 3 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 77 -> labels -> 3 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 78 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 79 -> labels -> 4 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 80 -> labels -> 3 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 81 -> labels -> 3 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 82 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 83 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 84 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 85 -> labels -> 3 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 86 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 88 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 89 -> labels -> 1 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 90 -> labels -> 3 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 91 -> labels -> 1 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 92 -> labels -> 3 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 94 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 96 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 97 -> labels -> 2 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
__root__ -> 99 -> labels -> 1 -> description
  none is not an allowed value (type=type_error.none.not_allowed)
@tisonkun
Copy link
Author

tisonkun commented Nov 4, 2022

The first call to next(prs) passed but it seems further inputs cause other schema mismatch errors.

@yanyongyu yanyongyu added bug Something isn't working schema schema related Rest API labels Nov 4, 2022
@yanyongyu
Copy link
Owner

still a schema incorrect issue 😂

@yanyongyu yanyongyu changed the title Schema incorrect when listing pulls Bug: pull request simple field labels description schema incorrect Nov 4, 2022
@yanyongyu
Copy link
Owner

the Pull Request Simple schema is not up-to-date with the Pull Request schema...

@yanyongyu
Copy link
Owner

a newer version is published

@tisonkun
Copy link
Author

tisonkun commented Nov 5, 2022

Now it works well for me. Thank you!

@yanyongyu
Copy link
Owner

如果遇到新的schema问题欢迎提出(gh schema什么时候能correct

@tisonkun
Copy link
Author

tisonkun commented Nov 5, 2022

唐突中文 >_<

@yanyongyu
Copy link
Owner

唐突中文 >_<

看见了你的Twitter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Rest API schema schema related
Projects
None yet
Development

No branches or pull requests

2 participants