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

Schema error when creating check run #148

Closed
fau-st opened this issue Oct 8, 2024 · 2 comments · Fixed by #149
Closed

Schema error when creating check run #148

fau-st opened this issue Oct 8, 2024 · 2 comments · Fixed by #149
Labels
bug Something isn't working Rest API schema schema related

Comments

@fau-st
Copy link
Contributor

fau-st commented Oct 8, 2024

Hello,

With version 0.11.12 it seems that creating a check run is no longer possible:

gh.rest.checks.create(
    owner='owner',
    repo='repo',
    name='name',
    head_sha='0000000000000000000000000000000000000000',
    status='in_progress',
)

⬇️

pydantic.errors.PydanticUserError: Model 'ReposOwnerRepoCheckRunsPostBodyOneof1' needs field 'status' to be of type `Literal`

It looks like it's related to the changes made to githubkit/versions/v2022_11_28/rest/checks.py but I'm not sure why it was modified.

@yanyongyu yanyongyu added bug Something isn't working schema schema related Rest API labels Oct 8, 2024
@yanyongyu
Copy link
Owner

This error is also caused by upstream schema changes. GitHub added a discriminator to this api's body description. The discriminator points to the status field, but one of the schema's status field is not required. This causes pydantic raises an error. A schema patch is needed to fix this.

@yanyongyu
Copy link
Owner

It seems this upstream schema change also caused another error. The status field's allowed value list is also overrided by the oneOf.

@yanyongyu yanyongyu changed the title Can't create check run with last version Schema error when creating check run Oct 8, 2024
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

Successfully merging a pull request may close this issue.

2 participants