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

Function extractRefName

java/scripts/codegen/java.ts:254–260  ·  view source on GitHub ↗

Extract the definition name from a $ref string (e.g., "#/definitions/Foo" → "Foo")

(schema: JSONSchema7 | null | undefined)

Source from the content-addressed store, hash-verified

252
253/** Extract the definition name from a $ref string (e.g., "#/definitions/Foo""Foo") */
254function extractRefName(schema: JSONSchema7 | null | undefined): string | null {
255 if (!schema?.$ref) return null;
256 // Handle cross-schema refs
257 const crossMatch = schema.$ref.match(/^[^#]+#\/definitions\/(.+)$/);
258 if (crossMatch) return crossMatch[1];
259 return schema.$ref.replace(/^#\/definitions\//, "");
260}
261
262// ── Discriminated union support ─────────────────────────────────────────────
263

Callers 2

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…