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

Function pythonResultTypeName

scripts/codegen/python.ts:1376–1384  ·  view source on GitHub ↗
(method: RpcMethod, schemaOverride?: JSONSchema7)

Source from the content-addressed store, hash-verified

1374}
1375
1376function pythonResultTypeName(method: RpcMethod, schemaOverride?: JSONSchema7): string {
1377 const schema = schemaOverride ?? getMethodResultSchema(method);
1378 // If schema is a $ref, derive the type name from the ref path
1379 if (schema?.$ref) {
1380 const refName = schema.$ref.split("/").pop();
1381 if (refName) return toPascalCase(refName);
1382 }
1383 return getRpcSchemaTypeName(schema, toPascalCase(method.rpcMethod) + "Result");
1384}
1385
1386/** Detect the Zod optional params pattern: `anyOf: [{ not: {} }, { $ref }]` */
1387function isParamsOptional(method: RpcMethod): boolean {

Callers 3

generateRpcFunction · 0.85
emitMethodFunction · 0.85

Calls 4

getRpcSchemaTypeNameFunction · 0.85
popMethod · 0.80
getMethodResultSchemaFunction · 0.70
toPascalCaseFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…