Questions tagged [json-serialization]

302 questions
-1
votes
3 answers

how does C# class look like to match this JSON

I have this JSON string that should be posted from JavaScript to the API: "model": "kpi.availability", "typeId": "kpi.availability", "name": "Availability", "description": "", "version": "1.0.0", "properties": { "X": { …
B.j
  • 47
  • 1
  • 9
-1
votes
1 answer

How do i remove the List type property name and the {} and [] brackets while serialing in C#

this is the model I'm Serialzing public class SomeClassOne { public string name { get; set; } public string Gender { get; set; } public int Age { get; set; } public List Products { get; set; } …
-1
votes
1 answer

How can i apply @JsonSerialize annotation to a lib class property?

I'm using an external library in my project. One of it's models has a BigDecimal property, that requires a custom precision. If this model was mine, i would apply a @JsonSerialize annotation that uses custom serializer. But i can't modify sources of…
darth jemico
  • 605
  • 2
  • 9
  • 18
-1
votes
2 answers

Uncaught (in promise) Error: Expected a value of type 'List', but got one of type '_JsonMap'

I am new to flutter. Am trying to consume a Rest_Api from my UI to make a get Request,however i am getting an error "Expected a value of type 'List', but got one of type '_JsonMap'",which have tried to debug based on the suggestions found online but…
Emmon
  • 377
  • 1
  • 9
  • 24
-1
votes
1 answer

I want to deserialize a json object in scala

{ "columnreq": [ { "column": "date", "datatype": "string" }, {"column": "name", "datatype": "int" } ], "databaseName": "test", "sourceTableName": "department" …
Debashish Das
  • 69
  • 1
  • 5
-1
votes
1 answer

JSON serialization of C char array (char*)

Is it possible to encode a C char array (char*) in JSON in order to send it through a TCP socket? If so how can I make it and which would be a simple JSON library to use? Thanks,
-1
votes
1 answer

C# Serialize dictionary without "key" and "value" keywords

I am trying to serialize the following data structure to JSON: public class TestClass { public TestClass() { Translations = new List>>(); } [JsonProperty("translations")] …
user7335295
  • 401
  • 2
  • 7
  • 31
-1
votes
1 answer

Serializing and Deserializing dynamically using JSON in C#

First of all, I think I am trying to serialize and deserialize dynamically, not programmatically. Sorry if I made a mistake in the title. I am a Software Engineering student, and I am trying to learn a bit about JSON. I created a class (I will…
ehtio
  • 179
  • 3
  • 11
-1
votes
2 answers

how can i get data from nested arrays through JSONDecoder()

i am facing an issue in my project basically i want to print job listing in which user can see jobs that are available and also show required skills of each job (experience tags) here is my json result { "message": "candidate job…
Usama Hassan
  • 81
  • 1
  • 8
-1
votes
1 answer

convert value in specific capitalization while serialization with jackson

I have some entry points with JAXRS and jackson serialization/deserialization, but for some values we want to capitalize it as WordUtils.capitalizeFully(str, ' ', '-') i am using lombok and jackson 2.9.8 @JsonIgnoreProperties(ignoreUnknown =…
cyril
  • 872
  • 6
  • 29
-1
votes
2 answers

An empty JSON object produced by jquery code is wrongly parsed to an empty string in PHP code

I am passing a JSON object via ajax to my php file. Then I use the function json_encode, and save it to the database. The problem is, when the JSON object is empty {}, then in PHP it is not an empty object/array, but it is an empty string "". I need…
-1
votes
1 answer

Unity 3D: JSON Error when deserializing : ArgumentException: JSON must represent an object type

I am using the following: [System.Serializable] public class Choice { public string choice; public int votes; } [System.Serializable] public class RootObject { public string question; public string published_at; public List choices; } To…
-2
votes
1 answer

The JSON value could not be converted to System.Collections.Generic.Dictionary`2[System.String,System.String]

Before serialize - "welcomePageConfig": { "welcomeTitleText": { "style": { "color": "#FFFFFF" }, "content": { "sv": "Välkommen", "en": "Welcome" …
-2
votes
3 answers

How do i convert this complex json to dart model class with null safety

Here is my json file which I want to convert to dart model { "data": { "catalog_id": "615ac5699a3c9f2ea3a65180", "catalog_images": { "l_large": { "url": "" }, "l_medium": { "url": "" }, …
-3
votes
1 answer

How to transform from decimal to int from it own class?

I have a class with json properties and I would like it to receive an integer which is the number of zeros that should be multiplied only for the decimal properties. 2 = multiply by 100 3 = multiply by…
1 2 3
20
21