Skip to content

[Schema Inaccuracy] GET /repos/{owner}/{repo}/contents/{path} spec is missing raw+json / html+json response media types #6089

@rahulsom

Description

@rahulsom

Schema Inaccuracy

The Get repository content docs list these custom media types for that path, but the structured schema doesn't have them:

  • application/vnd.github.raw+json – Returns the raw file contents for files and symlinks.
  • application/vnd.github.html+json – Returns the file contents in HTML (e.g. via GitHub's Markup library).

The description currently only includes application/json and application/vnd.github.object for the 200 response.

Expected

{
  "paths": {
    "/repos/{owner}/{repo}/contents/{path}": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": { "...": "..." },
              "application/vnd.github.object": { "...": "..." },
              "application/vnd.github.raw+json": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/vnd.github.html+json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}

Reproduction Steps

This applies to all variants:

  • fpt
  • ghec
  • ghes-*

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions