Category "serialization"

Django dumpdata serializing an int as string

I've been trying to make a custom class/type, defined in a separate db.py file, to be properly serialized as an int when doing a manage.py dumpdata command, but

Why am I getting a JsonDecodingException exception in kotlinx.serialization?

I'm trying to create a custom deserializer using kotlinx.serialization but when I deerialize a JSON payload with null parameters, an exception kotlinx.serializa

How to serialize multi-types Collection with IXmlSerializable

I'm writing an xml that seem decent to me but i have issue reading into last collection. Xml <SWorkspace Title="Default" NosWorkSpaceGuid="69c4d731-a44d-4

Laravel trying to save $appends attributes

I am coding on Laravel 6, and stumbled up on this problem. I have accessors for a field that i need in my model in some cases, but it does not exist in my datab

Can I serialize a class by casting it to a char*

In C++, can I cast a class or some data to a void*, then to a char* to serialize it? If so, how would I de-serialize? I don't really care about portability. cla

access objects in pyspark user-defined function from outer scope, avoid PicklingError: Could not serialize object

How do I avoid initializing a class within a pyspark user-defined function? Here is an example. Creating a spark session and DataFrame representing four latitu

Serialising order annotations for XML on Jackson does not work

I already googled this problem for almost a day and tried several fixes (including 4 or 5 from StackOverflow) but none of them worked. I have this POJO with ann

How do I serialize non-ascii characters in pykafka?

I have a defauldict I want to serialize as json. But some characters then replaced with unicode escaped charasters. For example, if I have string "International

Save multiple objects serializers only if both of them are valid

I have multiple serializers objects that comes from the request as json file. I want to store them inside databases only if they are Valid (all of them must be

Django. How to save serialized and validated data?

I have a Car model with name, model and serial number fields. In which the combination of the name and model fields must be unique. I am using serializers.Model

Pydantic enum field does not get converted to string

I am trying to restrict one field in a class to an enum. However, when I try to get a dictionary out of class, it doesn't get converted to string. Instead it re

MessagePack subtype serialization

Serialization/deserialization turns a collection of a base type with child-type items in it into a collection with base type items only. Is there a way to set u

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'id_utilisateur_id' cannot be null

I am a computer science student. And I have a problem while creating an API. Here is my controller allowing the addition of a "Personnage". (POST) #[Route('/api

Multiple objects serialization

I am making a ToDoList-Console app that needs serialisation of multiple objects. There are 2 task classes: Simple task Complex task I need a method that seriali

Jackson deserializer for generic type

I need to write a custom deserializer for a class with generics. I couldn't find a way to do this, however I cannot imagine I'm the only one with this problem.

Object of type <> is not JSON serializable Django REST Framework

I am trying to create a search function inside my class-based view using Django Rest Framework, but it does not seems to work. when I try to search for some cus

How to deserialize interfaces with Newtonsoft Json.Net

I have this class hierarchy : public class ProxyBotsSnapshotLogEntryDetails : IBotsSnapshotLogEntryDetails { public ICollection<IBotSnapshot> Snapsho

Fastest way to dump nested dict to the hard drive

I have a big (several Gigs) nested dictionary of this structure: { string1: {string1_1: int1_1, string1_2: int1_2, ...}, string2: {string2_1: int2_1, strin

Unable to load class exception during Kryo deserialization

I am using Kryo for serialization / deserialization and not registering classes beforehand (I am working on that). That said, upon deserialization, I am gettin

How to efficiently serialize python dict with known schema to binary?

I have a lot of python dicts with known schema. For example, the schema is defined as Pyspark StructType like this: from pyspark.sql.types import * dict_schema