uhnit testing from vscode

This commit is contained in:
Paul Schneider 2021-09-08 01:55:00 +01:00
commit f33ca22255
10 changed files with 64 additions and 52 deletions

View file

@ -24,7 +24,7 @@ namespace isnd.Controllers
const int maxTake = 100;
const string defaultSemVer = "2.0.0";
private readonly Resource[] _ressources;
private readonly Resource[] _resources;
private readonly ILogger<PackagesController> _logger;
private readonly IDataProtector _protector;
@ -48,13 +48,13 @@ namespace isnd.Controllers
_dbContext = dbContext;
_packageManager = pm;
_unleashĈlient = unleashĈlient;
_ressources = _packageManager.GetResources(_unleashĈlient).ToArray();
_resources = _packageManager.GetResources(_unleashĈlient).ToArray();
}
[HttpGet(_pkgRootPrefix + ApiConfig.Base)]
public IActionResult ApiIndex()
{
return Ok(_ressources);
return Ok(new { version = "3.0.0", resources = _resources });
}
// GET /autocomplete?id=isn.protocol&prerelease=true

View file

@ -1,10 +1,17 @@
using Newtonsoft.Json;
namespace isnd.Controllers
{
public class Resource
{
public string id {get; set; }
public string type {get; set; }
public string comment {get; set; }
[JsonProperty("@id")]
public string Id {get; set; }
[JsonProperty("@type")]
public string Type {get; set; }
[JsonProperty("comment")]
public string Comment {get; set; }
}
}