From 01edded712e94fae1bd8dac78ab1e97e229c9a9a Mon Sep 17 00:00:00 2001 From: jman420 Date: Mon, 4 Sep 2023 22:17:32 -0400 Subject: [PATCH 1/3] Add override for /app/installations/ response for account property to be an allOf list instead of anyOf --- .../get-app-installations.deref.json | 842 ++++++++++++++++++ scripts/overrides/get-app-installations.json | 769 ++++++++++++++++ scripts/overrides/index.mjs | 16 + 3 files changed, 1627 insertions(+) create mode 100644 scripts/overrides/get-app-installations.deref.json create mode 100644 scripts/overrides/get-app-installations.json diff --git a/scripts/overrides/get-app-installations.deref.json b/scripts/overrides/get-app-installations.deref.json new file mode 100644 index 000000000..ba029c7b6 --- /dev/null +++ b/scripts/overrides/get-app-installations.deref.json @@ -0,0 +1,842 @@ +{ + "summary": "List installations for the authenticated app", + "description": "You must use a [JWT](https://docs.github.com/enterprise-server@3.9/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\n\nThe permissions the installation has are included under the `permissions` key.", + "tags": [ + "apps" + ], + "operationId": "apps/list-installations", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-server@3.9/rest/apps/apps#list-installations-for-the-authenticated-app" + }, + "parameters": [ + { + "name": "per_page", + "description": "The number of results per page (max 100).", + "in": "query", + "schema": { + "type": "integer", + "default": 30 + } + }, + { + "name": "page", + "description": "Page number of the results to fetch.", + "in": "query", + "schema": { + "type": "integer", + "default": 1 + } + }, + { + "name": "since", + "description": "Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "outdated", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The permissions the installation has are included under the `permissions` key.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "title": "Installation", + "description": "Installation", + "type": "object", + "properties": { + "id": { + "description": "The ID of the installation.", + "type": "integer", + "example": 1 + }, + "account": { + "nullable": true, + "allOf": [ + { + "title": "Simple User", + "description": "A GitHub user.", + "type": "object", + "properties": { + "name": { + "nullable": true, + "type": "string" + }, + "email": { + "nullable": true, + "type": "string" + }, + "login": { + "type": "string", + "example": "octocat" + }, + "id": { + "type": "integer", + "example": 1 + }, + "node_id": { + "type": "string", + "example": "MDQ6VXNlcjE=" + }, + "avatar_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/images/error/octocat_happy.gif" + }, + "gravatar_id": { + "type": "string", + "example": "41d064eb2195891e12d0413f63227ea7", + "nullable": true + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat" + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/octocat" + }, + "followers_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/followers" + }, + "following_url": { + "type": "string", + "example": "https://api.github.com/users/octocat/following{/other_user}" + }, + "gists_url": { + "type": "string", + "example": "https://api.github.com/users/octocat/gists{/gist_id}" + }, + "starred_url": { + "type": "string", + "example": "https://api.github.com/users/octocat/starred{/owner}{/repo}" + }, + "subscriptions_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/subscriptions" + }, + "organizations_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/orgs" + }, + "repos_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/repos" + }, + "events_url": { + "type": "string", + "example": "https://api.github.com/users/octocat/events{/privacy}" + }, + "received_events_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/received_events" + }, + "type": { + "type": "string", + "example": "User" + }, + "site_admin": { + "type": "boolean" + }, + "starred_at": { + "type": "string", + "example": "\"2020-07-09T00:17:55Z\"" + } + }, + "required": [ + "avatar_url", + "events_url", + "followers_url", + "following_url", + "gists_url", + "gravatar_id", + "html_url", + "id", + "node_id", + "login", + "organizations_url", + "received_events_url", + "repos_url", + "site_admin", + "starred_url", + "subscriptions_url", + "type", + "url" + ] + }, + { + "title": "Enterprise", + "description": "An enterprise on GitHub.", + "type": "object", + "properties": { + "description": { + "description": "A short description of the enterprise.", + "type": "string", + "nullable": true + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/enterprises/octo-business" + }, + "website_url": { + "description": "The enterprise's website URL.", + "type": "string", + "nullable": true, + "format": "uri" + }, + "id": { + "description": "Unique identifier of the enterprise", + "example": 42, + "type": "integer" + }, + "node_id": { + "type": "string", + "example": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5" + }, + "name": { + "description": "The name of the enterprise.", + "type": "string", + "example": "Octo Business" + }, + "slug": { + "description": "The slug url identifier for the enterprise.", + "type": "string", + "example": "octo-business" + }, + "created_at": { + "type": "string", + "nullable": true, + "format": "date-time", + "example": "2019-01-26T19:01:12Z" + }, + "updated_at": { + "type": "string", + "nullable": true, + "format": "date-time", + "example": "2019-01-26T19:14:43Z" + }, + "avatar_url": { + "type": "string", + "format": "uri" + } + }, + "required": [ + "id", + "node_id", + "name", + "slug", + "html_url", + "created_at", + "updated_at", + "avatar_url" + ] + } + ] + }, + "repository_selection": { + "description": "Describe whether all repositories have been selected or there's a selection involved", + "type": "string", + "enum": [ + "all", + "selected" + ] + }, + "access_tokens_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/installations/1/access_tokens" + }, + "repositories_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/installation/repositories" + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/organizations/github/settings/installations/1" + }, + "app_id": { + "type": "integer", + "example": 1 + }, + "target_id": { + "description": "The ID of the user or organization this token is being scoped to.", + "type": "integer" + }, + "target_type": { + "type": "string", + "example": "Organization" + }, + "permissions": { + "title": "App Permissions", + "type": "object", + "description": "The permissions granted to the user access token.", + "properties": { + "actions": { + "type": "string", + "description": "The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts.", + "enum": [ + "read", + "write" + ] + }, + "administration": { + "type": "string", + "description": "The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation.", + "enum": [ + "read", + "write" + ] + }, + "checks": { + "type": "string", + "description": "The level of permission to grant the access token for checks on code.", + "enum": [ + "read", + "write" + ] + }, + "contents": { + "type": "string", + "description": "The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges.", + "enum": [ + "read", + "write" + ] + }, + "deployments": { + "type": "string", + "description": "The level of permission to grant the access token for deployments and deployment statuses.", + "enum": [ + "read", + "write" + ] + }, + "environments": { + "type": "string", + "description": "The level of permission to grant the access token for managing repository environments.", + "enum": [ + "read", + "write" + ] + }, + "issues": { + "type": "string", + "description": "The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones.", + "enum": [ + "read", + "write" + ] + }, + "metadata": { + "type": "string", + "description": "The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata.", + "enum": [ + "read", + "write" + ] + }, + "packages": { + "type": "string", + "description": "The level of permission to grant the access token for packages published to GitHub Packages.", + "enum": [ + "read", + "write" + ] + }, + "pages": { + "type": "string", + "description": "The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds.", + "enum": [ + "read", + "write" + ] + }, + "pull_requests": { + "type": "string", + "description": "The level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges.", + "enum": [ + "read", + "write" + ] + }, + "repository_hooks": { + "type": "string", + "description": "The level of permission to grant the access token to manage the post-receive hooks for a repository.", + "enum": [ + "read", + "write" + ] + }, + "repository_projects": { + "type": "string", + "description": "The level of permission to grant the access token to manage repository projects, columns, and cards.", + "enum": [ + "read", + "write", + "admin" + ] + }, + "secret_scanning_alerts": { + "type": "string", + "description": "The level of permission to grant the access token to view and manage secret scanning alerts.", + "enum": [ + "read", + "write" + ] + }, + "secrets": { + "type": "string", + "description": "The level of permission to grant the access token to manage repository secrets.", + "enum": [ + "read", + "write" + ] + }, + "security_events": { + "type": "string", + "description": "The level of permission to grant the access token to view and manage security events like code scanning alerts.", + "enum": [ + "read", + "write" + ] + }, + "single_file": { + "type": "string", + "description": "The level of permission to grant the access token to manage just a single file.", + "enum": [ + "read", + "write" + ] + }, + "statuses": { + "type": "string", + "description": "The level of permission to grant the access token for commit statuses.", + "enum": [ + "read", + "write" + ] + }, + "vulnerability_alerts": { + "type": "string", + "description": "The level of permission to grant the access token to manage Dependabot alerts.", + "enum": [ + "read", + "write" + ] + }, + "workflows": { + "type": "string", + "description": "The level of permission to grant the access token to update GitHub Actions workflow files.", + "enum": [ + "write" + ] + }, + "members": { + "type": "string", + "description": "The level of permission to grant the access token for organization teams and members.", + "enum": [ + "read", + "write" + ] + }, + "organization_administration": { + "type": "string", + "description": "The level of permission to grant the access token to manage access to an organization.", + "enum": [ + "read", + "write" + ] + }, + "organization_custom_roles": { + "type": "string", + "description": "The level of permission to grant the access token for custom repository roles management. This property is in beta and is subject to change.", + "enum": [ + "read", + "write" + ] + }, + "organization_announcement_banners": { + "type": "string", + "description": "The level of permission to grant the access token to view and manage announcement banners for an organization.", + "enum": [ + "read", + "write" + ] + }, + "organization_hooks": { + "type": "string", + "description": "The level of permission to grant the access token to manage the post-receive hooks for an organization.", + "enum": [ + "read", + "write" + ] + }, + "organization_personal_access_tokens": { + "type": "string", + "description": "The level of permission to grant the access token for viewing and managing fine-grained personal access token requests to an organization.", + "enum": [ + "read", + "write" + ] + }, + "organization_personal_access_token_requests": { + "type": "string", + "description": "The level of permission to grant the access token for viewing and managing fine-grained personal access tokens that have been approved by an organization.", + "enum": [ + "read", + "write" + ] + }, + "organization_plan": { + "type": "string", + "description": "The level of permission to grant the access token for viewing an organization's plan.", + "enum": [ + "read" + ] + }, + "organization_projects": { + "type": "string", + "description": "The level of permission to grant the access token to manage organization projects and projects beta (where available).", + "enum": [ + "read", + "write", + "admin" + ] + }, + "organization_packages": { + "type": "string", + "description": "The level of permission to grant the access token for organization packages published to GitHub Packages.", + "enum": [ + "read", + "write" + ] + }, + "organization_secrets": { + "type": "string", + "description": "The level of permission to grant the access token to manage organization secrets.", + "enum": [ + "read", + "write" + ] + }, + "organization_self_hosted_runners": { + "type": "string", + "description": "The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization.", + "enum": [ + "read", + "write" + ] + }, + "organization_user_blocking": { + "type": "string", + "description": "The level of permission to grant the access token to view and manage users blocked by the organization.", + "enum": [ + "read", + "write" + ] + }, + "team_discussions": { + "type": "string", + "description": "The level of permission to grant the access token to manage team discussions and related comments.", + "enum": [ + "read", + "write" + ] + } + }, + "example": { + "contents": "read", + "issues": "read", + "deployments": "write", + "single_file": "read" + } + }, + "events": { + "type": "array", + "items": { + "type": "string" + } + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "single_file_name": { + "type": "string", + "example": "config.yaml", + "nullable": true + }, + "has_multiple_single_files": { + "type": "boolean", + "example": true + }, + "single_file_paths": { + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "config.yml", + ".github/issue_TEMPLATE.md" + ] + }, + "app_slug": { + "type": "string", + "example": "github-actions" + }, + "suspended_by": { + "title": "Simple User", + "description": "A GitHub user.", + "type": "object", + "properties": { + "name": { + "nullable": true, + "type": "string" + }, + "email": { + "nullable": true, + "type": "string" + }, + "login": { + "type": "string", + "example": "octocat" + }, + "id": { + "type": "integer", + "example": 1 + }, + "node_id": { + "type": "string", + "example": "MDQ6VXNlcjE=" + }, + "avatar_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/images/error/octocat_happy.gif" + }, + "gravatar_id": { + "type": "string", + "example": "41d064eb2195891e12d0413f63227ea7", + "nullable": true + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat" + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/octocat" + }, + "followers_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/followers" + }, + "following_url": { + "type": "string", + "example": "https://api.github.com/users/octocat/following{/other_user}" + }, + "gists_url": { + "type": "string", + "example": "https://api.github.com/users/octocat/gists{/gist_id}" + }, + "starred_url": { + "type": "string", + "example": "https://api.github.com/users/octocat/starred{/owner}{/repo}" + }, + "subscriptions_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/subscriptions" + }, + "organizations_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/orgs" + }, + "repos_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/repos" + }, + "events_url": { + "type": "string", + "example": "https://api.github.com/users/octocat/events{/privacy}" + }, + "received_events_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/received_events" + }, + "type": { + "type": "string", + "example": "User" + }, + "site_admin": { + "type": "boolean" + }, + "starred_at": { + "type": "string", + "example": "\"2020-07-09T00:17:55Z\"" + } + }, + "required": [ + "avatar_url", + "events_url", + "followers_url", + "following_url", + "gists_url", + "gravatar_id", + "html_url", + "id", + "node_id", + "login", + "organizations_url", + "received_events_url", + "repos_url", + "site_admin", + "starred_url", + "subscriptions_url", + "type", + "url" + ], + "nullable": true + }, + "suspended_at": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "contact_email": { + "type": "string", + "example": "\"test_13f1e99741e3e004@d7e1eb0bc0a1ba12.com\"", + "nullable": true + } + }, + "required": [ + "id", + "app_id", + "app_slug", + "target_id", + "target_type", + "single_file_name", + "repository_selection", + "access_tokens_url", + "html_url", + "repositories_url", + "events", + "account", + "permissions", + "created_at", + "updated_at", + "suspended_by", + "suspended_at" + ] + } + }, + "examples": { + "default": { + "value": [ + { + "id": 1, + "account": { + "login": "octocat", + "id": 1, + "node_id": "MDQ6VXNlcjE=", + "avatar_url": "https://github.com/images/error/octocat_happy.gif", + "gravatar_id": "", + "url": "https://api.github.com/users/octocat", + "html_url": "https://github.com/octocat", + "followers_url": "https://api.github.com/users/octocat/followers", + "following_url": "https://api.github.com/users/octocat/following{/other_user}", + "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", + "organizations_url": "https://api.github.com/users/octocat/orgs", + "repos_url": "https://api.github.com/users/octocat/repos", + "events_url": "https://api.github.com/users/octocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/octocat/received_events", + "type": "User", + "site_admin": false + }, + "access_tokens_url": "https://api.github.com/installations/1/access_tokens", + "repositories_url": "https://api.github.com/installation/repositories", + "html_url": "https://github.com/organizations/github/settings/installations/1", + "app_id": 1, + "target_id": 1, + "target_type": "Organization", + "permissions": { + "checks": "write", + "metadata": "read", + "contents": "read" + }, + "events": [ + "push", + "pull_request" + ], + "single_file_name": "config.yaml", + "has_multiple_single_files": true, + "single_file_paths": [ + "config.yml", + ".github/issue_TEMPLATE.md" + ], + "repository_selection": "selected", + "created_at": "2017-07-08T16:18:44-04:00", + "updated_at": "2017-07-08T16:18:44-04:00", + "app_slug": "github-actions", + "suspended_at": null, + "suspended_by": null + } + ] + } + } + } + }, + "headers": { + "Link": { + "example": "; rel=\"next\", ; rel=\"last\"", + "schema": { + "type": "string" + } + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": true, + "category": "apps", + "subcategory": "apps" + } +} \ No newline at end of file diff --git a/scripts/overrides/get-app-installations.json b/scripts/overrides/get-app-installations.json new file mode 100644 index 000000000..787c70bd7 --- /dev/null +++ b/scripts/overrides/get-app-installations.json @@ -0,0 +1,769 @@ +{ + "summary": "List installations for the authenticated app", + "description": "You must use a [JWT](https://docs.github.com/enterprise-server@3.9/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\n\nThe permissions the installation has are included under the `permissions` key.", + "tags": [ + "apps" + ], + "operationId": "apps/list-installations", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-server@3.9/rest/apps/apps#list-installations-for-the-authenticated-app" + }, + "parameters": [ + { + "$ref": "#/components/parameters/per-page" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/since" + }, + { + "name": "outdated", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The permissions the installation has are included under the `permissions` key.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "title": "Installation", + "description": "Installation", + "type": "object", + "properties": { + "id": { + "description": "The ID of the installation.", + "type": "integer", + "example": 1 + }, + "account": { + "nullable": true, + "allOf": [ + { + "title": "Simple User", + "description": "A GitHub user.", + "type": "object", + "properties": { + "name": { + "nullable": true, + "type": "string" + }, + "email": { + "nullable": true, + "type": "string" + }, + "login": { + "type": "string", + "example": "octocat" + }, + "id": { + "type": "integer", + "example": 1 + }, + "node_id": { + "type": "string", + "example": "MDQ6VXNlcjE=" + }, + "avatar_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/images/error/octocat_happy.gif" + }, + "gravatar_id": { + "type": "string", + "example": "41d064eb2195891e12d0413f63227ea7", + "nullable": true + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat" + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/octocat" + }, + "followers_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/followers" + }, + "following_url": { + "type": "string", + "example": "https://api.github.com/users/octocat/following{/other_user}" + }, + "gists_url": { + "type": "string", + "example": "https://api.github.com/users/octocat/gists{/gist_id}" + }, + "starred_url": { + "type": "string", + "example": "https://api.github.com/users/octocat/starred{/owner}{/repo}" + }, + "subscriptions_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/subscriptions" + }, + "organizations_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/orgs" + }, + "repos_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/repos" + }, + "events_url": { + "type": "string", + "example": "https://api.github.com/users/octocat/events{/privacy}" + }, + "received_events_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/received_events" + }, + "type": { + "type": "string", + "example": "User" + }, + "site_admin": { + "type": "boolean" + }, + "starred_at": { + "type": "string", + "example": "\"2020-07-09T00:17:55Z\"" + } + }, + "required": [ + "avatar_url", + "events_url", + "followers_url", + "following_url", + "gists_url", + "gravatar_id", + "html_url", + "id", + "node_id", + "login", + "organizations_url", + "received_events_url", + "repos_url", + "site_admin", + "starred_url", + "subscriptions_url", + "type", + "url" + ] + }, + { + "title": "Enterprise", + "description": "An enterprise on GitHub.", + "type": "object", + "properties": { + "description": { + "description": "A short description of the enterprise.", + "type": "string", + "nullable": true + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/enterprises/octo-business" + }, + "website_url": { + "description": "The enterprise's website URL.", + "type": "string", + "nullable": true, + "format": "uri" + }, + "id": { + "description": "Unique identifier of the enterprise", + "example": 42, + "type": "integer" + }, + "node_id": { + "type": "string", + "example": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5" + }, + "name": { + "description": "The name of the enterprise.", + "type": "string", + "example": "Octo Business" + }, + "slug": { + "description": "The slug url identifier for the enterprise.", + "type": "string", + "example": "octo-business" + }, + "created_at": { + "type": "string", + "nullable": true, + "format": "date-time", + "example": "2019-01-26T19:01:12Z" + }, + "updated_at": { + "type": "string", + "nullable": true, + "format": "date-time", + "example": "2019-01-26T19:14:43Z" + }, + "avatar_url": { + "type": "string", + "format": "uri" + } + }, + "required": [ + "id", + "node_id", + "name", + "slug", + "html_url", + "created_at", + "updated_at", + "avatar_url" + ] + } + ] + }, + "repository_selection": { + "description": "Describe whether all repositories have been selected or there's a selection involved", + "type": "string", + "enum": [ + "all", + "selected" + ] + }, + "access_tokens_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/installations/1/access_tokens" + }, + "repositories_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/installation/repositories" + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/organizations/github/settings/installations/1" + }, + "app_id": { + "type": "integer", + "example": 1 + }, + "target_id": { + "description": "The ID of the user or organization this token is being scoped to.", + "type": "integer" + }, + "target_type": { + "type": "string", + "example": "Organization" + }, + "permissions": { + "title": "App Permissions", + "type": "object", + "description": "The permissions granted to the user access token.", + "properties": { + "actions": { + "type": "string", + "description": "The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts.", + "enum": [ + "read", + "write" + ] + }, + "administration": { + "type": "string", + "description": "The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation.", + "enum": [ + "read", + "write" + ] + }, + "checks": { + "type": "string", + "description": "The level of permission to grant the access token for checks on code.", + "enum": [ + "read", + "write" + ] + }, + "contents": { + "type": "string", + "description": "The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges.", + "enum": [ + "read", + "write" + ] + }, + "deployments": { + "type": "string", + "description": "The level of permission to grant the access token for deployments and deployment statuses.", + "enum": [ + "read", + "write" + ] + }, + "environments": { + "type": "string", + "description": "The level of permission to grant the access token for managing repository environments.", + "enum": [ + "read", + "write" + ] + }, + "issues": { + "type": "string", + "description": "The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones.", + "enum": [ + "read", + "write" + ] + }, + "metadata": { + "type": "string", + "description": "The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata.", + "enum": [ + "read", + "write" + ] + }, + "packages": { + "type": "string", + "description": "The level of permission to grant the access token for packages published to GitHub Packages.", + "enum": [ + "read", + "write" + ] + }, + "pages": { + "type": "string", + "description": "The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds.", + "enum": [ + "read", + "write" + ] + }, + "pull_requests": { + "type": "string", + "description": "The level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges.", + "enum": [ + "read", + "write" + ] + }, + "repository_hooks": { + "type": "string", + "description": "The level of permission to grant the access token to manage the post-receive hooks for a repository.", + "enum": [ + "read", + "write" + ] + }, + "repository_projects": { + "type": "string", + "description": "The level of permission to grant the access token to manage repository projects, columns, and cards.", + "enum": [ + "read", + "write", + "admin" + ] + }, + "secret_scanning_alerts": { + "type": "string", + "description": "The level of permission to grant the access token to view and manage secret scanning alerts.", + "enum": [ + "read", + "write" + ] + }, + "secrets": { + "type": "string", + "description": "The level of permission to grant the access token to manage repository secrets.", + "enum": [ + "read", + "write" + ] + }, + "security_events": { + "type": "string", + "description": "The level of permission to grant the access token to view and manage security events like code scanning alerts.", + "enum": [ + "read", + "write" + ] + }, + "single_file": { + "type": "string", + "description": "The level of permission to grant the access token to manage just a single file.", + "enum": [ + "read", + "write" + ] + }, + "statuses": { + "type": "string", + "description": "The level of permission to grant the access token for commit statuses.", + "enum": [ + "read", + "write" + ] + }, + "vulnerability_alerts": { + "type": "string", + "description": "The level of permission to grant the access token to manage Dependabot alerts.", + "enum": [ + "read", + "write" + ] + }, + "workflows": { + "type": "string", + "description": "The level of permission to grant the access token to update GitHub Actions workflow files.", + "enum": [ + "write" + ] + }, + "members": { + "type": "string", + "description": "The level of permission to grant the access token for organization teams and members.", + "enum": [ + "read", + "write" + ] + }, + "organization_administration": { + "type": "string", + "description": "The level of permission to grant the access token to manage access to an organization.", + "enum": [ + "read", + "write" + ] + }, + "organization_custom_roles": { + "type": "string", + "description": "The level of permission to grant the access token for custom repository roles management. This property is in beta and is subject to change.", + "enum": [ + "read", + "write" + ] + }, + "organization_announcement_banners": { + "type": "string", + "description": "The level of permission to grant the access token to view and manage announcement banners for an organization.", + "enum": [ + "read", + "write" + ] + }, + "organization_hooks": { + "type": "string", + "description": "The level of permission to grant the access token to manage the post-receive hooks for an organization.", + "enum": [ + "read", + "write" + ] + }, + "organization_personal_access_tokens": { + "type": "string", + "description": "The level of permission to grant the access token for viewing and managing fine-grained personal access token requests to an organization.", + "enum": [ + "read", + "write" + ] + }, + "organization_personal_access_token_requests": { + "type": "string", + "description": "The level of permission to grant the access token for viewing and managing fine-grained personal access tokens that have been approved by an organization.", + "enum": [ + "read", + "write" + ] + }, + "organization_plan": { + "type": "string", + "description": "The level of permission to grant the access token for viewing an organization's plan.", + "enum": [ + "read" + ] + }, + "organization_projects": { + "type": "string", + "description": "The level of permission to grant the access token to manage organization projects and projects beta (where available).", + "enum": [ + "read", + "write", + "admin" + ] + }, + "organization_packages": { + "type": "string", + "description": "The level of permission to grant the access token for organization packages published to GitHub Packages.", + "enum": [ + "read", + "write" + ] + }, + "organization_secrets": { + "type": "string", + "description": "The level of permission to grant the access token to manage organization secrets.", + "enum": [ + "read", + "write" + ] + }, + "organization_self_hosted_runners": { + "type": "string", + "description": "The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization.", + "enum": [ + "read", + "write" + ] + }, + "organization_user_blocking": { + "type": "string", + "description": "The level of permission to grant the access token to view and manage users blocked by the organization.", + "enum": [ + "read", + "write" + ] + }, + "team_discussions": { + "type": "string", + "description": "The level of permission to grant the access token to manage team discussions and related comments.", + "enum": [ + "read", + "write" + ] + } + }, + "example": { + "contents": "read", + "issues": "read", + "deployments": "write", + "single_file": "read" + } + }, + "events": { + "type": "array", + "items": { + "type": "string" + } + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "single_file_name": { + "type": "string", + "example": "config.yaml", + "nullable": true + }, + "has_multiple_single_files": { + "type": "boolean", + "example": true + }, + "single_file_paths": { + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "config.yml", + ".github/issue_TEMPLATE.md" + ] + }, + "app_slug": { + "type": "string", + "example": "github-actions" + }, + "suspended_by": { + "title": "Simple User", + "description": "A GitHub user.", + "type": "object", + "properties": { + "name": { + "nullable": true, + "type": "string" + }, + "email": { + "nullable": true, + "type": "string" + }, + "login": { + "type": "string", + "example": "octocat" + }, + "id": { + "type": "integer", + "example": 1 + }, + "node_id": { + "type": "string", + "example": "MDQ6VXNlcjE=" + }, + "avatar_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/images/error/octocat_happy.gif" + }, + "gravatar_id": { + "type": "string", + "example": "41d064eb2195891e12d0413f63227ea7", + "nullable": true + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat" + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/octocat" + }, + "followers_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/followers" + }, + "following_url": { + "type": "string", + "example": "https://api.github.com/users/octocat/following{/other_user}" + }, + "gists_url": { + "type": "string", + "example": "https://api.github.com/users/octocat/gists{/gist_id}" + }, + "starred_url": { + "type": "string", + "example": "https://api.github.com/users/octocat/starred{/owner}{/repo}" + }, + "subscriptions_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/subscriptions" + }, + "organizations_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/orgs" + }, + "repos_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/repos" + }, + "events_url": { + "type": "string", + "example": "https://api.github.com/users/octocat/events{/privacy}" + }, + "received_events_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/received_events" + }, + "type": { + "type": "string", + "example": "User" + }, + "site_admin": { + "type": "boolean" + }, + "starred_at": { + "type": "string", + "example": "\"2020-07-09T00:17:55Z\"" + } + }, + "required": [ + "avatar_url", + "events_url", + "followers_url", + "following_url", + "gists_url", + "gravatar_id", + "html_url", + "id", + "node_id", + "login", + "organizations_url", + "received_events_url", + "repos_url", + "site_admin", + "starred_url", + "subscriptions_url", + "type", + "url" + ], + "nullable": true + }, + "suspended_at": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "contact_email": { + "type": "string", + "example": "\"test_13f1e99741e3e004@d7e1eb0bc0a1ba12.com\"", + "nullable": true + } + }, + "required": [ + "id", + "app_id", + "app_slug", + "target_id", + "target_type", + "single_file_name", + "repository_selection", + "access_tokens_url", + "html_url", + "repositories_url", + "events", + "account", + "permissions", + "created_at", + "updated_at", + "suspended_by", + "suspended_at" + ] + } + }, + "examples": { + "default": { + "$ref": "#/components/examples/base-installation-items" + } + } + } + }, + "headers": { + "Link": { + "$ref": "#/components/headers/link" + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": true, + "category": "apps", + "subcategory": "apps" + } +} diff --git a/scripts/overrides/index.mjs b/scripts/overrides/index.mjs index 6ce1fc815..4ff23a68e 100644 --- a/scripts/overrides/index.mjs +++ b/scripts/overrides/index.mjs @@ -106,6 +106,14 @@ export default function overrides(file, schema) { ); if (isDeferenced(file)) { + // The /app/installations/ endpoint have bad usage of `anyof` in the response body schema + replaceOperation( + schema, + "/app/installations", + "get", + "./get-app-installations.deref.json" + ) + // The following 3 endpoints have bad usage of `anyOf` in the request body schema. // See https://github.com/octokit/types.ts/issues/534 // See https://github.com/drwpow/openapi-typescript/issues/1020 @@ -134,6 +142,14 @@ export default function overrides(file, schema) { "./repos-compare-commits.deref.json", ); } else { + // The /app/installations/ endpoint have bad usage of `anyof` in the response body schema + replaceOperation( + schema, + "/app/installations", + "get", + "./get-app-installations.json" + ) + addOperation( schema, "/repos/{owner}/{repo}/compare/{base}...{head}", From a4ef13ae856bd11dbc563beecef917b100a332e8 Mon Sep 17 00:00:00 2001 From: jman420 Date: Fri, 8 Sep 2023 14:09:52 -0400 Subject: [PATCH 2/3] Apply prettier linting --- .../get-app-installations.deref.json | 191 ++++-------------- scripts/overrides/get-app-installations.json | 184 ++++------------- scripts/overrides/index.mjs | 8 +- 3 files changed, 80 insertions(+), 303 deletions(-) diff --git a/scripts/overrides/get-app-installations.deref.json b/scripts/overrides/get-app-installations.deref.json index ba029c7b6..11bbeecbf 100644 --- a/scripts/overrides/get-app-installations.deref.json +++ b/scripts/overrides/get-app-installations.deref.json @@ -1,9 +1,7 @@ { "summary": "List installations for the authenticated app", "description": "You must use a [JWT](https://docs.github.com/enterprise-server@3.9/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\n\nThe permissions the installation has are included under the `permissions` key.", - "tags": [ - "apps" - ], + "tags": ["apps"], "operationId": "apps/list-installations", "externalDocs": { "description": "API method documentation", @@ -259,10 +257,7 @@ "repository_selection": { "description": "Describe whether all repositories have been selected or there's a selection involved", "type": "string", - "enum": [ - "all", - "selected" - ] + "enum": ["all", "selected"] }, "access_tokens_url": { "type": "string", @@ -299,274 +294,172 @@ "actions": { "type": "string", "description": "The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "administration": { "type": "string", "description": "The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "checks": { "type": "string", "description": "The level of permission to grant the access token for checks on code.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "contents": { "type": "string", "description": "The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "deployments": { "type": "string", "description": "The level of permission to grant the access token for deployments and deployment statuses.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "environments": { "type": "string", "description": "The level of permission to grant the access token for managing repository environments.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "issues": { "type": "string", "description": "The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "metadata": { "type": "string", "description": "The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "packages": { "type": "string", "description": "The level of permission to grant the access token for packages published to GitHub Packages.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "pages": { "type": "string", "description": "The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "pull_requests": { "type": "string", "description": "The level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "repository_hooks": { "type": "string", "description": "The level of permission to grant the access token to manage the post-receive hooks for a repository.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "repository_projects": { "type": "string", "description": "The level of permission to grant the access token to manage repository projects, columns, and cards.", - "enum": [ - "read", - "write", - "admin" - ] + "enum": ["read", "write", "admin"] }, "secret_scanning_alerts": { "type": "string", "description": "The level of permission to grant the access token to view and manage secret scanning alerts.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "secrets": { "type": "string", "description": "The level of permission to grant the access token to manage repository secrets.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "security_events": { "type": "string", "description": "The level of permission to grant the access token to view and manage security events like code scanning alerts.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "single_file": { "type": "string", "description": "The level of permission to grant the access token to manage just a single file.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "statuses": { "type": "string", "description": "The level of permission to grant the access token for commit statuses.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "vulnerability_alerts": { "type": "string", "description": "The level of permission to grant the access token to manage Dependabot alerts.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "workflows": { "type": "string", "description": "The level of permission to grant the access token to update GitHub Actions workflow files.", - "enum": [ - "write" - ] + "enum": ["write"] }, "members": { "type": "string", "description": "The level of permission to grant the access token for organization teams and members.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "organization_administration": { "type": "string", "description": "The level of permission to grant the access token to manage access to an organization.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "organization_custom_roles": { "type": "string", "description": "The level of permission to grant the access token for custom repository roles management. This property is in beta and is subject to change.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "organization_announcement_banners": { "type": "string", "description": "The level of permission to grant the access token to view and manage announcement banners for an organization.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "organization_hooks": { "type": "string", "description": "The level of permission to grant the access token to manage the post-receive hooks for an organization.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "organization_personal_access_tokens": { "type": "string", "description": "The level of permission to grant the access token for viewing and managing fine-grained personal access token requests to an organization.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "organization_personal_access_token_requests": { "type": "string", "description": "The level of permission to grant the access token for viewing and managing fine-grained personal access tokens that have been approved by an organization.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "organization_plan": { "type": "string", "description": "The level of permission to grant the access token for viewing an organization's plan.", - "enum": [ - "read" - ] + "enum": ["read"] }, "organization_projects": { "type": "string", "description": "The level of permission to grant the access token to manage organization projects and projects beta (where available).", - "enum": [ - "read", - "write", - "admin" - ] + "enum": ["read", "write", "admin"] }, "organization_packages": { "type": "string", "description": "The level of permission to grant the access token for organization packages published to GitHub Packages.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "organization_secrets": { "type": "string", "description": "The level of permission to grant the access token to manage organization secrets.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "organization_self_hosted_runners": { "type": "string", "description": "The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "organization_user_blocking": { "type": "string", "description": "The level of permission to grant the access token to view and manage users blocked by the organization.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "team_discussions": { "type": "string", "description": "The level of permission to grant the access token to manage team discussions and related comments.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] } }, "example": { @@ -604,10 +497,7 @@ "items": { "type": "string" }, - "example": [ - "config.yml", - ".github/issue_TEMPLATE.md" - ] + "example": ["config.yml", ".github/issue_TEMPLATE.md"] }, "app_slug": { "type": "string", @@ -801,10 +691,7 @@ "metadata": "read", "contents": "read" }, - "events": [ - "push", - "pull_request" - ], + "events": ["push", "pull_request"], "single_file_name": "config.yaml", "has_multiple_single_files": true, "single_file_paths": [ @@ -839,4 +726,4 @@ "category": "apps", "subcategory": "apps" } -} \ No newline at end of file +} diff --git a/scripts/overrides/get-app-installations.json b/scripts/overrides/get-app-installations.json index 787c70bd7..70565b2d8 100644 --- a/scripts/overrides/get-app-installations.json +++ b/scripts/overrides/get-app-installations.json @@ -1,9 +1,7 @@ { "summary": "List installations for the authenticated app", "description": "You must use a [JWT](https://docs.github.com/enterprise-server@3.9/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\n\nThe permissions the installation has are included under the `permissions` key.", - "tags": [ - "apps" - ], + "tags": ["apps"], "operationId": "apps/list-installations", "externalDocs": { "description": "API method documentation", @@ -240,10 +238,7 @@ "repository_selection": { "description": "Describe whether all repositories have been selected or there's a selection involved", "type": "string", - "enum": [ - "all", - "selected" - ] + "enum": ["all", "selected"] }, "access_tokens_url": { "type": "string", @@ -280,274 +275,172 @@ "actions": { "type": "string", "description": "The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "administration": { "type": "string", "description": "The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "checks": { "type": "string", "description": "The level of permission to grant the access token for checks on code.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "contents": { "type": "string", "description": "The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "deployments": { "type": "string", "description": "The level of permission to grant the access token for deployments and deployment statuses.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "environments": { "type": "string", "description": "The level of permission to grant the access token for managing repository environments.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "issues": { "type": "string", "description": "The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "metadata": { "type": "string", "description": "The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "packages": { "type": "string", "description": "The level of permission to grant the access token for packages published to GitHub Packages.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "pages": { "type": "string", "description": "The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "pull_requests": { "type": "string", "description": "The level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "repository_hooks": { "type": "string", "description": "The level of permission to grant the access token to manage the post-receive hooks for a repository.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "repository_projects": { "type": "string", "description": "The level of permission to grant the access token to manage repository projects, columns, and cards.", - "enum": [ - "read", - "write", - "admin" - ] + "enum": ["read", "write", "admin"] }, "secret_scanning_alerts": { "type": "string", "description": "The level of permission to grant the access token to view and manage secret scanning alerts.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "secrets": { "type": "string", "description": "The level of permission to grant the access token to manage repository secrets.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "security_events": { "type": "string", "description": "The level of permission to grant the access token to view and manage security events like code scanning alerts.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "single_file": { "type": "string", "description": "The level of permission to grant the access token to manage just a single file.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "statuses": { "type": "string", "description": "The level of permission to grant the access token for commit statuses.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "vulnerability_alerts": { "type": "string", "description": "The level of permission to grant the access token to manage Dependabot alerts.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "workflows": { "type": "string", "description": "The level of permission to grant the access token to update GitHub Actions workflow files.", - "enum": [ - "write" - ] + "enum": ["write"] }, "members": { "type": "string", "description": "The level of permission to grant the access token for organization teams and members.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "organization_administration": { "type": "string", "description": "The level of permission to grant the access token to manage access to an organization.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "organization_custom_roles": { "type": "string", "description": "The level of permission to grant the access token for custom repository roles management. This property is in beta and is subject to change.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "organization_announcement_banners": { "type": "string", "description": "The level of permission to grant the access token to view and manage announcement banners for an organization.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "organization_hooks": { "type": "string", "description": "The level of permission to grant the access token to manage the post-receive hooks for an organization.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "organization_personal_access_tokens": { "type": "string", "description": "The level of permission to grant the access token for viewing and managing fine-grained personal access token requests to an organization.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "organization_personal_access_token_requests": { "type": "string", "description": "The level of permission to grant the access token for viewing and managing fine-grained personal access tokens that have been approved by an organization.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "organization_plan": { "type": "string", "description": "The level of permission to grant the access token for viewing an organization's plan.", - "enum": [ - "read" - ] + "enum": ["read"] }, "organization_projects": { "type": "string", "description": "The level of permission to grant the access token to manage organization projects and projects beta (where available).", - "enum": [ - "read", - "write", - "admin" - ] + "enum": ["read", "write", "admin"] }, "organization_packages": { "type": "string", "description": "The level of permission to grant the access token for organization packages published to GitHub Packages.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "organization_secrets": { "type": "string", "description": "The level of permission to grant the access token to manage organization secrets.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "organization_self_hosted_runners": { "type": "string", "description": "The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "organization_user_blocking": { "type": "string", "description": "The level of permission to grant the access token to view and manage users blocked by the organization.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] }, "team_discussions": { "type": "string", "description": "The level of permission to grant the access token to manage team discussions and related comments.", - "enum": [ - "read", - "write" - ] + "enum": ["read", "write"] } }, "example": { @@ -585,10 +478,7 @@ "items": { "type": "string" }, - "example": [ - "config.yml", - ".github/issue_TEMPLATE.md" - ] + "example": ["config.yml", ".github/issue_TEMPLATE.md"] }, "app_slug": { "type": "string", diff --git a/scripts/overrides/index.mjs b/scripts/overrides/index.mjs index 4ff23a68e..f82b37779 100644 --- a/scripts/overrides/index.mjs +++ b/scripts/overrides/index.mjs @@ -111,8 +111,8 @@ export default function overrides(file, schema) { schema, "/app/installations", "get", - "./get-app-installations.deref.json" - ) + "./get-app-installations.deref.json", + ); // The following 3 endpoints have bad usage of `anyOf` in the request body schema. // See https://github.com/octokit/types.ts/issues/534 @@ -147,8 +147,8 @@ export default function overrides(file, schema) { schema, "/app/installations", "get", - "./get-app-installations.json" - ) + "./get-app-installations.json", + ); addOperation( schema, From a106d35b39abf8bc3c6abc8e027abc65e33a4036 Mon Sep 17 00:00:00 2001 From: wolfy1339 <4595477+wolfy1339@users.noreply.github.com> Date: Fri, 15 Sep 2023 16:43:09 -0400 Subject: [PATCH 3/3] Apply suggestions from code review --- scripts/overrides/index.mjs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/overrides/index.mjs b/scripts/overrides/index.mjs index f82b37779..465b546f7 100644 --- a/scripts/overrides/index.mjs +++ b/scripts/overrides/index.mjs @@ -106,7 +106,8 @@ export default function overrides(file, schema) { ); if (isDeferenced(file)) { - // The /app/installations/ endpoint have bad usage of `anyof` in the response body schema + // The `/app/installations/` endpoint has bad usage of `anyof` in the response body schema + // See https://github.com/octokit/openapi-types.ts/issues/305 replaceOperation( schema, "/app/installations", @@ -142,7 +143,8 @@ export default function overrides(file, schema) { "./repos-compare-commits.deref.json", ); } else { - // The /app/installations/ endpoint have bad usage of `anyof` in the response body schema + // The `/app/installations/` endpoint has bad usage of `anyof` in the response body schema + // See https://github.com/octokit/openapi-types.ts/issues/305 replaceOperation( schema, "/app/installations",