diff --git a/src/Server/Controllers/AccountController.cs b/src/Server/Controllers/AccountController.cs index 9c0f19d..af218ec 100644 --- a/src/Server/Controllers/AccountController.cs +++ b/src/Server/Controllers/AccountController.cs @@ -6,6 +6,7 @@ using Server.Models; namespace Server.Controllers; +[ApiExplorerSettings(IgnoreApi = true)] [Route("[Controller]")] public class AccountController : Controller { diff --git a/src/Server/Controllers/EntityController.cs b/src/Server/Controllers/EntityController.cs index 3326310..bf11613 100644 --- a/src/Server/Controllers/EntityController.cs +++ b/src/Server/Controllers/EntityController.cs @@ -25,7 +25,7 @@ public class EntityController : ControllerBase } [HttpGet("Query")] - public ActionResult Query(string searchdomain, string query, int? topN) + public ActionResult Query(string searchdomain, string query, int? topN, bool returnAttributes = false) { Searchdomain searchdomain_; try @@ -44,7 +44,8 @@ public class EntityController : ControllerBase List queryResults = [.. results.Select(r => new EntityQueryResult { Name = r.Item2, - Value = r.Item1 + Value = r.Item1, + Attributes = returnAttributes ? (searchdomain_.entityCache.FirstOrDefault(x => x.name == r.Item2)?.attributes ?? null) : null })]; return Ok(new EntityQueryResults(){Results = queryResults, Success = true }); } diff --git a/src/Server/Controllers/Frontend/HomeController.cs b/src/Server/Controllers/Frontend/HomeController.cs index 4ee52ec..6feb134 100644 --- a/src/Server/Controllers/Frontend/HomeController.cs +++ b/src/Server/Controllers/Frontend/HomeController.cs @@ -7,7 +7,7 @@ using Server.Exceptions; using Server.Models; namespace Server.Controllers; -[ApiController] +[ApiExplorerSettings(IgnoreApi = true)] [Route("/")] public class HomeController : Controller { diff --git a/src/Shared/Models/EntityResults.cs b/src/Shared/Models/EntityResults.cs index 03db7a5..0e99110 100644 --- a/src/Shared/Models/EntityResults.cs +++ b/src/Shared/Models/EntityResults.cs @@ -19,6 +19,9 @@ public class EntityQueryResult public required string Name { get; set; } [JsonPropertyName("Value")] public float Value { get; set; } + [JsonPropertyName("Attributes")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public Dictionary? Attributes { get; set; } } public class EntityIndexResult