From a9c1aaac105b4b32d4d18ce7b4634e22d5ce4cf3 Mon Sep 17 00:00:00 2001 From: Gem Xli Date: Mon, 18 May 2020 01:09:37 +0800 Subject: [PATCH] fix: workaround for udpate-a-gist content definition (#723) --- lib/endpoint/overrides/workarounds.js | 191 ++++++++++++++++++ .../operations/gists/create.json | 81 ++------ .../operations/gists/get-revision.json | 58 +----- .../api.github.com/operations/gists/get.json | 58 +----- .../operations/gists/list-for-user.json | 18 +- .../operations/gists/list-public.json | 18 +- .../operations/gists/list-starred.json | 18 +- .../api.github.com/operations/gists/list.json | 18 +- .../operations/gists/update.json | 19 +- openapi/ghe-2.17/operations/gists/create.json | 81 ++------ .../operations/gists/get-revision.json | 58 +----- openapi/ghe-2.17/operations/gists/get.json | 58 +----- .../operations/gists/list-for-user.json | 18 +- .../operations/gists/list-public.json | 18 +- .../operations/gists/list-starred.json | 18 +- openapi/ghe-2.17/operations/gists/list.json | 18 +- openapi/ghe-2.17/operations/gists/update.json | 19 +- openapi/ghe-2.18/operations/gists/create.json | 81 ++------ .../operations/gists/get-revision.json | 58 +----- openapi/ghe-2.18/operations/gists/get.json | 58 +----- .../operations/gists/list-for-user.json | 18 +- .../operations/gists/list-public.json | 18 +- .../operations/gists/list-starred.json | 18 +- openapi/ghe-2.18/operations/gists/list.json | 18 +- openapi/ghe-2.18/operations/gists/update.json | 19 +- openapi/ghe-2.19/operations/gists/create.json | 81 ++------ .../operations/gists/get-revision.json | 58 +----- openapi/ghe-2.19/operations/gists/get.json | 58 +----- .../operations/gists/list-for-user.json | 18 +- .../operations/gists/list-public.json | 18 +- .../operations/gists/list-starred.json | 18 +- openapi/ghe-2.19/operations/gists/list.json | 18 +- openapi/ghe-2.19/operations/gists/update.json | 19 +- openapi/ghe-2.20/operations/gists/create.json | 81 ++------ .../operations/gists/get-revision.json | 58 +----- openapi/ghe-2.20/operations/gists/get.json | 58 +----- .../operations/gists/list-for-user.json | 18 +- .../operations/gists/list-public.json | 18 +- .../operations/gists/list-starred.json | 18 +- openapi/ghe-2.20/operations/gists/list.json | 18 +- openapi/ghe-2.20/operations/gists/update.json | 19 +- 41 files changed, 606 insertions(+), 1025 deletions(-) diff --git a/lib/endpoint/overrides/workarounds.js b/lib/endpoint/overrides/workarounds.js index 3d68396617..6f95fb347b 100644 --- a/lib/endpoint/overrides/workarounds.js +++ b/lib/endpoint/overrides/workarounds.js @@ -71,6 +71,8 @@ function workarounds(state) { }); } + gistWorkarounds(route); + if ( /repos\/get-(apps|teams|users)-with-access-to-protected-branch/.test( route.operation.operationId @@ -147,3 +149,192 @@ function workarounds(state) { } }); } + +function gistWorkarounds(route) { + const { operation } = route; + const restPattern = route.method + " " + route.path; + + // Allows you to update or delete a gist file and rename gist files. + // Files from the previous version of the gist that aren't explicitly + // changed during an edit are unchanged. + // see https://developer.github.com/v3/gists/#update-a-gist + if (restPattern === "PATCH /gists/:gist_id") { + operation.requestBody.content[ + "application/json" + ].schema.properties.files = { + type: "object", + description: "The filenames and content that make up this gist.", + additionalProperties: { + type: "object", + properties: { + content: { + type: "string", + description: "The updated content of the file.", + }, + filename: { + type: "string", + description: + "The new name for this file. To delete a file, set the value of the filename to `null`.", + }, + }, + }, + }; + } + + // see https://developer.github.com/v3/gists/#get-a-gist + if (restPattern === "GET /gists/:gist_id") { + operation.responses[200].content[ + "application/json" + ].schema.properties.files = { + type: "object", + additionalProperties: { + type: "object", + properties: { + filename: { type: "string" }, + type: { type: "string" }, + language: { type: "string" }, + raw_url: { type: "string" }, + size: { type: "number" }, + truncated: { type: "boolean" }, + content: { type: "string" }, + }, + }, + }; + } + + // Allows you to add a new gist with one or more files. + // see https://developer.github.com/v3/gists/#create-a-gist + if (restPattern === "POST /gists") { + operation.requestBody.content[ + "application/json" + ].schema.properties.files = { + type: "object", + description: + "The filenames and content of each file in the gist. The keys in the `files` object represent the filename and have the type `string`.", + additionalProperties: { + type: "object", + properties: { + content: { + type: "string", + description: "The content of the file.", + }, + }, + }, + }; + + operation.responses[201].content[ + "application/json" + ].schema.properties.files = { + type: "object", + additionalProperties: { + type: "object", + properties: { + filename: { type: "string" }, + type: { type: "string" }, + language: { type: "string" }, + raw_url: { type: "string" }, + size: { type: "number" }, + truncated: { type: "boolean" }, + content: { type: "string" }, + }, + }, + }; + } + + // see https://developer.github.com/v3/gists/#get-a-specific-revision-of-a-gist + if (restPattern === "GET /gists/:gist_id/:sha") { + operation.responses[200].content[ + "application/json" + ].schema.properties.files = { + type: "object", + additionalProperties: { + type: "object", + properties: { + filename: { type: "string" }, + type: { type: "string" }, + language: { type: "string" }, + raw_url: { type: "string" }, + size: { type: "number" }, + truncated: { type: "boolean" }, + content: { type: "string" }, + }, + }, + }; + } + + // see https://developer.github.com/v3/gists/#list-gists-for-the-authenticated-user + if (restPattern === "GET /gists") { + operation.responses[200].content[ + "application/json" + ].schema.items.properties.files = { + type: "object", + additionalProperties: { + type: "object", + properties: { + filename: { type: "string" }, + type: { type: "string" }, + language: { type: "string" }, + raw_url: { type: "string" }, + size: { type: "number" }, + }, + }, + }; + } + + // see https://developer.github.com/v3/gists/#list-public-gists + if (restPattern === "GET /gists/public") { + operation.responses[200].content[ + "application/json" + ].schema.items.properties.files = { + type: "object", + additionalProperties: { + type: "object", + properties: { + filename: { type: "string" }, + type: { type: "string" }, + language: { type: "string" }, + raw_url: { type: "string" }, + size: { type: "number" }, + }, + }, + }; + } + + // see https://developer.github.com/v3/gists/#list-starred-gists + if (restPattern === "GET /gists/starred") { + operation.responses[200].content[ + "application/json" + ].schema.items.properties.files = { + type: "object", + additionalProperties: { + type: "object", + properties: { + filename: { type: "string" }, + type: { type: "string" }, + language: { type: "string" }, + raw_url: { type: "string" }, + size: { type: "number" }, + }, + }, + }; + } + + // see https://developer.github.com/v3/gists/#list-gists-for-a-user + if (restPattern === "GET /users/:username/gists") { + operation.responses[200].content[ + "application/json" + ].schema.items.properties.files = { + type: "object", + additionalProperties: { + type: "object", + properties: { + filename: { type: "string" }, + type: { type: "string" }, + language: { type: "string" }, + raw_url: { type: "string" }, + size: { type: "number" }, + }, + }, + }; + } +} diff --git a/openapi/api.github.com/operations/gists/create.json b/openapi/api.github.com/operations/gists/create.json index 8a766aa4f9..67c51534fd 100644 --- a/openapi/api.github.com/operations/gists/create.json +++ b/openapi/api.github.com/operations/gists/create.json @@ -36,54 +36,16 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world.py": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_ruby.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_python.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" }, + "truncated": { "type": "boolean" }, + "content": { "type": "string" } } } }, @@ -346,16 +308,10 @@ "x-code-samples": [ { "lang": "Shell", - "source": "curl \\\n -XPOST \\\n -H\"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/gists \\\n -d '{\"files\":{\"content\":\"content\"}}'" - }, - { - "lang": "JS", - "source": "octokit.gists.create({\n files: {\n content: 'content'\n }\n})" + "source": "curl \\\n -XPOST \\\n -H\"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/gists \\\n -d '{\"files\":{}}'" }, - { - "lang": "Ruby", - "source": "octokit.create(\n {\n content: 'content'\n }\n)" - } + { "lang": "JS", "source": "octokit.gists.create({\n files: {}\n})" }, + { "lang": "Ruby", "source": "octokit.create(\n {}\n)" } ], "x-github": { "legacy": false, @@ -373,10 +329,13 @@ "files": { "type": "object", "description": "The filenames and content of each file in the gist. The keys in the `files` object represent the filename and have the type `string`.", - "properties": { - "content": { - "type": "string", - "description": "The content of the file." + "additionalProperties": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "The content of the file." + } } } }, diff --git a/openapi/api.github.com/operations/gists/get-revision.json b/openapi/api.github.com/operations/gists/get-revision.json index d6d40603d8..7991376761 100644 --- a/openapi/api.github.com/operations/gists/get-revision.json +++ b/openapi/api.github.com/operations/gists/get-revision.json @@ -48,54 +48,16 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world.py": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_ruby.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_python.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" }, + "truncated": { "type": "boolean" }, + "content": { "type": "string" } } } }, diff --git a/openapi/api.github.com/operations/gists/get.json b/openapi/api.github.com/operations/gists/get.json index 337d10303b..e2e67fc4aa 100644 --- a/openapi/api.github.com/operations/gists/get.json +++ b/openapi/api.github.com/operations/gists/get.json @@ -42,54 +42,16 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world.py": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_ruby.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_python.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" }, + "truncated": { "type": "boolean" }, + "content": { "type": "string" } } } }, diff --git a/openapi/api.github.com/operations/gists/list-for-user.json b/openapi/api.github.com/operations/gists/list-for-user.json index d33b03b092..bcab883410 100644 --- a/openapi/api.github.com/operations/gists/list-for-user.json +++ b/openapi/api.github.com/operations/gists/list-for-user.json @@ -63,16 +63,14 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" } } } }, diff --git a/openapi/api.github.com/operations/gists/list-public.json b/openapi/api.github.com/operations/gists/list-public.json index 3853289185..4254d08b93 100644 --- a/openapi/api.github.com/operations/gists/list-public.json +++ b/openapi/api.github.com/operations/gists/list-public.json @@ -57,16 +57,14 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" } } } }, diff --git a/openapi/api.github.com/operations/gists/list-starred.json b/openapi/api.github.com/operations/gists/list-starred.json index 9c16021970..273200ed0e 100644 --- a/openapi/api.github.com/operations/gists/list-starred.json +++ b/openapi/api.github.com/operations/gists/list-starred.json @@ -57,16 +57,14 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" } } } }, diff --git a/openapi/api.github.com/operations/gists/list.json b/openapi/api.github.com/operations/gists/list.json index 13ef769244..ee5c2fc5f7 100644 --- a/openapi/api.github.com/operations/gists/list.json +++ b/openapi/api.github.com/operations/gists/list.json @@ -57,16 +57,14 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" } } } }, diff --git a/openapi/api.github.com/operations/gists/update.json b/openapi/api.github.com/operations/gists/update.json index e407ff4ae0..d9690ed8bb 100644 --- a/openapi/api.github.com/operations/gists/update.json +++ b/openapi/api.github.com/operations/gists/update.json @@ -377,14 +377,17 @@ "files": { "type": "object", "description": "The filenames and content that make up this gist.", - "properties": { - "content": { - "type": "string", - "description": "The updated content of the file." - }, - "filename": { - "type": "string", - "description": "The new name for this file. To delete a file, set the value of the filename to `null`." + "additionalProperties": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "The updated content of the file." + }, + "filename": { + "type": "string", + "description": "The new name for this file. To delete a file, set the value of the filename to `null`." + } } } } diff --git a/openapi/ghe-2.17/operations/gists/create.json b/openapi/ghe-2.17/operations/gists/create.json index 01eff18c22..7bfef4871f 100644 --- a/openapi/ghe-2.17/operations/gists/create.json +++ b/openapi/ghe-2.17/operations/gists/create.json @@ -36,54 +36,16 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world.py": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_ruby.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_python.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" }, + "truncated": { "type": "boolean" }, + "content": { "type": "string" } } } }, @@ -346,16 +308,10 @@ "x-code-samples": [ { "lang": "Shell", - "source": "curl \\\n -XPOST \\\n -H\"Accept: application/vnd.github.v3+json\" \\\n http://{hostname}/gists \\\n -d '{\"files\":{\"content\":\"content\"}}'" - }, - { - "lang": "JS", - "source": "octokit.gists.create({\n files: {\n content: 'content'\n }\n})" + "source": "curl \\\n -XPOST \\\n -H\"Accept: application/vnd.github.v3+json\" \\\n http://{hostname}/gists \\\n -d '{\"files\":{}}'" }, - { - "lang": "Ruby", - "source": "octokit.create(\n {\n content: 'content'\n }\n)" - } + { "lang": "JS", "source": "octokit.gists.create({\n files: {}\n})" }, + { "lang": "Ruby", "source": "octokit.create(\n {}\n)" } ], "x-github": { "legacy": false, @@ -373,10 +329,13 @@ "files": { "type": "object", "description": "The filenames and content of each file in the gist. The keys in the `files` object represent the filename and have the type `string`.", - "properties": { - "content": { - "type": "string", - "description": "The content of the file." + "additionalProperties": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "The content of the file." + } } } }, diff --git a/openapi/ghe-2.17/operations/gists/get-revision.json b/openapi/ghe-2.17/operations/gists/get-revision.json index 0fa54369f7..29f93da78a 100644 --- a/openapi/ghe-2.17/operations/gists/get-revision.json +++ b/openapi/ghe-2.17/operations/gists/get-revision.json @@ -48,54 +48,16 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world.py": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_ruby.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_python.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" }, + "truncated": { "type": "boolean" }, + "content": { "type": "string" } } } }, diff --git a/openapi/ghe-2.17/operations/gists/get.json b/openapi/ghe-2.17/operations/gists/get.json index 93663c0b46..4615ff7c7f 100644 --- a/openapi/ghe-2.17/operations/gists/get.json +++ b/openapi/ghe-2.17/operations/gists/get.json @@ -42,54 +42,16 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world.py": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_ruby.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_python.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" }, + "truncated": { "type": "boolean" }, + "content": { "type": "string" } } } }, diff --git a/openapi/ghe-2.17/operations/gists/list-for-user.json b/openapi/ghe-2.17/operations/gists/list-for-user.json index 4bf8f8a455..b3de8963e0 100644 --- a/openapi/ghe-2.17/operations/gists/list-for-user.json +++ b/openapi/ghe-2.17/operations/gists/list-for-user.json @@ -63,16 +63,14 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" } } } }, diff --git a/openapi/ghe-2.17/operations/gists/list-public.json b/openapi/ghe-2.17/operations/gists/list-public.json index dac2c74ab2..cd50768b37 100644 --- a/openapi/ghe-2.17/operations/gists/list-public.json +++ b/openapi/ghe-2.17/operations/gists/list-public.json @@ -57,16 +57,14 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" } } } }, diff --git a/openapi/ghe-2.17/operations/gists/list-starred.json b/openapi/ghe-2.17/operations/gists/list-starred.json index f5969962b7..713d771dc1 100644 --- a/openapi/ghe-2.17/operations/gists/list-starred.json +++ b/openapi/ghe-2.17/operations/gists/list-starred.json @@ -57,16 +57,14 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" } } } }, diff --git a/openapi/ghe-2.17/operations/gists/list.json b/openapi/ghe-2.17/operations/gists/list.json index 45230e109b..1e4b78f249 100644 --- a/openapi/ghe-2.17/operations/gists/list.json +++ b/openapi/ghe-2.17/operations/gists/list.json @@ -57,16 +57,14 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" } } } }, diff --git a/openapi/ghe-2.17/operations/gists/update.json b/openapi/ghe-2.17/operations/gists/update.json index 25c26c522b..8f1d6dbcfc 100644 --- a/openapi/ghe-2.17/operations/gists/update.json +++ b/openapi/ghe-2.17/operations/gists/update.json @@ -377,14 +377,17 @@ "files": { "type": "object", "description": "The filenames and content that make up this gist.", - "properties": { - "content": { - "type": "string", - "description": "The updated content of the file." - }, - "filename": { - "type": "string", - "description": "The new name for this file. To delete a file, set the value of the filename to `null`." + "additionalProperties": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "The updated content of the file." + }, + "filename": { + "type": "string", + "description": "The new name for this file. To delete a file, set the value of the filename to `null`." + } } } } diff --git a/openapi/ghe-2.18/operations/gists/create.json b/openapi/ghe-2.18/operations/gists/create.json index 8811956e38..e99364a46a 100644 --- a/openapi/ghe-2.18/operations/gists/create.json +++ b/openapi/ghe-2.18/operations/gists/create.json @@ -36,54 +36,16 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world.py": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_ruby.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_python.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" }, + "truncated": { "type": "boolean" }, + "content": { "type": "string" } } } }, @@ -346,16 +308,10 @@ "x-code-samples": [ { "lang": "Shell", - "source": "curl \\\n -XPOST \\\n -H\"Accept: application/vnd.github.v3+json\" \\\n http://{hostname}/gists \\\n -d '{\"files\":{\"content\":\"content\"}}'" - }, - { - "lang": "JS", - "source": "octokit.gists.create({\n files: {\n content: 'content'\n }\n})" + "source": "curl \\\n -XPOST \\\n -H\"Accept: application/vnd.github.v3+json\" \\\n http://{hostname}/gists \\\n -d '{\"files\":{}}'" }, - { - "lang": "Ruby", - "source": "octokit.create(\n {\n content: 'content'\n }\n)" - } + { "lang": "JS", "source": "octokit.gists.create({\n files: {}\n})" }, + { "lang": "Ruby", "source": "octokit.create(\n {}\n)" } ], "x-github": { "legacy": false, @@ -373,10 +329,13 @@ "files": { "type": "object", "description": "The filenames and content of each file in the gist. The keys in the `files` object represent the filename and have the type `string`.", - "properties": { - "content": { - "type": "string", - "description": "The content of the file." + "additionalProperties": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "The content of the file." + } } } }, diff --git a/openapi/ghe-2.18/operations/gists/get-revision.json b/openapi/ghe-2.18/operations/gists/get-revision.json index 664ed3abea..08074e9f36 100644 --- a/openapi/ghe-2.18/operations/gists/get-revision.json +++ b/openapi/ghe-2.18/operations/gists/get-revision.json @@ -48,54 +48,16 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world.py": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_ruby.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_python.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" }, + "truncated": { "type": "boolean" }, + "content": { "type": "string" } } } }, diff --git a/openapi/ghe-2.18/operations/gists/get.json b/openapi/ghe-2.18/operations/gists/get.json index d7a1c9a55a..af5ae80431 100644 --- a/openapi/ghe-2.18/operations/gists/get.json +++ b/openapi/ghe-2.18/operations/gists/get.json @@ -42,54 +42,16 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world.py": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_ruby.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_python.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" }, + "truncated": { "type": "boolean" }, + "content": { "type": "string" } } } }, diff --git a/openapi/ghe-2.18/operations/gists/list-for-user.json b/openapi/ghe-2.18/operations/gists/list-for-user.json index 035701ff4e..f9c4ca180c 100644 --- a/openapi/ghe-2.18/operations/gists/list-for-user.json +++ b/openapi/ghe-2.18/operations/gists/list-for-user.json @@ -63,16 +63,14 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" } } } }, diff --git a/openapi/ghe-2.18/operations/gists/list-public.json b/openapi/ghe-2.18/operations/gists/list-public.json index cfd1f1bbbc..42be99436d 100644 --- a/openapi/ghe-2.18/operations/gists/list-public.json +++ b/openapi/ghe-2.18/operations/gists/list-public.json @@ -57,16 +57,14 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" } } } }, diff --git a/openapi/ghe-2.18/operations/gists/list-starred.json b/openapi/ghe-2.18/operations/gists/list-starred.json index 6e1fccd1ad..0c6aaaf5d3 100644 --- a/openapi/ghe-2.18/operations/gists/list-starred.json +++ b/openapi/ghe-2.18/operations/gists/list-starred.json @@ -57,16 +57,14 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" } } } }, diff --git a/openapi/ghe-2.18/operations/gists/list.json b/openapi/ghe-2.18/operations/gists/list.json index 883230b200..604b80bf27 100644 --- a/openapi/ghe-2.18/operations/gists/list.json +++ b/openapi/ghe-2.18/operations/gists/list.json @@ -57,16 +57,14 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" } } } }, diff --git a/openapi/ghe-2.18/operations/gists/update.json b/openapi/ghe-2.18/operations/gists/update.json index 136dcc2c06..5431f0a9e5 100644 --- a/openapi/ghe-2.18/operations/gists/update.json +++ b/openapi/ghe-2.18/operations/gists/update.json @@ -377,14 +377,17 @@ "files": { "type": "object", "description": "The filenames and content that make up this gist.", - "properties": { - "content": { - "type": "string", - "description": "The updated content of the file." - }, - "filename": { - "type": "string", - "description": "The new name for this file. To delete a file, set the value of the filename to `null`." + "additionalProperties": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "The updated content of the file." + }, + "filename": { + "type": "string", + "description": "The new name for this file. To delete a file, set the value of the filename to `null`." + } } } } diff --git a/openapi/ghe-2.19/operations/gists/create.json b/openapi/ghe-2.19/operations/gists/create.json index 008d43a839..1046ecba4d 100644 --- a/openapi/ghe-2.19/operations/gists/create.json +++ b/openapi/ghe-2.19/operations/gists/create.json @@ -36,54 +36,16 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world.py": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_ruby.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_python.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" }, + "truncated": { "type": "boolean" }, + "content": { "type": "string" } } } }, @@ -346,16 +308,10 @@ "x-code-samples": [ { "lang": "Shell", - "source": "curl \\\n -XPOST \\\n -H\"Accept: application/vnd.github.v3+json\" \\\n http://{hostname}/gists \\\n -d '{\"files\":{\"content\":\"content\"}}'" - }, - { - "lang": "JS", - "source": "octokit.gists.create({\n files: {\n content: 'content'\n }\n})" + "source": "curl \\\n -XPOST \\\n -H\"Accept: application/vnd.github.v3+json\" \\\n http://{hostname}/gists \\\n -d '{\"files\":{}}'" }, - { - "lang": "Ruby", - "source": "octokit.create(\n {\n content: 'content'\n }\n)" - } + { "lang": "JS", "source": "octokit.gists.create({\n files: {}\n})" }, + { "lang": "Ruby", "source": "octokit.create(\n {}\n)" } ], "x-github": { "legacy": false, @@ -373,10 +329,13 @@ "files": { "type": "object", "description": "The filenames and content of each file in the gist. The keys in the `files` object represent the filename and have the type `string`.", - "properties": { - "content": { - "type": "string", - "description": "The content of the file." + "additionalProperties": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "The content of the file." + } } } }, diff --git a/openapi/ghe-2.19/operations/gists/get-revision.json b/openapi/ghe-2.19/operations/gists/get-revision.json index c1c7341039..17b0ed8976 100644 --- a/openapi/ghe-2.19/operations/gists/get-revision.json +++ b/openapi/ghe-2.19/operations/gists/get-revision.json @@ -48,54 +48,16 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world.py": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_ruby.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_python.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" }, + "truncated": { "type": "boolean" }, + "content": { "type": "string" } } } }, diff --git a/openapi/ghe-2.19/operations/gists/get.json b/openapi/ghe-2.19/operations/gists/get.json index 43aae45688..23b3d67413 100644 --- a/openapi/ghe-2.19/operations/gists/get.json +++ b/openapi/ghe-2.19/operations/gists/get.json @@ -42,54 +42,16 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world.py": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_ruby.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_python.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" }, + "truncated": { "type": "boolean" }, + "content": { "type": "string" } } } }, diff --git a/openapi/ghe-2.19/operations/gists/list-for-user.json b/openapi/ghe-2.19/operations/gists/list-for-user.json index 9d89181f6b..ed768da37c 100644 --- a/openapi/ghe-2.19/operations/gists/list-for-user.json +++ b/openapi/ghe-2.19/operations/gists/list-for-user.json @@ -63,16 +63,14 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" } } } }, diff --git a/openapi/ghe-2.19/operations/gists/list-public.json b/openapi/ghe-2.19/operations/gists/list-public.json index 2ebb55fdce..9bc40fccbf 100644 --- a/openapi/ghe-2.19/operations/gists/list-public.json +++ b/openapi/ghe-2.19/operations/gists/list-public.json @@ -57,16 +57,14 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" } } } }, diff --git a/openapi/ghe-2.19/operations/gists/list-starred.json b/openapi/ghe-2.19/operations/gists/list-starred.json index e5a4b002c9..31bc317dc9 100644 --- a/openapi/ghe-2.19/operations/gists/list-starred.json +++ b/openapi/ghe-2.19/operations/gists/list-starred.json @@ -57,16 +57,14 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" } } } }, diff --git a/openapi/ghe-2.19/operations/gists/list.json b/openapi/ghe-2.19/operations/gists/list.json index ee9ff4a098..8bed42e3d2 100644 --- a/openapi/ghe-2.19/operations/gists/list.json +++ b/openapi/ghe-2.19/operations/gists/list.json @@ -57,16 +57,14 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" } } } }, diff --git a/openapi/ghe-2.19/operations/gists/update.json b/openapi/ghe-2.19/operations/gists/update.json index 05bf8cc1c9..8d47acd04e 100644 --- a/openapi/ghe-2.19/operations/gists/update.json +++ b/openapi/ghe-2.19/operations/gists/update.json @@ -377,14 +377,17 @@ "files": { "type": "object", "description": "The filenames and content that make up this gist.", - "properties": { - "content": { - "type": "string", - "description": "The updated content of the file." - }, - "filename": { - "type": "string", - "description": "The new name for this file. To delete a file, set the value of the filename to `null`." + "additionalProperties": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "The updated content of the file." + }, + "filename": { + "type": "string", + "description": "The new name for this file. To delete a file, set the value of the filename to `null`." + } } } } diff --git a/openapi/ghe-2.20/operations/gists/create.json b/openapi/ghe-2.20/operations/gists/create.json index 17f21ede6d..4f582dd31c 100644 --- a/openapi/ghe-2.20/operations/gists/create.json +++ b/openapi/ghe-2.20/operations/gists/create.json @@ -36,54 +36,16 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world.py": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_ruby.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_python.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" }, + "truncated": { "type": "boolean" }, + "content": { "type": "string" } } } }, @@ -346,16 +308,10 @@ "x-code-samples": [ { "lang": "Shell", - "source": "curl \\\n -XPOST \\\n -H\"Accept: application/vnd.github.v3+json\" \\\n http://{hostname}/gists \\\n -d '{\"files\":{\"content\":\"content\"}}'" - }, - { - "lang": "JS", - "source": "octokit.gists.create({\n files: {\n content: 'content'\n }\n})" + "source": "curl \\\n -XPOST \\\n -H\"Accept: application/vnd.github.v3+json\" \\\n http://{hostname}/gists \\\n -d '{\"files\":{}}'" }, - { - "lang": "Ruby", - "source": "octokit.create(\n {\n content: 'content'\n }\n)" - } + { "lang": "JS", "source": "octokit.gists.create({\n files: {}\n})" }, + { "lang": "Ruby", "source": "octokit.create(\n {}\n)" } ], "x-github": { "legacy": false, @@ -373,10 +329,13 @@ "files": { "type": "object", "description": "The filenames and content of each file in the gist. The keys in the `files` object represent the filename and have the type `string`.", - "properties": { - "content": { - "type": "string", - "description": "The content of the file." + "additionalProperties": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "The content of the file." + } } } }, diff --git a/openapi/ghe-2.20/operations/gists/get-revision.json b/openapi/ghe-2.20/operations/gists/get-revision.json index a530bba514..6824dccd0e 100644 --- a/openapi/ghe-2.20/operations/gists/get-revision.json +++ b/openapi/ghe-2.20/operations/gists/get-revision.json @@ -48,54 +48,16 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world.py": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_ruby.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_python.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" }, + "truncated": { "type": "boolean" }, + "content": { "type": "string" } } } }, diff --git a/openapi/ghe-2.20/operations/gists/get.json b/openapi/ghe-2.20/operations/gists/get.json index aaceca657a..acb12ebd37 100644 --- a/openapi/ghe-2.20/operations/gists/get.json +++ b/openapi/ghe-2.20/operations/gists/get.json @@ -42,54 +42,16 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world.py": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_ruby.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } - }, - "hello_world_python.txt": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" }, - "truncated": { "type": "boolean" }, - "content": { "type": "string" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" }, + "truncated": { "type": "boolean" }, + "content": { "type": "string" } } } }, diff --git a/openapi/ghe-2.20/operations/gists/list-for-user.json b/openapi/ghe-2.20/operations/gists/list-for-user.json index ba86a51184..10254347cb 100644 --- a/openapi/ghe-2.20/operations/gists/list-for-user.json +++ b/openapi/ghe-2.20/operations/gists/list-for-user.json @@ -63,16 +63,14 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" } } } }, diff --git a/openapi/ghe-2.20/operations/gists/list-public.json b/openapi/ghe-2.20/operations/gists/list-public.json index 16a5900221..e5239cac04 100644 --- a/openapi/ghe-2.20/operations/gists/list-public.json +++ b/openapi/ghe-2.20/operations/gists/list-public.json @@ -57,16 +57,14 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" } } } }, diff --git a/openapi/ghe-2.20/operations/gists/list-starred.json b/openapi/ghe-2.20/operations/gists/list-starred.json index 99eb9ff978..fff48c5d20 100644 --- a/openapi/ghe-2.20/operations/gists/list-starred.json +++ b/openapi/ghe-2.20/operations/gists/list-starred.json @@ -57,16 +57,14 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" } } } }, diff --git a/openapi/ghe-2.20/operations/gists/list.json b/openapi/ghe-2.20/operations/gists/list.json index a04abf22e4..5d1e660919 100644 --- a/openapi/ghe-2.20/operations/gists/list.json +++ b/openapi/ghe-2.20/operations/gists/list.json @@ -57,16 +57,14 @@ "html_url": { "type": "string" }, "files": { "type": "object", - "properties": { - "hello_world.rb": { - "type": "object", - "properties": { - "filename": { "type": "string" }, - "type": { "type": "string" }, - "language": { "type": "string" }, - "raw_url": { "type": "string" }, - "size": { "type": "number" } - } + "additionalProperties": { + "type": "object", + "properties": { + "filename": { "type": "string" }, + "type": { "type": "string" }, + "language": { "type": "string" }, + "raw_url": { "type": "string" }, + "size": { "type": "number" } } } }, diff --git a/openapi/ghe-2.20/operations/gists/update.json b/openapi/ghe-2.20/operations/gists/update.json index a886d0b386..b3e2dc6f1d 100644 --- a/openapi/ghe-2.20/operations/gists/update.json +++ b/openapi/ghe-2.20/operations/gists/update.json @@ -377,14 +377,17 @@ "files": { "type": "object", "description": "The filenames and content that make up this gist.", - "properties": { - "content": { - "type": "string", - "description": "The updated content of the file." - }, - "filename": { - "type": "string", - "description": "The new name for this file. To delete a file, set the value of the filename to `null`." + "additionalProperties": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "The updated content of the file." + }, + "filename": { + "type": "string", + "description": "The new name for this file. To delete a file, set the value of the filename to `null`." + } } } }