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

Function goObjectUnionMemberSchema

scripts/codegen/go.ts:2218–2225  ·  view source on GitHub ↗
(member: JSONSchema7, ctx: GoCodegenCtx)

Source from the content-addressed store, hash-verified

2216}
2217
2218function goObjectUnionMemberSchema(member: JSONSchema7, ctx: GoCodegenCtx): JSONSchema7 | undefined {
2219 const resolved = resolveGoUnionMember(member, ctx.definitions);
2220 const objectSchema = resolveObjectSchema(resolved, ctx.definitions) ?? resolveSchema(resolved, ctx.definitions) ?? resolved;
2221 if (objectSchema?.properties && (objectSchema.type === "object" || objectSchema.type === undefined)) {
2222 return objectSchema;
2223 }
2224 return undefined;
2225}
2226
2227function canFlattenGoObjectUnion(members: JSONSchema7[], ctx: GoCodegenCtx): boolean {
2228 return members.length > 0 && members.every((member) => goObjectUnionMemberSchema(member, ctx) !== undefined);

Callers 6

canFlattenGoObjectUnionFunction · 0.85
goSchemaJSONKindFunction · 0.85
goUntaggedUnionVariantFunction · 0.85
emitGoUnionWrapperStructFunction · 0.85

Calls 3

resolveGoUnionMemberFunction · 0.85
resolveObjectSchemaFunction · 0.85
resolveSchemaFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…