Skip to content

Get Issue Labels description is nullable, while the docs say it is required #18857

@OmarTawfik

Description

@OmarTawfik

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/rest/issues/labels

What part(s) of the article would you like to see updated?

JSON Schema (and perhapes the examples) of the affected endpoints, including getting labels, creating labels, and adding labels to issues.

Additional information

You can repro this by making a request to add a label to an issue/PR. If the label doesn't exist, it will be created as well, which is really helpful for users. But it is created with a null description, and in the response, description is returned as null, which is not what the API declares. The field should be declared nullable in the API description.

Repro:

curl \
  -X POST \
  -H "Accept: application/vnd.github.v3+json" \ 
  -H "Authorization: token <TOKEN>" \
  https://api.github.com/repos/OWNER/REPO/issues/ISSUE_NUMBER/labels \
  -d '{"labels":["app-name/new-label"]}'
[
  {
    "id": 9999999999,
    "node_id": "Some_ID_String",
    "url": "https://api.github.com/repos/OWNER/REPO/labels/app-name/new-label",
    "name": "app-name/new-label",
    "color": "ededed",
    "default": false,
    "description": null           // <----- null, as the repo owner has not set one yet.
  }
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    contentThis issue or pull request belongs to the Docs Content teamtriageDo not begin working on this issue until triaged by the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions