Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
Open
@dahpgjgamgan

Description

@dahpgjgamgan
Issue body actions

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']

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.