diff --git a/Controllers/IApiDescriptionVisibilitySchemaFilter.cs b/Controllers/IApiDescriptionVisibilitySchemaFilter.cs index be05efe..8d95262 100644 --- a/Controllers/IApiDescriptionVisibilitySchemaFilter.cs +++ b/Controllers/IApiDescriptionVisibilitySchemaFilter.cs @@ -39,7 +39,7 @@ namespace NejCommon.Controllers var key = context.SchemaRepository.Schemas.FirstOrDefault(k => k.Value == schema).Key; if (string.IsNullOrWhiteSpace(key)) continue; - //Console.WriteLine($"Removing schema {key}"); + Console.WriteLine($"Removing schema {key}"); context.SchemaRepository.Schemas.Remove(key); } } @@ -86,7 +86,7 @@ namespace NejCommon.Controllers var orphanedSchemas = swaggerDoc.Components.Schemas.Where(x => !currentSchemas.ContainsKey(x.Key)).ToDictionary(x => x.Key, x => x.Value); - //Console.WriteLine($"Unused schemas: {string.Join(", ", orphanedSchemas.Keys)}"); + Console.WriteLine($"Unused schemas: {string.Join(", ", orphanedSchemas.Keys)}"); swaggerDoc.Components.Schemas = swaggerDoc.Components.Schemas.Where(x => currentSchemas.ContainsKey(x.Key)).ToDictionary(x => x.Key, x => x.Value); } @@ -113,6 +113,18 @@ namespace NejCommon.Controllers { ExpandSchemas(repo, currentSchemas, sch); } + foreach(var sch in schemaToExpand.OneOf) + { + ExpandSchemas(repo, currentSchemas, sch); + } + foreach(var sch in schemaToExpand.AnyOf) + { + ExpandSchemas(repo, currentSchemas, sch); + } + foreach(var sch in schemaToExpand.AllOf) + { + ExpandSchemas(repo, currentSchemas, sch); + } } } } \ No newline at end of file