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] "issue-simple" schema's "labels" items properties are defined as optional #112

Closed
gr2m opened this issue Dec 4, 2020 · 0 comments
Assignees

Comments

@gr2m
Copy link
Collaborator

gr2m commented Dec 4, 2020

Schema Inaccuracy

The labels item properties are all defined as optional in #/components/schemas/issue-simple

"issue-simple": {
  "title": "Issue Simple",
  "description": "Issue Simple",
  "type": "object",
  "properties": {
    ...
    "labels": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": { "type": "integer" },
          "node_id": { "type": "string" },
          "url": { "type": "string" },
          "name": { "type": "string" },
          "description": { "type": "string", "nullable": true },
          "color": { "type": "string" },
          "default": { "type": "boolean" }
        }
      }
    },
},

Expected

The should all be defined as required. I think that #/components/schemas/label has the correct schema already, so maybe the best change would be

"issue-simple": {
  "title": "Issue Simple",
  "description": "Issue Simple",
  "type": "object",
  "properties": {
    ...
    "labels": {
      "type": "array",
      "items": { "$ref": "#/components/schemas/label" }
    },
},

Reproduction Steps

curl https://api.github.com/repos/github/rest-api-description/issues/109 | jq '.labels'
[
  {
    "id": 2231940444,
    "node_id": "MDU6TGFiZWwyMjMxOTQwNDQ0",
    "url": "https://api.github.com/repos/github/rest-api-description/labels/Inaccuracy",
    "name": "Inaccuracy",
    "color": "f94050",
    "default": false,
    "description": ""
  }
]
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

2 participants