8,202 questions
0
votes
0
answers
17
views
How can I use a custom Date deserializer for Json RequestBody?
I'm using Spring MVC and I would like to control the deserialization of Date objects in RequestBody.
I saw I can set a custom JsonDeserializer in the input object, but I would like to set a global ...
0
votes
1
answer
126
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<...
-3
votes
1
answer
67
views
Deserialize Json string on POST when result is returned in [X].Name format
Everything works as expected until the json string is deserialized after the post back.
Class:
public class RegretLetterDetail
{
public int PositionID { get; set; }
[Display(Name = "...
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
99
views
Spring OAuth2 Authorization Server: IllegalArgumentException when deserializing custom User class after consent approval
I'm trying to set up a Spring Authorization Server for learning purposes. The login and consent screens work, but after I approve the consent screen and submit the /authorize request, I get the ...
1
vote
1
answer
80
views
Serializing and compressing std::map using Boost [closed]
I'm trying to serialize and compress a std::map using Boost. Here's the serialization code:
#include <boost/archive/binary_oarchive.hpp>
#include <boost/iostreams/filtering_stream.hpp>
#...
2
votes
0
answers
113
views
In Pydantic 2, how do allow missing fields during deserialisation/validation, but require it when creating an instance?
I use pydantic to be able to serialise and deserialise json data stored in a large database. Each of these json strings represent a pydantic model MyModel.
class MyModel(BaseModel):
attr1: int
I ...
2
votes
2
answers
198
views
Jackson Custom Deserialization - deserialize into known object instance WITHOUT JsonTypeInfo annotations or Mixins
I have a class BaseClass that during runtime will store a reference to another object Thing. BaseClass is meant to be extensible so I've made it abstract like so:
abstract class BaseClass{
// see ...
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()
{
...
1
vote
2
answers
202
views
Delphi and JSON serialization with Spring collections
I am trying to include the Spring4D framework in my latest Delphi project. The collection functions for sorting and filtering are the main features.
However, I have great difficulty to serialize 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 ...
1
vote
1
answer
147
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 ...
3
votes
1
answer
4k
views
Unable to torch.load due to pickling/safety error
I am trying to use a pytorch model present on this link:
https://drive.google.com/drive/folders/121kucsuGxoYQu03-Jmy6VCDcPzqlG4cG
since it is used by this project I am trying to run:
https://github....
0
votes
1
answer
72
views
Deserialize a cached response into a Kontent ai strongly typed object
I'm using Blazor wasm with .Net 8 and the Kontent.Ai.Delivery package and I'm trying to integrate caching into the system.
One problem I'm facing is, after I store the data as json in cache, I can't ...
0
votes
0
answers
59
views
Is it ok to suppress there warnings [duplicate]
I have code that has two warnings.
The code is from a commandline Expense manager project that uses a List to save and access expenses. Saving and retrieving the List is done via serialisation and ...
0
votes
1
answer
118
views
Force Rust serde to deserialize JSON Number to u16
How can I force serde to parse a JSON Number as a Rust u16 type?
Below I parse a JSON file. json_data is of type Value. This only has a as_u64() method, no as_u16(). As a result I first have to parse ...
0
votes
0
answers
72
views
pydantic get field alias based on field value with python object
I have pydantic model as below.
from typing import Annotated
from bson import ObjectId
from pydantic import Field
from pydantic import EmailStr
from pydantic import BaseModel
from pydantic import ...
2
votes
0
answers
49
views
Serilialize with thrift to a file performance problem
I'm working on serializations and need to make some benchmarks on Apache Thrift. But I have very long serialization times. Compared to Protobuf, I have more than 100x average times. What am I doing ...
0
votes
1
answer
170
views
Is BinaryFormatter used to deserialize images embedded in an application via. .resx files?
In a C# .Net application, is BinaryFormatter used to deserialize resource image data embedded in the application via .resx files and Resource Explorer?
I've been handed a .Net application and the task ...
6
votes
1
answer
89
views
Is there a simple recursive analogue of this breadth-first binary tree deserialization function in Haskell?
I am interested in methods for serializing and deserializing a binary tree in breadth-first order. The first part, serialization, is equivalent to performing a levelorder traversal where we preserve ...
0
votes
1
answer
754
views
Spring Boot @RequestBody Flags Snyk CSRF
I have an API in Spring Boot. In the controller layer, any POST that has a custom object annotated with @RequestBody flags Snyk security findings in the security pipeline.
For example:
public ...
0
votes
0
answers
26
views
Improving performance of DataSet.ReadXml by means of DataTable.BeginLoadData: DataSet.EnforceConstraints is left false
In Loading a DataSet from XML, I've found the following statement:
If you call ReadXml to load a very large file, you may encounter slow performance. To ensure best performance for ReadXml, on a ...
0
votes
1
answer
73
views
How to convert a BsonDocument to a given java class object?
private <T> T convertByteInDataForObject(ByteString data, Class<T> toType) {
byte[] bsonBytes = data.toByteArray();
ByteBuffer byteBuffer = ByteBuffer.wrap(bsonBytes);
...
0
votes
1
answer
47
views
Error deserializing FeatureCollection in Kotlin
I'm trying to deserialize a GeoJson FeatureCollection contained in a file (.json extension), with contents:
{
"type": "FeatureCollection",
"features": [
{
&...