Questions tagged [jsonconverter]

111 questions
0
votes
0 answers

Json, how to remove numeric object keys and convert to array instead (JsonConverter)?

I'm calling a webservice, that can take multiple id's as inputs /getItems?ids=1,2 And it returns this information (i have no control over the results) { "status": { "timestamp": "2022-10-26T15:04:37.036Z", }, "data": { …
Robert Hoffmann
  • 2,366
  • 19
  • 29
0
votes
0 answers

Using JsonConverter with Single Object and a List of Object

I am trying to implement a JsonConverter that will work when deserializing a single object as well as when that object is in a list. It works fine when using with a single object but not when the Json contains a array of the objects. Here is the…
0
votes
0 answers

The JSON value could not be converted to model in .NET Core

I have these model classes: public class TransactionInfo { public int request_id { get; set; } public DateTime request_date { get; set; } public double request_amount { get; set; } public int request_count { get; set;…
Ehsan Akbar
  • 6,977
  • 19
  • 96
  • 180
0
votes
1 answer

Outofmemory exception while converting json to list using Gson

I got outofmemory exception while converting json file to list using Gson Caused by java.lang.OutOfMemoryError Failed to allocate a 18874376 byte allocation with 18575992 free bytes and 17MB until OOM, target footprint 268435456, growth limit…
0
votes
0 answers

How to deserialize immutable types from standard library using System.Text.Json?

I am trying to serialize and deserialize System.Diagnostics.ActivityContext struct. According to documentation How to use immutable types and non-public accessors with System.Text.Json I need to add [JsonConstructor] attribute to struct constructor,…
Algirdas
  • 1
  • 2
0
votes
1 answer

Abp Framework global json converter cannot be configure

I would like to define custom json converter and replace with AbpStringToEnumConverter in abp framework. I am trying to change JsonSerializerOptions.Converters with below code but it's not working. public override void…
0
votes
0 answers

Cannot serialize abstract list with Autorest generated client

I've trying to call my controller in a behavior test. It works manually with Postman but not with a generated Autorest HttpClient. I've already created a specific JsonConverter in order to handle polymorphism. I've got the following response…
0
votes
1 answer

Using Newtonsoft JsonConverter to Encrypt JSON object

I'm developing a project that will require me to include credentials for things like an SMTP server. I'd like to store this information along with the complete details of the endpoint in an embedded JSON file, but I would like to have that…
G_Hosa_Phat
  • 976
  • 2
  • 18
  • 38
0
votes
0 answers

Implementing A Custom JSONConverter To Read/Save Data To A Separate File

I'm working on creating a JSON configuration file setup for my application. The application will require access to sensitive information (specifically login credentials and decryption passwords) Obviously, I'd rather not store this kind of sensitive…
G_Hosa_Phat
  • 976
  • 2
  • 18
  • 38
0
votes
1 answer

how to Parse multi level json with vba?

how would I parse this Json String? '{ ' "territory": { ' "RSC": { ' "sector": 1, ' "size": 3, ' "density": 2, ' "slots": 18, ' …
0
votes
1 answer

Azure Function Json Serialization issue

I'm having issues with my custom serializer sometimes not working when passing information between Orchestration Functions and I don't know if this is because of how the object is nested / constructed or if this has something to do with durable…
0
votes
0 answers

Is it allowed to change some settings from the JsonSerializer in a custom JsonConverter?

When creating a custom JsonConverter and overriding the public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) is it valid to change some settings from that JsonSerializer serializer like: //…
Stef Heyenrath
  • 9,335
  • 12
  • 66
  • 121
0
votes
1 answer

Refit Not Using Configured JsonConverter

I'm using Refit for making HTTP calls and it works as expected for request that expects straight-forward JSON structure. We've requirement now wherein the JSON request needs to be represented little differently like below. Class (With below two…
0
votes
0 answers

Do I need a separate custom JsonConverter for an object and an array of that object?

I'm importing Json from a file. Let's say it looks like this { "name": "Test System", "devices": [ { "type": "Touchpanel", "name": "Main Touchpanel", "id": "1", "model": "TS-1070" …
Jeff McAleer
  • 354
  • 2
  • 12
0
votes
0 answers

c# JsonConverter deserialize Json containing Polymorphic Object

I can't figure out what I am doing wrong. I am trying to deserialize a JSON that has a polymorphic object. Here is my basic classes and set up public class Information { [JsonConverter(typeOf(AccountConverter)] public list
justKeepCodin
  • 117
  • 2
  • 11