Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
67 views

When I run System.Text.Json.JsonSerializer.Deserialize<Dictionary<string, object>> all values are converted to JsonElement, instead of the actual value. I expect numbers to be converted to ...
Eric's user avatar
  • 2,440
1 vote
1 answer
196 views

I would like to be tolerant if the JSON payload contains a type my app doesn't know about. Ideally I would like to get information about the errors along with the deserialized object, but at a minimum ...
default.kramer's user avatar
9 votes
1 answer
4k views

I have a Spring Boot 4 project with the below controller and DTO: import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org....
Saravana Kumar M's user avatar
2 votes
1 answer
154 views

I have a couple of ISerializable classes (simplified): internal interface IBase : ISerializable { int Number { get; } } internal interface ITable : IBase { ISection Section { get; } } [...
bairog's user avatar
  • 3,593
3 votes
1 answer
179 views

I have a couple of classes (simplified): internal interface ITable { int Number { get; } ISection Section { get; } } internal class Table : ITable { public int Number { get; private init; ...
bairog's user avatar
  • 3,593
0 votes
1 answer
150 views

I have a couple of classes (simplified): internal class OrderItem { public string Name { get; set; } public Order Order { get; set; } } internal class Order { public IReadOnlyList<...
bairog's user avatar
  • 3,593
2 votes
0 answers
91 views

I'm responsible for maintaining a public ASP.NET Core 8 Web API. One endpoint accepts POST data like this: { "xid": 12345, "message": "Hello, world!" } On the ....
Nat Webb's user avatar
  • 738
0 votes
0 answers
81 views

I'm using OpenAPI Generator to generate Kotlin DTOs from an OpenAPI specification. I have a schema where I need to handle two JSON properties that differ only in case: inventoryCharacteristics (...
PaoloAgVa's user avatar
  • 1,501
0 votes
1 answer
121 views

ASP.NET Core Web API endpoint accepts malformed JSON with multiple objects, but only processes the first object, instead of rejecting the request. The API endpoint I'm working on should accept only a ...
Sumrender Singh's user avatar
0 votes
2 answers
78 views

I am learning to use Jackson's custom serialization and deserialization capabilities to handle the DatePair class. I hope to concatenate the fields of DatePair into a single string. Here is a MCVE ...
Guo's user avatar
  • 1,823
0 votes
2 answers
173 views

I have scaffolded an Azure Functions application using .NET 9. The Program.cs file looks like this: using Microsoft.Azure.Functions.Worker; using Microsoft.Azure.Functions.Worker.Builder; using ...
SuperMe's user avatar
  • 113
1 vote
1 answer
188 views

I'm trying to deserialize JSON data into Animal.class and Dog.class which extends Animal.class using custom deserializer. The JSON data below is a simplified one and the real JSON data cannot be ...
evol1102's user avatar
0 votes
0 answers
65 views

I send a JSON message like this to Kafka: `{ "userId": "aa4db80b-a047-4539-8393-f8cd0e9c10e7", "username": "user18", "email": "user18@gmail....
Harsha Dankotuwa's user avatar
1 vote
1 answer
136 views

I would like to write some easy code like: @Serializable data class Mydata(val value: String) val data : Mydata = Json.decodeFromString(rawJson) But how can this be made possible inside a stand-...
Rene's user avatar
  • 4,063
0 votes
1 answer
77 views

I'm wanting to only expose a list as ReadOnly but it's, but while trying to accomodate that for Deserialization, it's not currently working. Firstly, to confirm Serialization: { "StartTime"...
MrGreggles's user avatar
  • 6,205
0 votes
1 answer
526 views

I can't catch the error cause. I have used the same procedure with other similar commands using the following tool: transform JSON to RUST Another post takes the problem, but a don't understand the ...
rabolon's user avatar
  • 11
0 votes
1 answer
94 views

Custom @ReadingConverter isn't being triggered but when I was initially implementing this code it worked normally. Configuration class: @Configuration public class ElasticsearchConfig { @Bean ...
solujic's user avatar
  • 1,055
1 vote
1 answer
424 views

I have an issue deserializing a JSON object into my class. I have a class DocumentListByPolicy that is used as a List<> in another class. For the document list, this is my code: namespace ...
JimboJones's user avatar
-1 votes
1 answer
172 views

I have a function that calls API requests, and I want to have each request return its own data type according to its purpose. For that, I created a class called ApiResponse. Here is its code: ...
Avraham Cohen's user avatar
0 votes
1 answer
286 views

I have a class that implements IReadOnlyCollection<T> and I cannot deserialize json string produced during the serialization: public class MyItems : IReadOnlyCollection<int> { private ...
grim.ub's user avatar
  • 212
0 votes
1 answer
291 views

I'm calling JsonSerializer.Deserialize(ref reader, options), but for some reason it isn't working. public class WeatherForecastJsonConverter : JsonConverter<WeatherForecast> { public ...
CaseyHofland's user avatar
0 votes
1 answer
137 views

I have a scenario I need to set ApplicationProperties to a Azure Service Bus message. I have dictionary of key, value type <string,object>. I also use System.Text.Json for deserializing the ...
binga58's user avatar
  • 107
0 votes
2 answers
93 views

I have a class A that has a field string data. I perform a server request that gets me a json text that I convert to A: var a = JsonConvert.DeserializeObject<A>(jsonResponse); The problem is ...
Daniel's user avatar
  • 7,810
3 votes
1 answer
121 views

So to be clear I am going to present a working solution to that problem using Newtonsoft.Json 13.0.3. Said solution does not look very good and I am looking for a better one. Some context, this is ...
OeilDeLance's user avatar
0 votes
1 answer
61 views

I’m developing a Crystal application and consuming an API that inconsistently uses PascalCase for some of its endpoint properties, rather than camelCase. Unfortunately, this causes issues with JSON::...
Tyler's user avatar
  • 20.3k
0 votes
1 answer
119 views

I have added a custom json converter to trim all strings coming to the web api during de-serialization, like this options.JsonSerializerOptions.Converters.Add(new TrimStringJsonConverter()); And this ...
Pawan Nogariya's user avatar
-1 votes
1 answer
56 views

I am creating an API to receive data from a webhook and process it. I've set up a class to contain the POST data and can access all but one of the fields - the groups, which is set up as a string ...
gingawarrior's user avatar
0 votes
1 answer
59 views

I have this class definition: public class TrabajadorViewModel { public int ID { get; set; } [Display(Name = "Habilitado")] public bool Habilitado { get; set; } [Display(...
jstuardo's user avatar
  • 4,564
-1 votes
1 answer
328 views

I am trying to insert user record using mysql database Customer.java @Entity @NoArgsConstructor @AllArgsConstructor @Data public class Customer { @Id @GeneratedValue(strategy = GenerationType....
Mahesh Guduru's user avatar
1 vote
2 answers
88 views

I'm getting json data from server API to Android app (Kotlin Serialization + Retrofit) I need to parse a Json with field errors. The issue is the structure of this field. If there are no errors I get ...
Dmitry Vinogradov's user avatar
1 vote
0 answers
88 views

I have problem inside a custom JsonConverter that I am potentially catching multiple errors (through attempting to deserialize the JSON, and if it fails, remove the offending propertry and try again) ...
SventoryMang's user avatar
  • 10.5k
0 votes
1 answer
54 views

I'm working on API on the .NET Windows form. I copied the code from the website provided and I found an error say: Cannot apply indexing with [] to an expression of type 'object' How to fix this? ...
waleed's user avatar
  • 53
1 vote
0 answers
35 views

Let's imagine I have the following classes: data class MyClass1( val someField1: String, val myClass2: MyClass2?, ) data class MyClass2( val someField2: String, val someField3: String?, ) ...
Elektor's user avatar
  • 101
0 votes
0 answers
38 views

In VB .Net, I use System.Json to (de)serialise a class called Model. This class has a list of changes, where a change has three properties: PropertyName, OrignalValue and NewValue. The PropertyName ...
Chiel's user avatar
  • 119
-2 votes
1 answer
169 views

I want JsonConvert.DeserializeObject<CustomType>("") to be deserialized to new CustomType() but this is always deserialized to null. this is using Newtonsoft json, have tried using a ...
Kaushik Ravi's user avatar
1 vote
0 answers
196 views

I have a bunch of POCOs that can be (de-)serialized from/to json. A lot of content is collections. I want the serialized JSON to only contain a specific property if its collection is not empty (...
Kjara's user avatar
  • 2,966
-2 votes
2 answers
129 views

I want to use a 3rd party (external) class instance in a class but I am getting this error on deserialization: Cannot construct instance of org.springframework.data.geo.Point (no Creators, like ...
Eric's user avatar
  • 468
2 votes
1 answer
360 views

I want to customize JsonNullable<Boolean> deserialization process. So I've found the class JsonNullableDeserializer : I've implemented my own deserializer: public class ...
gstackoverflow's user avatar
0 votes
1 answer
481 views

I need to deserialize a 1GB json file one element at a time in a streaming fashion and after doing some reading found JsonSerializer.DeserializeAsyncEnumerable to enable this while also keeping the ...
DeanOfHouseAkin's user avatar
1 vote
1 answer
87 views

Currently I am getting an exception when deserializing a codestable typed class. Imagine the following scenario: public abstract class AbstractCodestableEntry implements java.io.Serializable { ...
Chris Brown's user avatar
1 vote
1 answer
213 views

I have a JSON like this: { "part_1": "", "part_2": "", "part_3": "", "part_4": "", "part_5"...
Phonex Alica's user avatar
0 votes
1 answer
79 views

I have a JSON string something like below: [ { "movie title": "The Matrix", "release date": "1999-03-31", "movie rating": 8.7, "...
kyeleswarapu's user avatar
0 votes
0 answers
491 views

I am new to custom serialization/deserialization and also using it in Kafka is even more new for me. I am trying to explain what I am doing and also what I want to achieve. Please comment if you need ...
anurag tripathi's user avatar
0 votes
1 answer
122 views

I am attempting to deserialize a geojson FeatureCollection. The API I am querying returns this feature collection with additional properties on the type. The properties are used for cursor-based ...
David H's user avatar
  • 31
0 votes
1 answer
166 views

Try to write a generic macro for deserialising case classes using uPickle read in Scala 3: inline def parseJson[T:Type](x: Expr[String])(using Quotes): Either[String, Expr[T]] = '{ try Right(...
RobertJo's user avatar
  • 125
17 votes
4 answers
3k views

I am working on a project that utilizes Jetpack Compose Navigation with Type-Safe Navigation. Within my application, I have an composable function responsible for hosting the navigation graph. Here's ...
Inidam Leader's user avatar
1 vote
0 answers
48 views

I'm using .NET's native JSON utilities (System.Text) to perform automatic Serialization/Deserialization of data going to and from an API. The API responses are structured like the following: { &...
jmkmay's user avatar
  • 1,516
2 votes
1 answer
2k views

I'm trying to use Jackson's feature to deserialize unknown fields into a map, using @JsonAnySetter. This works fine for a Java class with the field annotated with @JsonAnySetter, but does not work ...
Kkkev's user avatar
  • 4,955
0 votes
1 answer
135 views

I'm currently working on a full stack application that has never had to be conscious of time zone, but looks like it will soon need to be a bit more versatile in terms of being aware of local time ...
marcuthh's user avatar
  • 606
1 vote
1 answer
921 views

Hi everyone I have the following code that I use to serialize into json strings to store in shared preferences interface Serializer { public fun <T> serialize(data: T, type: Class<T>): ...
Abdelrhman Talat's user avatar

1
2 3 4 5
49