Skip to content

[Schema Inaccuracy] pulls/list-files documents Markdown body fields absent from its response #7569

Backlog

Description

@nick-inkeep

Schema Inaccuracy

The List pull requests files endpoint describes four custom JSON media types that return body, body_text, or body_html. In the reproduction below, all four requested representations return an array of diff-entry objects with none of those fields.

This occurs on GitHub.com REST API versions 2022-11-28 and 2026-03-10. The operation description on main also promises these fields, although the 200 response schema references diff-entry. The same description appears in both calendar-version files and the OpenAPI 3.1 descriptions.

Expected

The operation description should accurately describe the representations returned by pulls/list-files.

Reproduction Steps

Run with Bash and jq. Repeat with version=2026-03-10 and per_page=76. Each URL is distinct to avoid cached variants, and the page sizes include both files.

version=2022-11-28
url=https://api.github.com/repos/cli/cli/pulls/15180/files
per_page=71
for accept in application/vnd.github+json application/vnd.github.{raw,text,html,full}+json; do
  curl -fsS -D >(awk 'tolower($0) ~ /^x-github-(api-version-selected|media-type):/ {print > "/dev/stderr"}') \
    -H "X-GitHub-Api-Version: $version" -H "Accept: $accept" \
    "$url?per_page=$per_page&page=1" |
    jq -c --arg accept "$accept" '{accept: $accept, files: length, body_fields: ([.[] | keys[] | select(. == "body" or . == "body_text" or . == "body_html")] | unique)}'
  per_page=$((per_page + 1))
done

All five requests return HTTP 200, two files, and body_fields: []. The selected API version and media-type response headers match each request. Parsed JSON is identical across all five Accept values in each run. On the same pull request, GET /repos/cli/cli/pulls/15180 with application/vnd.github.full+json returns all three body fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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