C
C#2y ago
DeaDo

ASP Minimal API Deserializor - allow Fields

app.MapPost("/update", ((int[] cities, double distance) newBest) =>
app.MapPost("/update", ((int[] cities, double distance) newBest) =>
I want my minimal api to be able to deserialize that tuple. The System.Test cant do that by default though. Typically i fix that with those serializor options, but i dont know how to provide my settings for the minimal api
var serializerOptions = new JsonSerializerOptions { IncludeFields = true };
var serializerOptions = new JsonSerializerOptions { IncludeFields = true };
2 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
DeaDo
DeaDo2y ago
thanks