Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

rest_operation.html 6.0 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
  1. <div>
  2. <div>
  3. <h3 id="{{operation.slug}}" class="pt-3">
  4. <a href="#{{operation.slug}}">{{operation.summary}}</a>
  5. </h3>
  6. {{operation.descriptionHTML}}
  7. </div>
  8. <pre><code><span class="color-bg-info-inverse color-text-inverse rounded-1 px-2 py-1" style="text-transform: uppercase">{{operation.verb}}</span> {{operation.requestPath}}</code></pre>
  9. <div>
  10. {% if operation.parameters.size > 0 or operation.bodyParameters.size > 0 %}
  11. <h4 id="{{operation.slug}}--parameters">
  12. <a href="#{{operation.slug}}--parameters">{% data ui.products.rest.reference.parameters %}</a>
  13. </h4>
  14. <table>
  15. <thead>
  16. <tr>
  17. <th>Name</th>
  18. <th>Type</th>
  19. <th>In</th>
  20. <th>Description</th>
  21. </tr>
  22. </thead>
  23. <tbody>
  24. <!--
  25. Previews require an `accept` header. These used to be documented
  26. as `operation.parameters` but have moved to `operation.x-github.previews`
  27. -->
  28. <tr>
  29. <td><code>accept</code></td>
  30. <td class="opacity-70">string</td>
  31. <td class="opacity-70">header</td>
  32. <td class="opacity-70">
  33. <p>
  34. {% if operation.hasRequiredPreviews %}
  35. This API is under preview and subject to change.
  36. {% else %}
  37. Setting to <code>application/vnd.github.v3+json</code> is recommended.
  38. {% endif %}
  39. {% if operation.x-github.previews.size > 0 %}
  40. <a href="#{{operation.slug}}-preview-notices">
  41. {% if operation.x-github.previews.size > 1 %}
  42. {% data ui.products.rest.reference.see_preview_notices %}
  43. {% else %}
  44. {% data ui.products.rest.reference.see_preview_notice %}
  45. {% endif %}
  46. </a>
  47. {% endif %}
  48. </p>
  49. </td>
  50. </tr>
  51. {% for param in operation.parameters %}
  52. <tr>
  53. <td><code>{{ param.name }}</code></td>
  54. <td class="opacity-70">{{ param.schema.type }}</td>
  55. <td class="opacity-70">{{ param.in }}</td>
  56. <td class="opacity-70">
  57. {{ param.descriptionHTML }}
  58. {% if param.schema.default != nil %}
  59. Default: <code>{{ param.schema.default }}</code>
  60. {% endif %}
  61. </td>
  62. </tr>
  63. {% endfor %}
  64. {% for bodyParam in operation.bodyParameters %}
  65. <tr>
  66. <td><code>{{ bodyParam.name }}</code></td>
  67. <td class="opacity-70">{{ bodyParam.type }}</td>
  68. <td class="opacity-70">{{ bodyParam.in }}</td>
  69. <td class="opacity-70">
  70. {{ bodyParam.description }}
  71. {% if bodyParam.default != nil %}
  72. Default: <code>{{ bodyParam.default }}</code>
  73. {% endif %}
  74. </td>
  75. </tr>
  76. {% if bodyParam.childParamsGroups.size > 0 %}
  77. <tr style="border: none;">
  78. <td colspan="4" class="has-nested-table">
  79. {% for childParamsGroup in bodyParam.childParamsGroups %}
  80. <details>
  81. <summary class="color-text-secondary"><h4 id="{{ childParamsGroup.id }}">Properties of the <code>{{ childParamsGroup.parentName }}</code> {{ childParamsGroup.parentType }}</h4></summary>
  82. <table>
  83. <tbody>
  84. {% for childParam in childParamsGroup.params %}
  85. <tr>
  86. <td class="opacity-60"><code>{{ childParam.name }}</code> ({{ childParam.type }})</td>
  87. <td class="opacity-60">{{ childParam.description }}</td>
  88. </tr>
  89. {% endfor %}
  90. </tbody>
  91. </table>
  92. </details>
  93. {% endfor %}
  94. </td>
  95. </tr>
  96. {% endif %}
  97. {% endfor %}
  98. </tbody>
  99. </table>
  100. {% endif %}
  101. {% if operation.x-codeSamples.size > 0 %}
  102. <h4 id="{{operation.slug}}--code-samples">
  103. <a href="#{{operation.slug}}--code-samples">{% data ui.products.rest.reference.code_samples %}</a>
  104. </h4>
  105. {% for sample in operation.x-codeSamples %}
  106. {% unless sample.lang == "Ruby" %}
  107. <h5>
  108. {% if sample.lang == "JavaScript" %}
  109. {{sample.lang}} (<a href="https://github.com/octokit/core.js#readme">@octokit/core.js</a>)
  110. {% else %}
  111. {{sample.lang}}
  112. {% endif %}
  113. </h5>
  114. {{sample.html}}
  115. {% endunless %}
  116. {% endfor %}
  117. {% endif %}
  118. {% for response in operation.responses %}
  119. <h4>{{ response.description }}</h4>
  120. <pre><code>Status: {{ response.httpStatusCode }} {{ response.httpStatusMessage }}</code></pre>
  121. <div class="height-constrained-code-block">{{ response.payload }}</div>
  122. {% endfor %}
  123. {% if operation.notes.size > 0 or operation.x-github.enabledForGitHubApps %}
  124. <h4>Notes</h4>
  125. <ul class="mt-2">
  126. {% if operation.x-github.enabledForGitHubApps %}
  127. <li><a href="{{ restGitHubAppsLink }}">Works with GitHub Apps</a></li>
  128. {% endif %}
  129. {% for note in operation.notes %}
  130. <li>{{ note }}</li>
  131. {% endfor %}
  132. </ul>
  133. {% endif %}
  134. {% if operation.x-github.previews.size > 0 %}
  135. <h4 id="{{operation.slug}}-preview-notices">
  136. {% if operation.x-github.previews.size > 1 %}
  137. {% data ui.products.rest.reference.preview_notices %}
  138. {% else %}
  139. {% data ui.products.rest.reference.preview_notice %}
  140. {% endif %}
  141. </h4>
  142. {% for preview in operation.x-github.previews %}
  143. <div class="extended-markdown note border rounded-1 mb-4 p-3 color-border-info color-bg-info f5">
  144. {{ preview.html }}
  145. {% if preview.required %}☝️ {% data ui.products.rest.reference.preview_header_is_required %}.{% endif %}
  146. </div>
  147. {% endfor %}
  148. {% endif %}
  149. </div>
  150. <hr>
  151. </div>
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...