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

Create Check missing required properties in scripts/generated/endpoints.json #441

Closed
oscard0m opened this issue Sep 7, 2021 · 6 comments · Fixed by #694
Closed

Create Check missing required properties in scripts/generated/endpoints.json #441

oscard0m opened this issue Sep 7, 2021 · 6 comments · Fixed by #694
Assignees
Labels
released Type: Bug Something isn't working as documented typescript Relevant to TypeScript users only
Projects

Comments

@oscard0m
Copy link
Member

oscard0m commented Sep 7, 2021

What happened?
Expected required properties in documentation for create check run are missing:

  • name
  • head_sha

Instead a strange * property appears (scripts/update-endpoints/generated/endpoints.json Line 9888):

Click to expand!
  "parameters": [
    {
      "name": "owner",
      "description": "",
      "in": "PATH",
      "type": "string",
      "required": true,
      "enum": null,
      "allowNull": false,
      "mapToData": null,
      "validation": null,
      "alias": null,
      "deprecated": null
    },
    {
      "name": "repo",
      "description": "",
      "in": "PATH",
      "type": "string",
      "required": true,
      "enum": null,
      "allowNull": false,
      "mapToData": null,
      "validation": null,
      "alias": null,
      "deprecated": null
    },
    {
      "name": "status",
      "description": "",
      "in": "BODY",
      "type": null,
      "required": false,
      "enum": ["queued", "in_progress"],
      "allowNull": false,
      "mapToData": null,
      "validation": null,
      "alias": null,
      "deprecated": null
    },
    {
      "name": "*",
      "description": "",
      "in": "BODY",
      "type": "object",
      "required": false,
      "enum": null,
      "allowNull": false,
      "mapToData": null,
      "validation": null,
      "alias": null,
      "deprecated": null
    }
  ]

What did you expect to happen?
To get missing name and head_sha required properties when running npm run update-endpoints:fetch-json

What the problem might be
github-openapi-graphql-query lib is returning wrong info probably. Opened issue in that project: gr2m/github-openapi-graphql-query#11

@gr2m
Copy link
Contributor

gr2m commented Sep 13, 2021

I tried to reproduce the problems with @octokit/types, but no luck:
playground

image

However when using the REST API endpoint method .checks.create() no parameters seem to be required at all, or suggested by the TS IntelliSense

playground

image

The problem seems indeed to be with @octokit/plugin-rest-endpoint-methods playground

image

I guess you got that far yourself :) I'll have a look why that is and if it's related to the problem you reported at gr2m/github-openapi-graphql-query#11

@gr2m gr2m added the typescript Relevant to TypeScript users only label Sep 13, 2021
@gr2m
Copy link
Contributor

gr2m commented Sep 13, 2021

It looks like a problem with Omit and Endpoints["POST /repos/{owner}/{repo}/check-runs"]["parameters"]:
playground

image

Any idea what it could be? I have to move on for today but will try to look more into it on Wednesday

@oscard0m
Copy link
Member Author

It looks like a problem with Omit and Endpoints["POST /repos/{owner}/{repo}/check-runs"]["parameters"]:
playground

image

Any idea what it could be? I have to move on for today but will try to look more into it on Wednesday

Buf, no idea. I guess we are doing something crazy with this chain of types and an Omit is not able to infer the "omission". I will try to take a look this week too. Thanks for taking the time on checking this and arriving that far :)

@wolfy1339
Copy link
Member

Is there any update to this issue, or is it no longer a problem?

@wolfy1339
Copy link
Member

As for the parameters missing from the scripts/update-endpoints/generated/endpoints.json file, that doesn't seem to apply any more. They seem to be present now.

For the types issue that should be resolved by #694

Copy link
Contributor

🎉 This issue has been resolved in version 10.1.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Type: Bug Something isn't working as documented typescript Relevant to TypeScript users only
Projects
Archived in project
JS
  
In progress
3 participants