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

Function resolveRef

java/scripts/codegen/java.ts:239–251  ·  view source on GitHub ↗

* Resolve a $ref in a JSON Schema against the current definitions. * Returns the resolved schema, or the original if no $ref is present.

(schema: JSONSchema7 | undefined)

Source from the content-addressed store, hash-verified

237 * Returns the resolved schema, or the original if no $ref is present.
238 */
239function resolveRef(schema: JSONSchema7 | undefined): JSONSchema7 | undefined {
240 if (!schema) return schema;
241 if (schema.$ref) {
242 const name = schema.$ref.replace(/^#\/definitions\//, "");
243 const resolved = currentDefinitions[name];
244 if (!resolved) {
245 console.warn(`[codegen] Unresolved $ref: ${schema.$ref}`);
246 return schema;
247 }
248 return resolved;
249 }
250 return schema;
251}
252
253/** Extract the definition name from a $ref string (e.g., "#/definitions/Foo""Foo") */
254function extractRefName(schema: JSONSchema7 | null | undefined): string | null {

Callers 4

generateRpcTypesFunction · 0.70
wrapperResultClassNameFunction · 0.70
wrapperParamsClassNameFunction · 0.70
methodHasSessionIdFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…