Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
node_modules/
output/
24 changes: 24 additions & 0 deletions extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@

This document describes the [OpenAPI extensions](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#specification-extensions) used in GitHub's REST API OpenAPI descriptions.

## `x-github-api-versions`

### Purpose

To specify the API versions supported by this OpenAPI description. GitHub's REST API uses calendar-based versioning (e.g., `2022-11-28`). Clients can use the `X-GitHub-Api-Version` header to request a specific version.

### Usage

This applies to the [Info Object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#infoObject).

The value should be an array of strings representing supported API version dates in `YYYY-MM-DD` format, sorted in descending order (newest first).

#### Example usage

```yml
info:
title: GitHub v3 REST API
version: 1.1.4
x-github-api-versions:
- "2022-11-28"
```

For more information about API versioning, see the [GitHub REST API documentation](https://docs.github.com/rest/about-the-rest-api/api-versions).

## `x-displayName`

### Purpose
Expand Down
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@
},
"license": "MIT",
"scripts": {
"lint": "eslint descriptions/**/*.json --ext .json"
"lint": "eslint descriptions/**/*.json --ext .json",
"build": "node scripts/build-versioned-bundles.js",
"build:versioned": "node scripts/build-versioned-bundles.js --output output/versioned",
"build:api.github.com": "node scripts/build-versioned-bundles.js --releases api.github.com",
"build:ghec": "node scripts/build-versioned-bundles.js --releases ghec",
"build:ghes": "node scripts/build-versioned-bundles.js --releases $(ls descriptions | grep ghes | tr '\\n' ',')"
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shell command substitution $(ls descriptions | grep ghes | tr '\n' ',') in the build:ghes script will result in a trailing comma (e.g., "ghes-3.16,ghes-3.17,"). While the script may handle this gracefully due to the .trim() operation on split results, it could lead to an empty string in the releases array. Consider trimming the trailing comma or handling empty strings in the releases array explicitly.

Suggested change
"build:ghes": "node scripts/build-versioned-bundles.js --releases $(ls descriptions | grep ghes | tr '\\n' ',')"
"build:ghes": "node scripts/build-versioned-bundles.js --releases $(ls descriptions | grep ghes | tr '\\n' ',' | sed 's/,$//')"

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build:ghes script uses shell commands (ls, grep, tr) that may not work correctly on Windows systems without a Unix-like shell (e.g., Git Bash, WSL). Consider documenting this limitation or providing a cross-platform alternative, such as a separate Node.js script to list GHES releases.

Copilot uses AI. Check for mistakes.
},
"eslintConfig": {
"extends": ["plugin:json/recommended"]
},
"devDependencies": {
"eslint": "^8.13.0",
"eslint-plugin-json": "^3.1.0"
"eslint-plugin-json": "^3.1.0",
"js-yaml": "^4.1.0"
}
}
Loading
Loading