Skip to content

[Schema Inaccuracy] has_discussions field marked as mandatory but not returned in responses #2275

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

Open
dahpgjgamgan opened this issue Mar 4, 2023 · 0 comments
Labels

Comments

@dahpgjgamgan
Copy link

Schema Inaccuracy

disclaimer: I am neither an openapi nor an openapi-generator expert, and I'm interacting with github enterprise instance at my company, not 100% sure if the issue I'm facing really is a spec inaccuracy, but I thought this would be a good first step to ask before deciding to file the issue somewhere else)

An openapi-generator client generated from from https://github.com/github/rest-api-description/tree/main/descriptions/ghes-3.6 used to retrieve a pull_request fails on parsing the response "repo" field as it cannot find "has_discussions" inside (which is marked as required in the spec). The field is not found in the response obtained via curl leading me to believe this could be a schema inaccuracy

Expected

"repo" returned by pulls GET call should include has_discussions field, but does not.

Reproduction Steps


reproduction with curl

apologies for not showing the entire answer, but I hope this excerpt is enough

curl https://git-enterprise-host/.../org/repo/pulls/12345 -H "Authorization: token $GHE_TOKEN"  -H "Accept: application/vnd.github+json" 2>/dev/null  | grep -i has_
      "has_issues": true,
      "has_projects": true,
      "has_downloads": true,
      "has_wiki": true,
      "has_pages": false,
      "has_issues": true,
      "has_projects": true,
      "has_downloads": true,
      "has_wiki": true,
      "has_pages": false,

the schema at https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/ghes-3.6/ghes-3.6.json describes has_discussions field as required in the response, but it's missing


If one were to reproduce with an openapi-generator python client created as described in #2274 parsing the response would fail with:

E           ....exceptions.ApiTypeError: repo is missing 1 required argument: ['has_discussions']
@ahoglund ahoglund added the P3 label Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants