Questions tagged [json-serialization]

302 questions
0
votes
0 answers

How to serialize complex object, which have a custom data type matrix?

I need to serialize a class object whose field is a custom data type matrix, like: internal class MyClass { private readonly MyMatrix[,] myField; public MyField { get => myField; } } I am using json serialization code from here:…
Alexey
  • 3
  • 2
0
votes
1 answer

DioError [DioErrorType.other]: Converting object to an encodable object failed: Instance of 'DbApiClientRequest'

Flutter , Dart , Dio , JsonSerialization The code block where I get the error: Response response = await Dio().post("https://10.0.2.2:44301/api/Company/companies", data: dbApiClientRequest); Client Request Data to api import…
0
votes
0 answers

Convert any python object to JSON string and then using the JSON string construct the original python object

How do we construct a JSON string which contains all the necessary details which are part of any python objects (primitive data types, custom classes, enums, list of classes, dictionary of different objects). Later the same JSON string should be…
0
votes
0 answers

How to use custom field in polymorphic Json deserialization using kotlinx.serialization

I have the following data structure that I want to deserialize: @Serializable data class SearchResponse(val results: List) { @Serializable data class SearchResultContainer( val type: ResultType, val…
pixel
  • 24,905
  • 36
  • 149
  • 251
0
votes
0 answers

How can I add serialization dependencies to my kotlin project?

I am trying to add json serialization dependencies in my kotlin project but it doesnt work and lots of error appear when I sync project. I dont know why. I did as in the serialization dependency addition section on the kotlin web site, but it didn't…
NewPartizal
  • 604
  • 4
  • 18
0
votes
1 answer

How to use jsonSerialization with objectbox Entity class

I am facing issue when I am using JsonSerialization on Objectobox Entity I tried to find better solution but I could not find
Vikash Kumar
  • 103
  • 3
  • 9
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

Dart json_annotation how to group fields by @JsonKey(defaultValue: someValue)?

I would like to group fields with default value if the JSON doesn't contain the key or if the value is null. Instead of putting @JsonKey(defaultValue: someValue) before every field is there any way to group fields by default value? final String?…
Soliev
  • 1,180
  • 1
  • 1
  • 12
0
votes
2 answers

JSONAPI URL requirements for new resource

According to JSON API V1 specification and its recommendations, I know the URLs for collection of resources should be something like /photos. And the URL for reading, updating, or deleting a single resource that already exists in the database should…
0
votes
0 answers

How to store enum contained in a list of objects as string using EF Core 3.1.6

Given this kind of code: public class Topic { public enum Category { Language, Science } public Category Name { get; set; } public string Description { get; set; } = null!; } public class MyEntity { public…
jpen
  • 2,129
  • 5
  • 32
  • 56
0
votes
1 answer

json_encode() Data Being Automatically Converted Into A Javascript Object Without JSON.parse() Being Used

I have some PHP and JavaScript that works by PHP updating a MySQL database, and then outputting the updated code back onto the page without a hard refresh using the JavaScript fetch() method. This code works, but there is a part I don't understand —…
paulo77
  • 174
  • 14
0
votes
1 answer

Complex nested Json serialization - build_runner failed

I made my first app with flutter, it uses a complex data structure with lists of objects nested inside of lists of objects. Now that the app is pretty much finished in terms of functionality, I'm trying to save the app's data using…
0
votes
0 answers

System.Text.Json source generation not working

I'm trying to add System.Text.Json source generation to one of my projects, a .net6 rest api. When I try to specify the partial class according to instructions I get this behavior: vs thinks this won't build properly But I can still build the…
0
votes
2 answers

How to create a JSON of a List of List of Any in Scala

The JSON output that I am looking for is {[[1, 1.5, "String1"], [-2, 2.3, "String2"]]} So I want to have an Array of Arrays and the inner array is storing different types. How should I store my variables so I can create such JSON in Scala? I…
0
votes
1 answer

HTTP client having an issue with client certificate while trying to make a call on IIS server

I am trying to connect to a 3rd party using a client certificate. I've been testing this locally using docker-compose with a docker runtime image for .net 6. This works fine. However, as soon As I push my code to my web server running IIS I get a…