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

Function shouldPreferMethodParamSchema

scripts/codegen/rust.ts:1431–1449  ·  view source on GitHub ↗
(
		typeName: string,
		paramsSchema: JSONSchema7,
	)

Source from the content-addressed store, hash-verified

1429 const schemaPropertyNames = (schema: JSONSchema7): string[] =>
1430 sortedNames(Object.keys(schema.properties ?? {}));
1431 const shouldPreferMethodParamSchema = (
1432 typeName: string,
1433 paramsSchema: JSONSchema7,
1434 ): boolean => {
1435 const definition = definitions[typeName];
1436 if (typeof definition !== "object" || definition === null) return false;
1437 const definitionSchema = asGeneratedObjectSchema(
1438 definition as JSONSchema7,
1439 defCollections,
1440 );
1441 if (!definitionSchema) return false;
1442
1443 return (
1444 JSON.stringify(schemaPropertyNames(paramsSchema)) !==
1445 JSON.stringify(schemaPropertyNames(definitionSchema)) ||
1446 JSON.stringify(sortedNames(paramsSchema.required)) !==
1447 JSON.stringify(sortedNames(definitionSchema.required))
1448 );
1449 };
1450 for (const { method, isSession } of methodEntries) {
1451 const params = method.params as (JSONSchema7 & { $ref?: string }) | undefined;
1452 if (!params || typeof params.$ref === "string") continue;

Callers 1

generateApiTypesCodeFunction · 0.85

Calls 3

asGeneratedObjectSchemaFunction · 0.85
schemaPropertyNamesFunction · 0.85
sortedNamesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…