33,544 questions
1
vote
1
answer
85
views
Serializing of polymorphic json in ASP.NET Core 10
I want to use polymorphic JSON for the RichText type in .NET 10 because I plan migrating from one richtext format to another and I am stuck with a problem: when the object is automatically serialized ...
1
vote
1
answer
111
views
kotlinx-serialization-json 1.9.0 library causes compile error "Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin."
After adding the dependency org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0 I tried using it like this:
import kotlinx.serialization.Serializable
import kotlinx.serialization.json.Json
@...
1
vote
1
answer
84
views
Callback methods with ProtoBeforeSerialization/ProtoAfterDeserialization donot work in protobuf-net 3.2.26, even when assigned explicitly to MetaType
I'm upgrading from protobuf-net 2.2.1.0 to 3.2.26, and I've noticed that callback methods decorated with [ProtoBeforeSerialization] and [ProtoAfterDeserialization] are no longer invoked during ...
7
votes
1
answer
148
views
Records don't deserialize cycles
I stumbled upon something that got me curious. Apparently, serializing a record with a cyclic reference does not retain the cycle when deserializing it again, it becomes null. When doing the same ...
0
votes
0
answers
68
views
DiskReadViolation on Ktor with json negotiation
My StrickMode and Ktor HttpClient setup on Android
import io.ktor.client.plugins.contentnegotiation.ContentNegotiation
import io.ktor.serialization.kotlinx.json.json
override fun onCreate(...
3
votes
1
answer
174
views
How to use Pydantic field in another field for serialization/deserialization purposes
I would like to solve the following problem with Pydantic (latest version), with Python 3.x.
While deserializing, I want to use the field "path", path contains another array that I want to ...
1
vote
2
answers
52
views
Flink GenericType List serialization
In my Flink app, I found this log:
Field EnrichmentInfo#groupIds will be processed as GenericType. Please read the Flink documentation on "Data Types & Serialization" for details of the ...
2
votes
1
answer
150
views
Deserializing Interface Types in C# projected on records
I'm deserializing interfaces mapped to usual classes with a custom IJsonTypeInfoResolver. The resolver looks similar to this:
public class InterfaceMappingResolver : IJsonTypeInfoResolver
{
...
0
votes
1
answer
203
views
Use msgspec to (de-)serialize Python objects without hard-coding serialization library in data classes
I want to use JSON to serialize and deserialize a complex Python object. This Python object contains other Python objects that may be implementations of a protocol or descend from a common abstract ...
1
vote
2
answers
107
views
Deserializing Java object streams with different serial version IDs
I am trying to load data from Java object streams from another application. Since I do not have access to the source code of that application, I used jdeserialize to extract the class definitions from ...
0
votes
1
answer
119
views
Confusions with how Laravel's Job serialization and deserialization works
What happens to the model's eager-loaded relationship when the model is passed to another Job's dispatch method?
Context:
There is a job that retrieves all ongoing games and this job should create an ...
0
votes
0
answers
221
views
C# MessagePack serialization/deserialisation while maintaining object reference
I am using MessagePack version 3.1.4 for binary serialization/deserialization. With the most basic code and decorating my fields/properties with the Key attribute:
public static byte[] Serialize<T&...
3
votes
1
answer
228
views
How can I iterate over struct fields at compile time in Zig to generate a serializer?
I'm learning Zig and I'm trying to write a generic function that automatically serializes any struct into JSON. In languages like Rust or Go, there are libraries that can iterate over the fields of a ...
1
vote
0
answers
70
views
Kotlin serialize simple class with explicit Serial Name
I've tried to use kotlinx.serialization with the third party Yaml plugin from @charleskorn.
In the past I already did something with Python using pyyaml, where I explicitly set a custom yaml_tag for ...
0
votes
0
answers
70
views
ASP.NET Web API - Model binder validation property name
I have a basic ASP.NET Web API project. When I send a request, the serialization is done using System.Text.Json. However, when I send a non-valid json, for example text instead of number, it returns a ...
0
votes
0
answers
128
views
Could not load file or assembly 'System.Runtime.Serialization.formatters' in .NET 8 WinForms application
I get the error
System.IO.FileLoadException: 'Could not load file or assembly 'System.Runtime.Serialization.Formatters, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Could not ...
0
votes
0
answers
66
views
Spring boot: Jackson won't parse concrete type
I'm using Spring Boot (latest version).
I have this 4 classes. SubtypeDTO inherits from abstract class TypeDTO, ClassUsingSubtype uses SubtypeDTO and ClassUsingType uses TypeDTO. I need all of them!
@...
1
vote
0
answers
60
views
How to deserialize JSON in C#? Is the input format data correct? [duplicate]
I need to deserialize a JSON data containing list of players into a regular List<> type (in C#). My code is:
public async Task<Player2> RetrievePlayerListFromServer()
{
...
4
votes
1
answer
45
views
C Contact Manager: Email fields shift into next contact's data when loading from file
Problem Details:
I'm developing a C contact management system where each contact is stored as:
struct Contact {
char name[31];
char number[11];
char email[30];
};
Current Behavior:
When ...
0
votes
0
answers
73
views
C# When deserializing a Json, how to avoid a specific property being deserialized into? [duplicate]
Having trouble finding the right way to describe the issue to find a solution for it. But here's a quick rundown.
I'm using Newtonsoft Json plugin for the following:
A Json is being deserialized based ...
0
votes
0
answers
92
views
Is there a way in TypeScript to do custom JSON deserialization within a class?
The Goal
I am working on a project where we have id's comming back from the server in a format that is a prefix followed by a guid (prefix_{guid}). This is so that we know what the specific ID type is ...
3
votes
0
answers
112
views
How can i fix a deserialization problem with Rust Serde? [closed]
I have a code that tries to deserialize a json response into a struct, the struct is like this:
pub struct Message {
pub body: String,
#[serde(rename="sendAt")]
pub send_at: ...
0
votes
1
answer
94
views
Deserialize JSON with multiple variable names to VB.NET object
I currently am trying to deserialize a JSON-object to a VB.NET-object. But I am not able to do that properly - but I guess I know the reason for it. Here is an example of my JSON-object:
{
"...
3
votes
1
answer
81
views
Why can’t I pickle an object that references a function defined inside another function?
I’m trying to pickle an object that holds a reference to a function defined in a local scope.
Pickle fails, even with dill or cloudpickle.
What are the technical reasons for this, and is there a ...
2
votes
0
answers
86
views
JavaFX serialization, inheritance and generic types
So I have a class that implements a JavaFX ObservableMap which maps Integers to a generic type T, and I want to serialize that, but it happens that this is an abstract class and what I will in fact ...