2,398 questions
0 votes
1 answer
134 views
Deserializing array of objects to concrete .NET types using Newtonsoft
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<...
2 votes
0 answers
85 views
How can I accept a number with a leading 0 in .NET Core?
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 ....
0 votes
0 answers
47 views
OpenAPI Generator: Conflicting Kotlin property names with case-sensitive JSON properties
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 (...
0 votes
1 answer
110 views
ASP.NET Core model binding ignore extra JSON content
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 ...
0 votes
2 answers
66 views
How does a custom JsonSerializer concat multiple fields into a single string, using each field's own serializer during the concatenation in Jackson?
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 ...
0 votes
2 answers
122 views
Case insensitive JSON parameter names in FunctionsApplicationBuilder
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 ...
1 vote
1 answer
150 views
Jackson inheritence deserialize causing infinite loop
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 ...
0 votes
0 answers
50 views
Jackson MismatchedInputException when deserializing JSON into DTO with UUID attribute in Spring Boot Kafka Consumer
I send a JSON message like this to Kafka: `{ "userId": "aa4db80b-a047-4539-8393-f8cd0e9c10e7", "username": "user18", "email": "user18@gmail....
1 vote
1 answer
88 views
How is it possible to use kotlinx.serialization in a Kotlin Script?
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-...
0 votes
0 answers
25 views
Kivy JsonStore: can you customize its encoder that converts data structures to/from .json format?
I'm adding storage to my python Kivy application. My data involves many enums and nested dictionaries/sets so out-of-the-box, JsonStorage fails with errors like "TypeError: Object of type set is ...
0 votes
1 answer
71 views
How to make Deserialization work with a private field?
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"...
0 votes
1 answer
385 views
"invalid type: map, expected a sequence" when deserialize a JSON structure with serde_json
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 ...
0 votes
1 answer
72 views
Spring data elastic search custom conversions doesn't work
Custom @ReadingConverter isn't being triggered but when I was initially implementing this code it worked normally. Configuration class: @Configuration public class ElasticsearchConfig { @Bean ...
1 vote
1 answer
292 views
DataMember Name attribute ignored when deserializing a JSON object
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 ...
-1 votes
1 answer
147 views
How to Deserialize JSON into C# objects correctly?
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: ...