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 / Question] owner in #/components/schemas/repo-search-result-item/ and #/components/schemas/repository is nullable #440

Closed
gr2m opened this issue Jul 3, 2021 · 7 comments

Comments

@gr2m
Copy link
Collaborator

gr2m commented Jul 3, 2021

Schema Inaccuracy

Update: See comment below for #/components/schemas/repository

    repo-search-result-item:
      title: Repo Search Result Item
      description: Repo Search Result Item
      type: object
      properties:
        id:
          type: integer
        node_id:
          type: string
        name:
          type: string
        full_name:
          type: string
        owner:
          nullable: true
          allOf:
          - "$ref": "#/components/schemas/simple-user"
        # ...

Expected

I didn't expect it to be nullable. If it is for a good reason, can we add add a description explaining what the reason is?

ref octokit/types.ts#338

@creativecreatorormaybenot

To add to that, this must have been changed in the last few days. I sadly cannot figure out in which commit since the Git diff (on GitHub) does not seem to work properly with these raw files (and blame does not work at all).

@gr2m
Copy link
Collaborator Author

gr2m commented Jul 5, 2021

The same problem exists in #/components/schemas/repository which is much worse because it is used much more widely

    repository:
      title: Repository
      description: A git repository
      type: object
      properties:
        id:
          description: Unique identifier of the repository
          example: 42
          type: integer
        node_id:
          type: string
          example: MDEwOlJlcG9zaXRvcnkxMjk2MjY5
        # ...
        owner:
          nullable: true
          allOf:
          - "$ref": "#/components/schemas/simple-user"
        # ...

@gr2m gr2m changed the title [Schema Inaccuracy / Question] owner in #/components/schemas/repo-search-result-item/ is nullable [Schema Inaccuracy / Question] owner in #/components/schemas/repo-search-result-item/ and #/components/schemas/repository is nullable Jul 5, 2021
@xuorig
Copy link

xuorig commented Jul 12, 2021

Does not appear possible to be null on both repository and minimal-repository. Fix is incoming. It appears to have been this way since the launch of this description however. Thanks folks.

@creativecreatorormaybenot

Thank you so much @xuorig. It confuses me, however, because my CI started failing exactly with the Dependabot PR that updated the types at one point. I was also able to manually confirm this (my code had correct types with non-nullable owner before) 🤷

@gr2m
Copy link
Collaborator Author

gr2m commented Aug 3, 2021

Confirmed that it's fixed now, thanks @xuorig

@creativecreatorormaybenot @octokit/types should be updated within 10 minutes, the update is propagating right now

@gr2m
Copy link
Collaborator Author

gr2m commented Aug 3, 2021

@creativecreatorormaybenot there is another problem with the OpenAPI spec which can result in the owner property type to be optional. See the follow up at #486

@creativecreatorormaybenot

@gr2m thank you so much!

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