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

Function goBooleanValues

scripts/codegen/go.ts:2250–2270  ·  view source on GitHub ↗
(schema: JSONSchema7, ctx: GoCodegenCtx)

Source from the content-addressed store, hash-verified

2248}
2249
2250function goBooleanValues(schema: JSONSchema7, ctx: GoCodegenCtx): boolean[] | undefined {
2251 const resolved = resolveSchema(schema, ctx.definitions) ?? schema;
2252 if (typeof resolved.const === "boolean") return [resolved.const];
2253 if (Array.isArray(resolved.enum) && resolved.enum.every((value) => typeof value === "boolean")) {
2254 return resolved.enum as boolean[];
2255 }
2256 if (resolved.type === "boolean") return [true, false];
2257
2258 const unionMembers = goNonNullUnionMembers(resolved);
2259 if (unionMembers.length > 0) {
2260 const values: boolean[] = [];
2261 for (const member of unionMembers) {
2262 const memberValues = goBooleanValues(member, ctx);
2263 if (!memberValues) return undefined;
2264 values.push(...memberValues);
2265 }
2266 return [...new Set(values)];
2267 }
2268
2269 return undefined;
2270}
2271
2272function goBooleanDiscriminatorValues(schema: JSONSchema7, ctx: GoCodegenCtx): boolean[] | undefined {
2273 const resolved = resolveSchema(schema, ctx.definitions) ?? schema;

Callers 1

Calls 3

resolveSchemaFunction · 0.85
goNonNullUnionMembersFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…