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

Function resolveGoUnionMember

scripts/codegen/go.ts:2204–2216  ·  view source on GitHub ↗
(member: JSONSchema7, definitions: DefinitionCollections | undefined)

Source from the content-addressed store, hash-verified

2202}
2203
2204function resolveGoUnionMember(member: JSONSchema7, definitions: DefinitionCollections | undefined): JSONSchema7 {
2205 if (member.$ref) {
2206 const externalRef = parseExternalSchemaRef(member.$ref);
2207 if (externalRef) {
2208 const localDefinition = definitions?.definitions?.[externalRef.definitionName] ?? definitions?.$defs?.[externalRef.definitionName];
2209 if (localDefinition && typeof localDefinition === "object") {
2210 return localDefinition as JSONSchema7;
2211 }
2212 }
2213 return resolveRef(member.$ref, definitions) ?? member;
2214 }
2215 return member;
2216}
2217
2218function goObjectUnionMemberSchema(member: JSONSchema7, ctx: GoCodegenCtx): JSONSchema7 | undefined {
2219 const resolved = resolveGoUnionMember(member, ctx.definitions);

Callers 8

findGoDiscriminatorFunction · 0.85
resolveGoPropertyTypeFunction · 0.85
goPrimitiveUnionGoTypeFunction · 0.85
goSchemaJSONKindFunction · 0.85
goUntaggedUnionVariantFunction · 0.85
planGoUnionFunction · 0.85

Calls 2

parseExternalSchemaRefFunction · 0.85
resolveRefFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…