missed IApiDescriptionVisibility for oneOf, allOf, anyOf

This commit is contained in:
honzapatCZ 2025-01-11 19:36:51 +01:00
parent ba100f0010
commit a203c2b6d1

View File

@ -39,7 +39,7 @@ namespace NejCommon.Controllers
var key = context.SchemaRepository.Schemas.FirstOrDefault(k => k.Value == schema).Key; var key = context.SchemaRepository.Schemas.FirstOrDefault(k => k.Value == schema).Key;
if (string.IsNullOrWhiteSpace(key)) if (string.IsNullOrWhiteSpace(key))
continue; continue;
//Console.WriteLine($"Removing schema {key}"); Console.WriteLine($"Removing schema {key}");
context.SchemaRepository.Schemas.Remove(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); 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); 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); 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);
}
} }
} }
} }