system.text.json Questions
1
Solved
I want to support partial updates with JSON Merge Patch. The domain model is based on the always valid concept and has no public setters. Therefore I can't just apply the changes to the class types...
Shifrah asked 7/2, 2022 at 19:8
5
I am trying to parse below json using System.Text.Json.JsonDocument
[
{
"Name" : "Test 2",
"NumberOfComponents" : 1,
"IsActive" : true,
"CreatedBy" : "bsharma"
},
{
"Name" : "Test 2",
"Nu...
Handiness asked 1/4, 2020 at 16:37
2
I have DTO class that has a property of type JObject. This DTO class is send/receive over HTTP between multiple services. JObject is used because the ExtractedData does not have predefined properti...
Stiff asked 7/1, 2021 at 21:16
1
Solved
I have JSON in a response structured like this
{
"statusCode": 200,
"result": {
"generalInfo": {
"firstName": "",
"lastName": "...
Inadvertence asked 6/2, 2022 at 10:27
4
Solved
While migrating to .NET Core 3 I've switched from Newtonsoft.Json serialization to System.Text.Json.Serialization. Of all the features I want to continue using JsonPropertyName attribute.
Newtons...
Encomium asked 2/12, 2019 at 7:47
1
Solved
How are custom JsonConverter<> classes used together with System.Text.Json source generator?
I would like to call JsonSerializer.Deserialize<MyType[]>() that doesn't fallback to a refle...
Hushaby asked 17/12, 2021 at 11:56
1
Solved
I'm migrating an ASP.NET Core 2 application to ASP.NET Core 3. My controllers need to return objects that have a property which is already a JSON string, so it looks something like this:
public cl...
Hanse asked 30/3, 2020 at 13:40
4
Solved
In an earlier question of mine I asked how to populate an existing object using System.Text.Json.
One of the great answers showed a solution parsing the json string with JsonDocument and enumerate ...
Anzus asked 1/12, 2021 at 19:18
1
Solved
I'm working on an ActivityPub implimentation in c#, and sometimes links are "strings" like a url link, and sometimes links are objects with a Link sub-type. (Link : Entity)
I'm wondering ...
Kinky asked 6/12, 2021 at 22:38
1
tl;dr:
How can I add the DateOnly JsonConverter to the application configuration of a .net6 web api?
I have an object with DateOnly properties on it and I'm returning it from the controller. When I...
Androsphinx asked 24/11, 2021 at 16:35
1
Solved
I have tried to implement Source Generation-based JSON serilization, based on MS Docs: How to use source generation in System.Text.Json. My code is as follows:
using System;
using System.Text.Json;...
Fifty asked 16/11, 2021 at 15:40
2
Solved
I begin c# and Deserialize Json. In my training I studied Newtonsoft, but I would like to do the same with system.text.json
With this json, I want to select
searchedProducts > featuredProduct
A...
Snocat asked 21/7, 2021 at 19:37
4
Solved
Using JsonSerializer.Serialize(obj) will produce an escaped string, but I want the unescaped version. For example:
using System;
using System.Text.Json;
public class Program
{
public static void ...
Dean asked 19/9, 2019 at 3:23
2
Solved
I have an object of type JsonElement that contains data returned by an API. I want to get the value of a certain property but the problem is that TryGetProperty is case sensitive.
Is there a way or...
Proprioceptor asked 26/8, 2020 at 13:29
0
Task:
I am going to provide endpoint for 3rd party push notifications utilizing asp.net core 5.0.
Push notifications have different types and schemas. These notifications need to put in mysql datab...
Dehydrogenate asked 12/10, 2021 at 9:59
1
System.Text.Json default to number the enum serialization. In my case I need the string for that in the Startup.cs I add a converter to get all the enum serializing to string as is show here....
Masonmasonic asked 16/9, 2021 at 15:55
1
Solved
I accidentally introduced a breaking change in my API by switching to System.Text.Json in my ASP.NET Core app. I had a client that was sending a JSON document and was using numbers 1 or 0 for boole...
Cornhusk asked 6/8, 2021 at 13:31
2
Solved
How to configure a default JsonSerializerOptions (System.Text.Json) to be used by Azure Function v3?
I have a set of Azure Functions v3 running on .net core 3.1.
I have a custom configuration of JsonSerializerOptions that I want to be used automatically by my functions when de/serializing data.
...
Mathews asked 7/3, 2020 at 4:37
3
Solved
My sample code is very simple:
using System.Text.Json.Serialization;
using Newtonsoft.Json;
public class C {
public C(string PracticeName) { this.PracticeName = PracticeName; }
public string Pr...
Drogin asked 7/6, 2019 at 0:2
1
Solved
I am trying to serialize an object into a MemoryStream using System.Text.Json's JsonSerializer. I am unable to find the implementation/method of that in the documentation. Can someone share the sam...
Morphophoneme asked 23/7, 2021 at 6:4
2
Solved
I have an enum:
public enum TaxType : byte
{
None = 0,
GSTCanada = 5,
HSTOntario = 13,
HSTOther = 15
}
It is given in the json by a number. Eg:
{"TaxType": 13, ...}
public class Ord...
Karnak asked 15/7, 2021 at 16:45
2
I added NewtonsoftJson as middleware in .net core 3.1. I would love to move over to new System.Text.Json serializer.
I can´t just jump over but is there way to use the one from System.Text.Json i...
Anybody asked 26/5, 2020 at 20:30
3
Do you have any advice on how we can serialize DataSet,DataTable with System.Text.Json.JsonSerializer ?
Currently it throws this exception :
'A possible object cycle was detected which is not suppo...
Moersch asked 17/1, 2020 at 2:33
1
Solved
I was reading this MSDocs article about DateTime-related format support
https://learn.microsoft.com/en-us/dotnet/standard/datetime/system-text-json-support#support-for-the-iso-8601-12019-format
And...
Jollanta asked 6/6, 2021 at 8:10
0
I have .net 5 api which works on my machine but not on Azure App Service. It looks like its failing to write the response and following is the Exception stack trace and Startup code. I am using Sys...
Uncinariasis asked 20/5, 2021 at 13:11
© 2022 - 2024 — McMap. All rights reserved.