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

Function goNonNullUnionMembers

scripts/codegen/go.ts:2162–2170  ·  view source on GitHub ↗
(schema: JSONSchema7)

Source from the content-addressed store, hash-verified

2160}
2161
2162function goNonNullUnionMembers(schema: JSONSchema7): JSONSchema7[] {
2163 return ((schema.anyOf ?? schema.oneOf) as JSONSchema7[] | undefined)
2164 ?.filter((member) => {
2165 if (!member || typeof member !== "object") return false;
2166 if (member.type === "null") return false;
2167 if (member.not && typeof member.not === "object" && Object.keys(member.not).length === 0) return false;
2168 return true;
2169 }) ?? [];
2170}
2171
2172function goUnionHasExternalRef(members: JSONSchema7[]): boolean {
2173 return members.some((member) => typeof member.$ref === "string" && parseExternalSchemaRef(member.$ref) !== undefined);

Callers 10

resolveGoPropertyTypeFunction · 0.85
goStringEnumValuesFunction · 0.85
goBooleanValuesFunction · 0.85
goPrimitiveUnionVariantsFunction · 0.85
goUntaggedUnionVariantsFunction · 0.85
planGoUnionFunction · 0.85
emitGoUnionWrapperStructFunction · 0.85
emitGoRpcDefinitionFunction · 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…