fixes for capabilities

This commit is contained in:
Pilzinsel64
2025-06-13 10:26:33 +02:00
parent b9e633a0ff
commit d7e592180b
4 changed files with 7 additions and 14 deletions

View File

@@ -183,13 +183,9 @@ public class ApiServer : IApiServer
semaphore.Release();
}
public virtual IEnumerable<string> GetEndpoints()
public virtual Dictionary<string, string[]> GetEndpoints()
{
return handlers.SelectMany(n => n.Attribute.Methods.Select(m => new
{
n.Attribute.Route,
Method = m,
})).OrderBy(n => n.Route).ThenBy(n => n.Method).Select(n => $"{n.Method} {n.Route}");
return handlers.GroupBy(n => n.Attribute.Route).ToDictionary(n => n.Key, n => n.SelectMany(n => n.Attribute.Methods).ToArray());
}
public virtual void RegisterHandler<T>(T instance) where T : class