MCPcopy Index your code
hub / github.com/anomalyco/opencode / legacyJsonSchema

Function legacyJsonSchema

packages/opencode/src/tool/registry.ts:329–338  ·  view source on GitHub ↗
(entries: [string, unknown][])

Source from the content-addressed store, hash-verified

327}
328
329function legacyJsonSchema(entries: [string, unknown][]): JSONSchema7 {
330 const properties = Object.fromEntries(
331 entries.filter((entry): entry is [string, JSONSchema7Definition] => isJsonSchemaDefinition(entry[1])),
332 )
333 return {
334 type: "object",
335 properties,
336 required: Object.keys(properties),
337 }
338}
339
340function zodJsonSchema(schema: z.ZodType): JSONSchema7 {
341 const result = normalizeZodJsonSchema(z.toJSONSchema(schema, { io: "input", metadata: zodMetadataRegistry(schema) }))

Callers 1

fromPluginFunction · 0.85

Calls 1

isJsonSchemaDefinitionFunction · 0.85

Tested by

no test coverage detected