Skip to content

[Schema Inaccuracy] labels property in the pull-request-simple schema should not have optional properties #169

@wolfy1339

Description

@wolfy1339

Schema Inaccuracy

In the pull-request-simple and the pull-request schemas, the label property which is an object, has all of it's properties marked as optional.

Expected

The labels property on the pull-request-simple and pull-request schema should have all it's properties set as required.

"pull-request-simple": {
        "title": "Pull Request Simple",
        "description": "Pull Request Simple",
        "type": "object",
        "properties": {
...
          "labels": {
            "type": "array",
            "items": {
              "type": "object",
+             "required": ["id", "node_id", "url", "name", "description", "color", "default"],
              "properties": {
                "id": {
                  "type": "integer"
                },
                "node_id": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "color": {
                  "type": "string"
                },
                "default": {
                  "type": "boolean"
                }
              }
            }
...
      "pull-request": {
        "type": "object",
        "title": "Pull Request",
        "description": "Pull requests let you tell others about changes you've pushed to a repository on GitHub. Once a pull request is sent, interested parties can review the set of changes, discuss potential modifications, and even push follow-up commits if necessary.",
        "properties": {
...
          "labels": {
            "type": "array",
            "items": {
              "type": "object",
+             "required": ["id", "node_id", "url", "name", "description", "color", "default"],
              "properties": {
                "id": {
                  "type": "integer"
                },
                "node_id": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "color": {
                  "type": "string"
                },
                "default": {
                  "type": "boolean"
                }
              }
            }

Reproduction Steps

This issue isn't reproducible on the API, it only comes up with downstream consumers of the OpenAPI schema, example, when TypeScript types are generated from this schema in @octokit/openapi-types

/ref octokit/openapi-types.ts#21
/cc @christophehurpeau

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions