MCPcopy Index your code
hub / github.com/github/copilot-sdk / getMethodParamsObjectSchema

Function getMethodParamsObjectSchema

scripts/codegen/rust.ts:1352–1386  ·  view source on GitHub ↗
(
	method: RpcMethod,
	defCollections: DefinitionCollections,
	isSession: boolean,
)

Source from the content-addressed store, hash-verified

1350}
1351
1352function getMethodParamsObjectSchema(
1353 method: RpcMethod,
1354 defCollections: DefinitionCollections,
1355 isSession: boolean,
1356): JSONSchema7 | undefined {
1357 if (!method.params) return undefined;
1358
1359 const resolved = asGeneratedObjectSchema(method.params, defCollections);
1360 if (!resolved) return undefined;
1361
1362 const properties = { ...(resolved.properties ?? {}) };
1363 if (isSession) {
1364 delete properties.sessionId;
1365 }
1366
1367 if (Object.keys(properties).length === 0) return undefined;
1368
1369 const required = (resolved.required ?? [])
1370 .filter((name) => !isSession || name !== "sessionId")
1371 .filter((name) => Object.prototype.hasOwnProperty.call(properties, name));
1372
1373 const schema: JSONSchema7 = {
1374 ...resolved,
1375 properties,
1376 description: method.params.description ?? resolved.description,
1377 };
1378
1379 if (required.length > 0) {
1380 schema.required = required;
1381 } else {
1382 delete schema.required;
1383 }
1384
1385 return schema;
1386}
1387
1388function isNullableParamsSchema(
1389 params: JSONSchema7,

Callers 2

generateApiTypesCodeFunction · 0.85
getMethodParamsInfoFunction · 0.85

Calls 1

asGeneratedObjectSchemaFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…