MCPcopy Index your code
hub / github.com/Effect-TS/effect / getJsonSchemaFromSchemaAst

Function getJsonSchemaFromSchemaAst

packages/ai/ai/src/Tool.ts:1313–1324  ·  view source on GitHub ↗
(
  ast: AST.AST
)

Source from the content-addressed store, hash-verified

1311 * @category Utilities
1312 */
1313export const getJsonSchemaFromSchemaAst = (
1314 ast: AST.AST
1315): JsonSchema.JsonSchema7 => {
1316 const $defs = {}
1317 const schema = JsonSchema.fromAST(ast, {
1318 definitions: $defs,
1319 topLevelReferenceStrategy: "skip"
1320 })
1321 if (Object.keys($defs).length === 0) return schema
1322 ;(schema as any).$defs = $defs
1323 return schema
1324}
1325
1326// =============================================================================
1327// Annotations

Callers 1

getJsonSchemaFunction · 0.85

Calls 1

keysMethod · 0.80

Tested by

no test coverage detected