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

Function rustMapValueType

scripts/codegen/rust.ts:492–512  ·  view source on GitHub ↗
(
	schema: JSONSchema7,
	parentTypeName: string,
	ctx: RustCodegenCtx,
)

Source from the content-addressed store, hash-verified

490}
491
492function rustMapValueType(
493 schema: JSONSchema7,
494 parentTypeName: string,
495 ctx: RustCodegenCtx,
496): string {
497 const additionalProperties = schema.additionalProperties;
498 if (
499 additionalProperties &&
500 typeof additionalProperties === "object" &&
501 Object.keys(additionalProperties as Record<string, unknown>).length > 0
502 ) {
503 const valueSchema = additionalProperties as JSONSchema7;
504 if (valueSchema.type === "object" && valueSchema.properties) {
505 const valueName = (valueSchema.title as string) || `${parentTypeName}Value`;
506 emitRustStruct(valueName, valueSchema, ctx);
507 return valueName;
508 }
509 return resolveRustType(valueSchema, parentTypeName, "value", true, ctx);
510 }
511 return "serde_json::Value";
512}
513
514function rustMapType(
515 schema: JSONSchema7,

Callers 1

rustMapTypeFunction · 0.85

Calls 2

emitRustStructFunction · 0.85
resolveRustTypeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…