MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / findAllSchemas

Function findAllSchemas

tests/schema-validation.test.cjs:78–98  ·  view source on GitHub ↗
(dir)

Source from the content-addressed store, hash-verified

76}
77
78function findAllSchemas(dir) {
79 const schemas = [];
80
81 function traverse(currentDir) {
82 const items = fs.readdirSync(currentDir);
83
84 for (const item of items) {
85 const itemPath = path.join(currentDir, item);
86 const stat = fs.statSync(itemPath);
87
88 if (stat.isDirectory()) {
89 traverse(itemPath);
90 } else if (item.endsWith('.json')) {
91 schemas.push(itemPath);
92 }
93 }
94 }
95
96 traverse(dir);
97 return schemas;
98}
99
100function validateSchemaStructure(schemaPath, schema) {
101 // Check required top-level fields

Callers 2

runTestsFunction · 0.85

Calls 1

traverseFunction · 0.85

Tested by

no test coverage detected