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

Function hasSchemaPayload

scripts/codegen/utils.ts:1213–1224  ·  view source on GitHub ↗
(schema: JSONSchema7 | null | undefined)

Source from the content-addressed store, hash-verified

1211}
1212
1213export function hasSchemaPayload(schema: JSONSchema7 | null | undefined): boolean {
1214 if (!schema) return false;
1215 if (schema.properties) return Object.keys(schema.properties).length > 0;
1216 if (schema.additionalProperties) return true;
1217 if (schema.items) return true;
1218 if (schema.anyOf || schema.oneOf || schema.allOf) return true;
1219 if (schema.enum && schema.enum.length > 0) return true;
1220 if (schema.const !== undefined) return true;
1221 if (schema.$ref) return true;
1222 if (Array.isArray(schema.type)) return schema.type.length > 0 && !(schema.type.length === 1 && schema.type[0] === "object");
1223 return schema.type !== undefined && schema.type !== "object";
1224}
1225
1226export function collectDefinitionCollections(
1227 schema: Record<string, unknown>

Callers 8

generateRpcFunction · 0.85
emitGroupFunction · 0.85
generateRpcFunction · 0.85
emitMethodFunction · 0.85
generateRpcFunction · 0.85
emitMethodFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…