about summary refs log tree commit diff
path: root/LibMatrix.DebugDataValidationApi
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-08-14 19:46:11 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-08-14 19:46:11 +0200
commitcb8846a7a3310f8513989da5aadb5202f048a1b3 (patch)
treecfbcf2506947d0f820208dd4cdb7a56c660ef0f9 /LibMatrix.DebugDataValidationApi
parentUpdate dependencies (diff)
downloadLibMatrix-cb8846a7a3310f8513989da5aadb5202f048a1b3.tar.xz
Code cleanup
Diffstat (limited to '')
-rw-r--r--LibMatrix.DebugDataValidationApi/Controllers/ValidationController.cs6
-rw-r--r--LibMatrix.DebugDataValidationApi/Program.cs2
2 files changed, 4 insertions, 4 deletions
diff --git a/LibMatrix.DebugDataValidationApi/Controllers/ValidationController.cs b/LibMatrix.DebugDataValidationApi/Controllers/ValidationController.cs
index 1599f35..4dbee54 100644
--- a/LibMatrix.DebugDataValidationApi/Controllers/ValidationController.cs
+++ b/LibMatrix.DebugDataValidationApi/Controllers/ValidationController.cs
@@ -14,13 +14,13 @@ public class ValidationController : ControllerBase {
     }
 
     [HttpPost("/validate/{type}")]
-    public async Task<bool> Get([FromRoute] string type, [FromBody] JsonElement content) {
-        Type t = Type.GetType(type);
+    public Task<bool> Get([FromRoute] string type, [FromBody] JsonElement content) {
+        var 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, "$");
+        return Task.FromResult(content.FindExtraJsonElementFields(t, "$"));
     }
 }
diff --git a/LibMatrix.DebugDataValidationApi/Program.cs b/LibMatrix.DebugDataValidationApi/Program.cs
index 047dbcf..cf9dc55 100644
--- a/LibMatrix.DebugDataValidationApi/Program.cs
+++ b/LibMatrix.DebugDataValidationApi/Program.cs
@@ -10,7 +10,7 @@ builder.Services.AddCors(options =>
 {
     options.AddPolicy(
         "Open",
-        builder => builder.AllowAnyOrigin().AllowAnyHeader());
+        policy => policy.AllowAnyOrigin().AllowAnyHeader());
 });
 
 var app = builder.Build();