From 508c694c3d551cddb3b15c1b0d4787dae3c00530 Mon Sep 17 00:00:00 2001 From: Rory& Date: Thu, 2 May 2024 07:20:13 +0200 Subject: HomeserverEmulator work --- Tests/LibMatrix.HomeserverEmulator/Program.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Tests/LibMatrix.HomeserverEmulator/Program.cs') 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(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 => { -- cgit 1.4.1