MCPcopy Index your code
hub / github.com/github/docs / renderBodyParameterDescriptions

Method renderBodyParameterDescriptions

src/rest/scripts/utils/operation.js:153–166  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

151 }
152
153 async renderBodyParameterDescriptions() {
154 if (!this.#operation.requestBody) return []
155 // There is currently only one operation with more than one content type
156 // and the request body parameter types are the same for both.
157 // Operation Id: markdown/render-raw
158 const contentType = Object.keys(this.#operation.requestBody.content)[0]
159 const schema = get(this.#operation, `requestBody.content.${contentType}.schema`, {})
160 // TODO: Remove this check
161 if (this.#operation.operationId === 'checks/create') {
162 delete schema.oneOf
163 }
164
165 this.bodyParameters = isPlainObject(schema) ? await getBodyParams(schema, true) : []
166 }
167
168 async renderPreviewNotes() {
169 const previews = get(this.#operation, 'x-github.previews', [])

Callers 1

processMethod · 0.95

Calls 2

getBodyParamsFunction · 0.90
getFunction · 0.85

Tested by

no test coverage detected