342 questions
-3
votes
1
answer
73
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 = "...
1
vote
1
answer
118
views
Serializing and deserializing inherited class
So i have WeaponStats class that contains one of classes that inherit from IDamageType.
Fire is empty bacause i didn't receive anything back from game designer and its still empty. But i can add ...
0
votes
1
answer
112
views
How does quarkus jackson reflection free optimization work?
Classes having JsonView annotated attributes provide different generated serializers with jackson reflect free optimization in quarkus.
I have the following attribute enabled in our project.
quarkus....
0
votes
0
answers
39
views
JsonInclude.Include.NON_EMPTY Doesn't Work after I implemented custom serializer on an attribute
I have a class which has Include.NON_EMPTY configuration on class level.
@JsonInclude(value = JsonInclude.Include.NON_EMPTY)
public class Item extends ExtraInfo {
String id;
List<String> ...
0
votes
0
answers
87
views
Configure source-generated JSON serialization for all types in assembly
I'm building an ASP.NET Core Web API for AOT publishing and need to configure source-generated JSON serialization for it, as reflection-based serialization will not work for AOT.
According to ...
0
votes
0
answers
282
views
How can I add custom converters to Npgsql EF Core (8) traditional POCO mapping?
I need to use traditional POCO mapping to jsonb with PostgreSQL and EF Core (.net 8). The structure of those classes in fairly complex and I don't need to query them with Linq to EF. But I need to be ...
0
votes
1
answer
302
views
How to use Newtonsoft JSON serializer for all Flurl 4.0 calls globally or per specific client
I need to use Newtonsoft JSON serializer for all calls made via Flurl 4.0 (or at least for all calls made by a specific Flurl client), but I cannot figure out how to set it up. From the answer to the ...
0
votes
1
answer
42
views
Jackson custom filter not triggered
I have a JSON object as:
{"username":"johndoe","email":"[email protected]",
"secretToken":"token123","secretKey":"password&...
0
votes
0
answers
59
views
JSON serialization with a group by query ... how to?
I have an API endpoint to pull a big JSON blob from one of my models, and it works, but I'd like to improve it. The current implementation is below, and mostly just works using built in associations.
...
0
votes
0
answers
96
views
Write Access Violation when Serializing rapidjson::GenericDocument with PrettyWriter to GenericStringBuffer
I am working with RapidJSON and trying to serialize a rapidjson::GenericDocument object using rapidjson::PrettyWriter to a rapidjson::GenericStringBuffer. Here is the relevant part of my code:
typedef ...
0
votes
0
answers
103
views
ASP.NET Core use dependency injection for custom type in xml output formatter
In my ASP.NET Core project, I have a custom type which needs to be serialized using some external service:
public struct MyCustomType
{
private int value;
public MyCustomType(int value) { ...
0
votes
1
answer
79
views
Use WCF of .NET Framework to serialize a class as a primitive
I am using Windows Communication Foundation classes to serialize and deserialize classes to and from JSON in files via the DataContractJsonSerializer class. I know there are better ways to serialize ...
2
votes
1
answer
344
views
Serialize Object using JsonConvert with specific format
I am using JsonConvert.SerializeObject method to serialize this object:
var objx = new JsonObject
{
["prob1"] = new JsonObject
{
["phone"] = "1019577756",
...
1
vote
1
answer
580
views
How can I tell which JSON serialization will be used on my Azure function?
In Visual Studio, if I create a new project using the "Azure Functions" template, the JSON serialization used by that function will be different depending on which version of the template I ...
0
votes
2
answers
372
views
How to test Azure function ObjectResult's JSON serialization
I'm working on a CustomClaimsProvider, although for the purposes of this question, all that matters is that it's an Azure Function with an HTTP trigger. The code here is based on the example code in ...
0
votes
2
answers
546
views
Change property names conditionally during serialization
I have model classes ClassA and ClassB.
These classes are returned as result from two controllers: XController and YController.
When returning these classes as result from YController, default ...
1
vote
1
answer
302
views
How to enable serializing for REST applications in ASP.NET Core 8?
In my project, the server returns the empty object while I have checked that this.taskGateway.RetrieveSelection returns the correct data:
[ApiController]
public class TaskController : ControllerBase
{
...
-2
votes
3
answers
606
views
C# Json object serialization with dynamic custom object
I have a C# class like the following:
public class FunctionCall
{
public string x {get; set;}
public int y {get; set;};
public object obj1 {get; set;};
public object obj2 {get; set;};...
3
votes
2
answers
5k
views
Number decimal precision with System.Text.Json
How do I write (serialize) a float to JSON with fixed 2 decimals using System.Text.Json?
Like {"Amount": 12.30}.
Not like {"Amount": 12.3} or {"Amount": 12.3001} or {&...
0
votes
1
answer
77
views
Could not write JSON: Infinite recursion (StackOverflowError)]
I am not getting "parent" field in response. If I remove @JsonBackReference annotation, the recursion will begin. I need to get parent object 1 time without recursion.
@Getter
@Setter
@...
1
vote
1
answer
481
views
Flutter JSON serialization and Setters
In flutter I have a simple JSON serializable class for a location with just an ID and a name like this:
import 'package:json_annotation/json_annotation.dart';
part 'locations_data.g.dart';
@...
0
votes
1
answer
446
views
Nestjs serialization in validation pipe not working
I am trying to use @Expose with an alias name for properties of a class as below but I am getting the response in camelCase.
import { Expose } from 'class-transformer';
import { BaseResponse } from './...
0
votes
0
answers
449
views
TypeError: Object of type ViTConfig is not JSON serializable when pushing a custom ViT model to Hugging Face Hub
I'm new to hugging face and hugsvision. I'm trying to push a custom Vision Transformer (ViT) model to the Hugging Face Hub. I've defined a custom configuration using ViTConfig, but I get this error ...
0
votes
1
answer
39
views
Construct dictionary with array value instead of serialized JSON string
I have some data from the bind grid view and I want to display them in a serialized format. Right now I have a nested array where the above parent is serialized correctly but the child array has ...
0
votes
0
answers
39
views
Internal toJson()-Method is not generated
I am having the following UserDto class:
part 'user_dto.freezed.dart';
part 'user_dto.g.dart';
@freezed
abstract class UserDto implements _$UserDto {
const factory UserDto({
required String ...