@softeria/ms-365-mcp-server 0.20.1 → 0.20.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -279,7 +279,7 @@ function reduceProperties(schema, schemaName) {
279
279
  }
280
280
  }
281
281
 
282
- function mergeAllOfSchemas(allOfArray, allSchemas) {
282
+ function mergeAllOfSchemas(allOfArray, allSchemas, visited = new Set()) {
283
283
  const merged = {
284
284
  type: 'object',
285
285
  properties: {},
@@ -288,11 +288,29 @@ function mergeAllOfSchemas(allOfArray, allSchemas) {
288
288
  allOfArray.forEach((item) => {
289
289
  if (item.$ref) {
290
290
  const refSchemaName = item.$ref.replace('#/components/schemas/', '');
291
+
292
+ if (visited.has(refSchemaName)) {
293
+ return;
294
+ }
295
+ visited.add(refSchemaName);
296
+
291
297
  const refSchema = allSchemas[refSchemaName];
292
298
  if (refSchema) {
293
299
  console.log(
294
- `Processing ref ${refSchemaName} for ${item.title}, exists: true, has properties: ${!!refSchema.properties}`
300
+ `Processing ref ${refSchemaName} for ${item.title}, exists: true, has properties: ${!!refSchema.properties}, has allOf: ${!!refSchema.allOf}`
295
301
  );
302
+
303
+ if (refSchema.allOf) {
304
+ const nestedMerged = mergeAllOfSchemas(refSchema.allOf, allSchemas, new Set(visited));
305
+ Object.assign(merged.properties, nestedMerged.properties);
306
+ if (nestedMerged.required) {
307
+ merged.required = [...(merged.required || []), ...nestedMerged.required];
308
+ }
309
+ if (nestedMerged.description && !merged.description) {
310
+ merged.description = nestedMerged.description;
311
+ }
312
+ }
313
+
296
314
  if (refSchema.properties) {
297
315
  console.log(`Ensuring ${item.title} has all required properties from ${refSchemaName}`);
298
316
  Object.assign(merged.properties, refSchema.properties);