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

Function resolveSchema

scripts/codegen/utils.ts:1042–1056  ·  view source on GitHub ↗
(
    schema: JSONSchema7 | null | undefined,
    definitions: DefinitionCollections | undefined
)

Source from the content-addressed store, hash-verified

1040}
1041
1042export function resolveSchema(
1043 schema: JSONSchema7 | null | undefined,
1044 definitions: DefinitionCollections | undefined
1045): JSONSchema7 | undefined {
1046 let current = schema ?? undefined;
1047 const seenRefs = new Set<string>();
1048 while (current?.$ref) {
1049 if (seenRefs.has(current.$ref)) break;
1050 seenRefs.add(current.$ref);
1051 const resolved = resolveRef(current.$ref, definitions);
1052 if (!resolved) break;
1053 current = resolved;
1054 }
1055 return current;
1056}
1057
1058function hasObjectShape(schema: JSONSchema7): boolean {
1059 return !!(schema.properties || schema.additionalProperties || schema.type === "object");

Callers 15

tryEmitRustUnionFunction · 0.85
extractEventVariantsFunction · 0.85
rustParamsTypeNameFunction · 0.85
isNullableParamsSchemaFunction · 0.85
generateApiTypesCodeFunction · 0.85
methodUsesInternalSchemaFunction · 0.85
emitNamespaceMethodFunction · 0.85
generateSessionEventsFunction · 0.85
getMethodResultSchemaFunction · 0.85
getMethodParamsSchemaFunction · 0.85
extractEventVariantsFunction · 0.85
getVariantSchemaFunction · 0.85

Calls 2

resolveRefFunction · 0.70
addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…