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

Function resolveAnyOfVariants

java/scripts/codegen/java.ts:307–317  ·  view source on GitHub ↗

* Resolve anyOf variants, handling $ref to definitions.

(anyOf: JSONSchema7[])

Source from the content-addressed store, hash-verified

305 * Resolve anyOf variants, handling $ref to definitions.
306 */
307function resolveAnyOfVariants(anyOf: JSONSchema7[]): JSONSchema7[] {
308 return anyOf
309 .map((v) => {
310 if (v.$ref) {
311 const name = v.$ref.replace(/^#\/definitions\//, "");
312 return currentDefinitions[name] ?? v;
313 }
314 return v;
315 })
316 .filter((v) => v.type !== "null");
317}
318
319/**
320 * Generate a polymorphic base class and variant subclasses for a discriminated union result type.

Callers 4

generateRpcTypesFunction · 0.85
wrapperResultClassNameFunction · 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…