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 Inaccuracy] owner property in the full-repository schema should not be nullable #270

Closed
wolfy1339 opened this issue Apr 18, 2021 · 4 comments

Comments

@wolfy1339
Copy link

wolfy1339 commented Apr 18, 2021

Schema Inaccuracy

On the schema, located at components['schemas']['full-repository'], the value of owner can be null. However, a repo has to be owned, so null shouldn't be here.

Expected

owner should be only an object (components['schemas']['simple-user']), not an object or null

"full-repository": {
        "title": "Full Repository",
        "description": "Full Repository",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "example": 1296269
          },
...
          "full_name": {
            "type": "string",
            "example": "octocat/Hello-World"
          },
          "owner": {
-           "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/simple-user"
              }
            ]
          },
          "private": {
            "type": "boolean"
          },
...
    }

Reproduction Steps

$ curl -X POST https://api.github.com/repos/{owner}/{repository}

This issue manifests itself in downstream consumers of the OpenAPI schema, example, when TypeScript types are generated from this schema in @octokit/openapi-types

/ref octokit/rest.js#2074

@gr2m
Copy link
Collaborator

gr2m commented Apr 18, 2021

@xuorig @imwiss This is blocking octokit/rest.js#38. Could you please look into it?

@imwiss
Copy link
Contributor

imwiss commented Apr 19, 2021

👋 @wolfy1339 @gr2m we're looking into this, thanks for flagging

@xuorig
Copy link

xuorig commented Aug 5, 2021

This has been fixed!

@xuorig xuorig closed this as completed Aug 5, 2021
@gr2m
Copy link
Collaborator

gr2m commented Aug 5, 2021

I created a follow up issue about the referenced simple-user schema, which still has nullable: true
#486

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants