Questions tagged [serialization]
Serialization is the process by which data-structures are converted into a format that can be easily stored or transmitted and subsequently reconstructed.
32,182
questions
0
votes
0
answers
9
views
Serialization- How to store multiple objects in a file
I am making an Email Client(for class) and i want to store the messages i send everyday in a single file.I am going to use serialization for this.I tried appending to a file by setting append to true ...
0
votes
0
answers
18
views
urlencode a list of string pairs, and deserialize in Java to a List<Pair<String, String>>
I have a Spring Boot RestController with a GetMapping. For historical reasons, it cannot "just become a POST", and it must support the List of Pairs below. It doesn't literally have to be a ...
0
votes
0
answers
8
views
How to serialize metpy (pint) units for use with dask distributed?
How can I properly serialize metpy units (based on pint) to work with dask distributed? As far as I understand, it looks like dask distributed automatically pickles data for ease of transfer, but ...
0
votes
0
answers
29
views
Unable to serialize custom attribute in System.Text.Json
There is a custom attribute I created that I prescribe to classes for the markup extension.
I used to use the serialization mechanism through Newtonsoft.Json and I want to switch to Text.Json, but I ...
0
votes
0
answers
21
views
How to use serialization to maintain a file to store objects
I've looked at many places on serialization but can't seem to find a solution to my problem. I'm making an Email client program and I want to store every email I send as an object in a file and then ...
0
votes
0
answers
10
views
Serializing stored json object gives null pointer hibernate vladmihalcea / hibernate-types
I'm saving a java object as json in my db. For this implementation when I save it, it works fine and I can find the new row in my db. However whenever I try to fetch the same object I stored, I get ...
0
votes
1
answer
20
views
Serial.serial is not working, thonny: module 'serial' has no attribute 'Serial'
I just started with Ardunino, Python and a serial Communication between RPI and Ardunio (using Thonny). I checked out some tutorials (e.g https://roboticsbackend.com/raspberry-pi-arduino-serial-...
-1
votes
1
answer
21
views
Serialization throws InvalidClassExceptionn
I'm new serialization (and programming in general) so i don't really know what happens under the hood. I'm making an email client program and the class
FileHandlerObject is used to write and read ...
0
votes
2
answers
25
views
Kafka serialize a java object with a list of object/LocalDateTime into byte[]
I've just started learning Kafka and have ran into some troubles when trying to send an object using kafka template. The custom serializers online all seems to use objectMapper.writeValueAsBytes(); to ...
-2
votes
0
answers
28
views
How to overwrite existing data when deserializing collection properties in Newtonsoft
My original intention was to have an alternate name AnotherNameList for the property NameList, ignoring the AnotherNameList data if the NameList contains data, using the AnotherNameList data if the ...
0
votes
1
answer
29
views
when i use json.net,how to deserialize String to .net Object by customized JsonConverter
example , items in expressions maybe string ,number or a Object, how to deserialize it to.net Object. I do not know how to definition .net class and do not know to implement JsonConverter.
{
&...
0
votes
0
answers
21
views
VB.Net Deserializing JSON to Datatable is Empty
Public Shared Function GetVolsForMU(ByVal MU As String) As DataTableReader
Dim dataSet As New DataSet
Dim responseData As String
Try
Dim request As HttpWebRequest
Dim ...
0
votes
0
answers
17
views
tobytes() not preserving dimension information of numpy array generated from PyTorch tensor
Using a simple feature extractor in PyTorch I generate a (1,512) features vector from a (200,200,3) RGB image. I want to serialise these features using ndarray.tobytes() for storage purposes and ...
0
votes
0
answers
13
views
How can I create a class to receive JSON information if one of the properties is called "public"?
I'm making an integration to POEditor API where I have to receive a result from an API call. When I'm listing out the projects, I get back a list of projects as a result. A project looks like this:
{
...
0
votes
4
answers
57
views
JSON convert array type to list in C#
I have some array data coming from an API in JSON format, and I want to convert an array type to a list. There is an ASP.NET MVC project and I used the list in Index page. How can I deserialize the ...
0
votes
0
answers
14
views
Extract substring from PHP-serialised array in PostgreSQL query
I have a column in my PostgreSQL 14 DB that has a PHP-serialised array structure like this:
a:1:{s:6:"host";i:7;}
Is there a way I can extract the integer "7" from this column in a ...
0
votes
1
answer
21
views
django restframework object-level-validation
These are my models : Test, Skillarea, question
MODELS.PY :
class Test(BaseModel):
types = models.ManyToManyField(
TestType,
related_name='tests',
)
title = models....
0
votes
0
answers
24
views
UserSettings can't serialize custom type as XML, only binary
I have a ApplicationSettingsBase object I use to save user preferences, as well as application settings. For all of my built-in types, it properly serializes to XML and I get a nice user-editable ...
0
votes
0
answers
14
views
AWS Lambda Kinesis Stream Trigger Filter criteria with Glue schema registry event
I have created lambda with Kinesis stream as trigger for Lambda. and also have Filter criteria added to start Lambda if event from stream matches provided filter criteria.
I push json payload on ...
0
votes
1
answer
18
views
Python dill.dump fmode parameter seems to have no effect
I'm experimenting with dill, specifically different modes of dill.dump(). The documentation for the fmode parameter indicates that using FILE_FMODE or CONTENTS_FMODE will pickle the file contents, ...
-1
votes
1
answer
45
views
Serialize class with object field as boolean
I have the following class :
public class Variable
{
// lower case to generate JSON we need
public string Name { get; set; }
public string Type { get; set; }
public object Value { get;...
-1
votes
1
answer
35
views
Serializing / De-serializing inherited class on a procedural generated loot system (Unity C#)
I have a class called Item that has general info about the item (Name,ID, description)
I inherit from this class to create procedurally Armor / Weapons in my game.
Eg:
[System.Serializable]
public ...
0
votes
0
answers
21
views
how to make serializer for two models that dont have relation with each other
i am working on ecommerce shop and in my home page i want to return all the products and 7 images for the icons for the categories , my models.py is
class Product(models.Model):
pub_date = models....
0
votes
1
answer
35
views
Problem in Serialization java spring boot
I have a problem in serialization.
This is my DTO class:
@Data @AllArgsConstructor @NoArgsConstructor
public class ChoicesResponseDTO extends ResponseDTO {
private Long idR;
private ...
-1
votes
0
answers
11
views
webapi NetCore json returns only last element of each nested list
The problem: I am trying to match a given signature of an API to replace the underlaying implementation.
I created the proyect as dotnet new webapi and duplicated the controller.
My new controller ...
0
votes
1
answer
23
views
Serialize entity into DTO using SpringBoot and Lombok
I currently recieve a POST request with a JSON that is serialized into Cobranca entity by SpringBoot with lombrok getter and setter.
I want to serialize this entity into a CobrancaDTO that latter will ...
0
votes
0
answers
33
views
Generate Avro schema for java <Object> type
I'm using jackson-avro to generate schema for my POJO. The POJO has this field:
List<List<Object>> data
This is basically how the data form the database is returned, the above nested List ...
0
votes
0
answers
24
views
Java/Jackson - Reading dynamic key from JSON hashmap key value pair in Java
I am currently trying to deserialize a JSON file in Java using the Jackson library.
I have a class called BookUtil which holds 2 functions, one to load a hashmap using the json file. The other ...
0
votes
0
answers
12
views
Is there a delta serialization when saving blueprint to .uasset file in unreal engine?
In unreal engine, there is net delta serialization in network replication. I want to know whether UE uses delta serialization when saving blueprint to .uasset file on the disk. Is there undo/redo ...
1
vote
0
answers
60
views
How to create an object of proper type elegantly from the given input?
I get packets from the network that looks as follows in the following DTO form:
data class ContentElementField(
val text: String? = null,
val style: String? = null,
val imagePath: String? =...
1
vote
1
answer
40
views
How to serialize DateOnly using refit.?
I'm searching for this since 3-4 days I've almost got the answer but still I can't implement in my code.
Actually I never understand or can't work by seeing the documentation. :/
And I need another ...
0
votes
0
answers
20
views
XML Deserialization when child element is different via abstract class
I have a network call in my application based on input; i would get below 2 slightly different XML
XML 1:
<entry xml:base="https://www.w3.org" xmlns="http://www.w3.org/2005/Atom"...
0
votes
1
answer
23
views
serializer showing name of model
I want to serialize data from nested queryset:
I have working code but output from serializer showing too many data. I want hide this for security reason.
example output:
(...)
"gallery": &...
1
vote
2
answers
42
views
How do you serialize a list of BufferedImage in Kotlin?
I'm trying to implement a protocol where (part of it) is sending a list of small images over a socket. I'm using JSON and the images are base64 encoded.
Here's the data classes
@Serializable
sealed ...
-1
votes
0
answers
11
views
Hi, can somebody to help me to serializing in getServerSideprops?
i attached my error and code source below
i attached my error and code source below
0
votes
1
answer
24
views
ClassCastException occurs while trying to deserialize the serialized object
I am trying to deserialize the object in java and I am receiving this error [ClassCastException] constantly. The object is serialized but desrialization is not working.
I think there is no error in ...
0
votes
0
answers
25
views
DRF Serializers. Different fields on serialize and deserialize methods
What is the best approach to have the same field name in Serializer but different behaviour on serializing and deserializing data? (I want to put only group_id on input and get full related info on ...
0
votes
0
answers
16
views
How to Deserialize Datetime in Mongodb CSharp Driver
I'm using Mongodb in my .NET 6 project.
Data in Mongodb like this "Wed Jun 13 09:00:07 UTC 2007"
So if type of Create At property is DateTime
[BsonElement("created_at")]
...
-1
votes
0
answers
28
views
How can I make the following code use JSON serializer instead of the JDK one?
I tried to use the following configuration class in SpringBoot to serialize the session content in JSON format, but it seems not working. The beans were instantiated, but the serialize and ...
0
votes
0
answers
14
views
Download RDLC report as pdf file throws The ‘ObjectContent`1' type failed to serialize the response body for content type in Windows Server 2016
I am working on an application where I wanted to download a RDLC report as a pdf file using Web Api. I have written the below code and it works fine in Dev (Windows Server 2012 R2/IIS Version 8.5) but ...
1
vote
0
answers
27
views
How do you efficiently send Integers from Arduino to a Visual Studio C# form to control a mouse on computer?
I am very new to all of this, so bear with me.
I am trying to create a makeshift vr headset where I send accelerometer values over Bluetooth using the serial port. These values will them be separated ...
0
votes
1
answer
40
views
json serialization with inheritance in dart
I am using json annotation package to generate the json serialization boilerplate code. I have Base class
@JsonSerializable()
class UIWidget {
double? size = 50;
List<UIWidget> children = ...
0
votes
0
answers
22
views
How have Jackson use toString method if object have no public accessors?
I am looking for a solution that have Jackson use toString method whenever it can not serialize an object type.
Let me explain more detail.
I have a class:
@AllArgsConstructor
public class TestJackson ...
3
votes
0
answers
47
views
Deserialize empty string as null with kotlinx.serialization
I'm writing a client for a third-party REST API that returns JSON with a variety of alternative values instead of proper null or omitting the property entirely if null. Depending on the entity or even ...
-1
votes
0
answers
21
views
How to serialize List<IObjectType>? [duplicate]
I need to serialize a List of IObjectType. I know that can't be done directly, but are there any workarounds? I need all included objects in editable format, because that is a config file)
...
0
votes
0
answers
22
views
Jersey - error when trying to access to variable of response object
I have a class
public class ResponseBean extends PaginatedResponse<ItemBean> {
public ResponseBean( ) {}
}
which doesn't modify any behavior of the superclass, and the superclass is
public ...
0
votes
0
answers
40
views
.NET Newtonsoft JSON serialization: Ignore static (abstract) attribute
Problem: Static class members are being serialized when they actually should not.
Note that I have the preview features activated which enables me to use static abstract attributes in interfaces. To ...
-1
votes
2
answers
27
views
Deserializing a simple array from json to add to combobox C#
I'm trying to list the following array from a json file into items in my combobox.
{
"label_selection" : ["Label A","Label B","Label C","Label D",&...
-5
votes
2
answers
56
views
Why the output of the filed name is "Tom” instead of "null"? [closed]
Note: The field name is static
public void test3() {
ObjectOutputStream oos = null;
ObjectInputStream ois = null;
try {
oos = new ObjectOutputStream(new ...
1
vote
1
answer
35
views
System.Text.Json.Serialization replacement for Netwtonsoft's JsonObjectAttribute NamingStrategy setting
For those of you who have done more .NET 6 than me, have you found a replacement for Netwonsoft's JsonObjectAttribute's NamingStrategy setting?
[JsonObject(NamingStrategyType = typeof(...