about summary refs log tree commit diff
path: root/MatrixRoomUtils.DebugDataValidationApi/Controllers
diff options
context:
space:
mode:
authorEmma@Rory& <root@rory.gay>2023-08-14 05:07:51 +0200
committerEmma@Rory& <root@rory.gay>2023-08-14 05:11:21 +0200
commitaa7026a17ededf7c181ed269c6388491d96e1b1e (patch)
tree963b45cebbfefb3c5cebaf4ba7134a0e32eb0147 /MatrixRoomUtils.DebugDataValidationApi/Controllers
parentAdd latest code before splitting projects (diff)
downloadMatrixUtils-aa7026a17ededf7c181ed269c6388491d96e1b1e.tar.xz
Split LibMatrix into submodule
Diffstat (limited to 'MatrixRoomUtils.DebugDataValidationApi/Controllers')
-rw-r--r--MatrixRoomUtils.DebugDataValidationApi/Controllers/ValidationController.cs26
1 files changed, 0 insertions, 26 deletions
diff --git a/MatrixRoomUtils.DebugDataValidationApi/Controllers/ValidationController.cs b/MatrixRoomUtils.DebugDataValidationApi/Controllers/ValidationController.cs
deleted file mode 100644

index 949871a..0000000 --- a/MatrixRoomUtils.DebugDataValidationApi/Controllers/ValidationController.cs +++ /dev/null
@@ -1,26 +0,0 @@ -using System.Text.Json; -using MatrixRoomUtils.Core.Extensions; -using Microsoft.AspNetCore.Mvc; - -namespace MatrixRoomUtils.DebugDataValidationApi.Controllers; - -[ApiController] -[Route("/")] -public class ValidationController : ControllerBase { - private readonly ILogger<ValidationController> _logger; - - public ValidationController(ILogger<ValidationController> logger) { - _logger = logger; - } - - [HttpPost("/validate/{type}")] - public async Task<bool> Get([FromRoute] string type, [FromBody] JsonElement content) { - Type t = Type.GetType(type); - if (t is null) { - Console.WriteLine($"Type `{type}` does not exist!"); - throw new ArgumentException($"Unknown type {type}!"); - } - Console.WriteLine($"Validating {type}..."); - return content.FindExtraJsonElementFields(t, "$"); - } -}