зеркало из https://github.com/github/docs.git
use @github/rest-api-operations@2.0.1 (with github/github defs!) (#15602)
This commit is contained in:
Родитель
a6244af229
Коммит
42fda8ec4d
|
@ -21,23 +21,39 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!--
|
||||
Previews require an `accept` header. These used to be documented
|
||||
as `operation.parameters` but have moved to `operation.x-github.previews`
|
||||
-->
|
||||
<tr>
|
||||
<td><code>accept</code></td>
|
||||
<td class="opacity-70">string</td>
|
||||
<td class="opacity-70">header</td>
|
||||
<td class="opacity-70">
|
||||
<p>
|
||||
{% if operation.hasRequiredPreviews %}
|
||||
This API is under preview and subject to change.
|
||||
{% else %}
|
||||
Setting to <code>application/vnd.github.v3+json</code> is recommended.
|
||||
{% endif %}
|
||||
{% if operation.x-github.previews.size > 0 %}
|
||||
<a href="#{{operation.slug}}-preview-notices">
|
||||
{% if operation.x-github.previews.size > 1 %}
|
||||
{{ site.data.ui.products.rest.reference.see_preview_notices }}
|
||||
{% else %}
|
||||
{{ site.data.ui.products.rest.reference.see_preview_notice }}
|
||||
{% endif %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
{% for param in operation.parameters %}
|
||||
<tr>
|
||||
<td><code>{{ param.name }}</code></td>
|
||||
<td class="opacity-70">{{ param.schema.type }}</td>
|
||||
<td class="opacity-70">{{ param.in }}</td>
|
||||
<td class="opacity-70">
|
||||
{{ param.descriptionHTML }}
|
||||
{% if param.name == 'accept' and param.in == 'header' and operation.x-github.previews.size > 0 %}
|
||||
<a href="#{{operation.slug}}-preview-notices">
|
||||
{% if operation.x-github.previews.size > 1 %}
|
||||
{{ site.data.ui.products.rest.reference.see_preview_notices }}.
|
||||
{% else %}
|
||||
{{ site.data.ui.products.rest.reference.see_preview_notice }}.
|
||||
{% endif %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="opacity-70">{{ param.descriptionHTML }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% for bodyParam in operation.bodyParameters %}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { chain, union, flatten, groupBy } = require('lodash')
|
||||
const { chain, get, union, flatten, groupBy } = require('lodash')
|
||||
const { supported } = require('./enterprise-server-releases')
|
||||
const operations = require('@github/rest-api-operations')
|
||||
// TODO need to update this to the new versions in coordination with openAPI
|
||||
|
@ -16,6 +16,13 @@ const dotcomCategories = getCategories(operations.dotcom)
|
|||
const enterpriseCategories = flatten(supported.map(v => getCategories(operations[v])))
|
||||
const categories = union(dotcomCategories, enterpriseCategories)
|
||||
|
||||
// Attach convenience properties to each operation that can't easily be created in Liquid
|
||||
allVersions.forEach(currentVersion => {
|
||||
operations[currentVersion].forEach(operation => {
|
||||
operation.hasRequiredPreviews = get(operation, 'x-github.previews', []).some(preview => preview.required)
|
||||
})
|
||||
})
|
||||
|
||||
// This is a collection of operations that have `enabledForApps = true`
|
||||
// It's grouped by resource title to make rendering easier
|
||||
const operationsEnabledForApps = allVersions.reduce((acc, currentVersion) => {
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -11,7 +11,7 @@
|
|||
"@github-docs/data-directory": "^1.2.0",
|
||||
"@github-docs/frontmatter": "^1.3.1",
|
||||
"@github-docs/render-content": "^4.0.0",
|
||||
"@github/rest-api-operations": "^1.35.0",
|
||||
"@github/rest-api-operations": "^2.0.1",
|
||||
"@octokit/rest": "^16.38.1",
|
||||
"@primer/css": "^15.1.0",
|
||||
"@primer/octicons": "^10.0.0",
|
||||
|
|
Загрузка…
Ссылка в новой задаче