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

Function getRequiredQueryParamsPath

components/lib/get-rest-code-samples.ts:256–267  ·  view source on GitHub ↗
(operation: Operation, codeSample: CodeSample)

Source from the content-addressed store, hash-verified

254}
255
256function getRequiredQueryParamsPath(operation: Operation, codeSample: CodeSample) {
257 const requiredQueryParams = new URLSearchParams()
258 for (const param of operation.parameters) {
259 if (param.in === 'query' && param.required === true) {
260 const codeExamples = codeSample.response?.example
261 const match = findMatchingQueryKey(codeExamples, param.name)
262 requiredQueryParams.append(param.name, match || param.name.toUpperCase())
263 }
264 }
265
266 return requiredQueryParams.toString()
267}
268
269function getAcceptHeader(codeSample: CodeSample) {
270 // This allows us to display custom media types like application/sarif+json

Callers 2

getShellExampleFunction · 0.85
getGHExampleFunction · 0.85

Calls 1

findMatchingQueryKeyFunction · 0.85

Tested by

no test coverage detected