about summary refs log tree commit diff
path: root/Tests/LibMatrix.HomeserverEmulator/Program.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-05-02 07:20:13 +0200
committerRory& <root@rory.gay>2024-05-02 07:20:13 +0200
commit508c694c3d551cddb3b15c1b0d4787dae3c00530 (patch)
treebabe9f57e40f0014a9158eaf9f798c434ce9d380 /Tests/LibMatrix.HomeserverEmulator/Program.cs
parentFixes (diff)
downloadLibMatrix-508c694c3d551cddb3b15c1b0d4787dae3c00530.tar.xz
HomeserverEmulator work
Diffstat (limited to 'Tests/LibMatrix.HomeserverEmulator/Program.cs')
-rw-r--r--Tests/LibMatrix.HomeserverEmulator/Program.cs12
1 files changed, 10 insertions, 2 deletions
diff --git a/Tests/LibMatrix.HomeserverEmulator/Program.cs b/Tests/LibMatrix.HomeserverEmulator/Program.cs
index 91e0f88..9ea6fce 100644
--- a/Tests/LibMatrix.HomeserverEmulator/Program.cs
+++ b/Tests/LibMatrix.HomeserverEmulator/Program.cs
@@ -1,6 +1,7 @@
 using System.Net.Mime;
 using System.Text.Json.Serialization;
 using LibMatrix;
+using LibMatrix.HomeserverEmulator.Extensions;
 using LibMatrix.HomeserverEmulator.Services;
 using LibMatrix.Services;
 using Microsoft.AspNetCore.Diagnostics;
@@ -10,8 +11,15 @@ using Microsoft.OpenApi.Models;
 
 var builder = WebApplication.CreateBuilder(args);
 
-// Add services to the container.
-builder.Services.AddControllers().AddJsonOptions(options => { options.JsonSerializerOptions.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull; });
+builder.Services.Configure<ApiBehaviorOptions>(options =>
+{
+    options.SuppressModelStateInvalidFilter = true;
+});
+
+builder.Services.AddControllers(options => {
+    options.MaxValidationDepth = null;
+    options.MaxIAsyncEnumerableBufferLimit = 100;
+}).AddJsonOptions(options => { options.JsonSerializerOptions.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull; });
 
 builder.Services.AddEndpointsApiExplorer();
 builder.Services.AddSwaggerGen(c => {