json-deserialization Questions

3

Solved

I am working on a project that utilizes Jetpack Compose Navigation with Type-Safe Navigation. Within my application, I have an composable function responsible for hosting the navigation graph. Here...

4

I'm new to json and trying to get a basic example working. My http request returns {'username': '1'},{'username': '1'}. I'm confused as to what valid json looks like but also how to get it into...
Begrime asked 9/8, 2016 at 17:23

16

I'm just trying to use a Http POST method in a Blazor app through public async Task CreateUnit(UnitEntity unit) { await _http.PostJsonAsync<UnitEntity>("api/units", unit); } _http...
Sanies asked 10/3, 2020 at 17:32

3

Solved

I'm trying to deserialize json into an object with a property of type Dictionary<string,string>. I specify the comprarer for the Dictionary as StringComparer.OrdinalIgnoreCase. Here's this cl...
Scutiform asked 28/4, 2021 at 20:47

5

Solved

I have used the "JsonConvert.Deserialize(json)" method of Json.NET so far which worked quite well and to be honest, I didn't need anything more than this. I am working on a background (console) ap...
Perseverance asked 26/8, 2015 at 13:3

3

Solved

Deserializing using JsonSerialize.DeserializeAsync and a custom converter, e.g. public class MyStringJsonConverter : JsonConverter<string> { public override string Read(ref Utf8JsonReader re...

2

Solved

I want to serialize object in c# and learn that we can do this both JsonSerializer and JsonConvert. I know about documentation knowledges about these. But I want to know which is better to u...
Ichthyology asked 12/8, 2016 at 10:12

2

Solved

I want to decode a json string containing a list of objects in a polymorphic class structure using kotlinx.serialization in a Kotlin Multiplatform project, but it works only on JVM, not on Native. ...

4

Solved

I'm trying to deserialize a JSON file to a c# class. However, my deserialize method always returns null. My JSON file looks like this- { "Products": [ { "ProductID": 994, &q...
Surgeon asked 25/1, 2021 at 17:37

4

While converting Java object to JSON string, I'm facing JsonMappingException. Below is the complete exception message. com.fasterxml.jackson.databind.JsonMappingException: Not an array: {"type...
Holyhead asked 16/7, 2020 at 22:6

2

When deserialising byte array using Newtonsoft we can achieve by writing the following code var stringValue = Encoding.UTF8.GetString(byteArray); T data = JsonConvert.DeserializeObject<T>(s...
Ephram asked 8/10, 2020 at 16:2

2

Solved

I have POJO like where I have a BigDecimal field: public class Foo implements Serializable { private BigDecimal amount; } I want to have the BigDecimal value up to 2 decimal place only. Is the...

5

I try to write custom jackson deserializer. I want "look" at one field and perform auto deserialization to class, see example below: import com.fasterxml.jackson.core.JsonParser; import com.faster...
Konyn asked 13/9, 2015 at 16:38

6

Solved

Setup: # Pydantic Models class TMDB_Category(BaseModel): name: str = Field(alias="strCategory") description: str = Field(alias="strCategoryDescription") class TMDB_GetCate...
Rodriques asked 23/9, 2021 at 19:42

6

Traceback (most recent call last): File "/Users/sparshkedia/Desktop/task/venv/lib/python3.6/site-packages/django/core/serializers/json.py", line 69, in Deserializer yield from PythonDeserializer(...
Amphiboly asked 10/2, 2019 at 14:27

3

I have created a sealed class for the json field Value under CustomAttribute data class. This field can return String or Array of Strings. How can we deserialize this sealed class from json? dat...
Inattentive asked 17/2, 2020 at 10:8

2

I have a org.json.JSONArray that contains JSONObjects and I am trying to map those to a POJO. I know the type of the POJO I want to map to. I have 2 options and I m trying to figure out which is be...

8

Solved

I have this API public ActionResult AddDocument([FromBody]AddDocumentRequestModel documentRequestModel) { AddDocumentStatus documentState = _documentService.AddDocument(documentRequestModel, Doc...
Advertisement asked 5/12, 2019 at 15:31

1

I want to deserialize a string of JSON data into a struct with multiple fields and return an error if the ordering of the serialized data does not match the order of the fields in the struct. I hav...
Penchant asked 3/5, 2021 at 8:50

4

I have seen the terms "deserialize" and "serialize" with JSON. What do they mean?

1

I would like to create a class, which has an enumeration as an attribute. This enumeration should have a string representation that shows up as human-readable value when dumping the instance of the...

6

Solved

Let's say I'm having a class like: @Serializable data class MyClass( @SerialName("a") val a: String?, @SerialName("b") val b: String ) Assume the a is null and b's value is "b value", then Jso...

10

Solved

Swift's JSONDecoder offers a dateDecodingStrategy property, which allows us to define how to interpret incoming date strings in accordance with a DateFormatter object. However, I am currently work...
Moslem asked 21/6, 2017 at 17:30

1

Solved

I use kotlinx.serialization library to serialize/deserialize JSONs. There is a JSON string: {"id":"1"} that can be also represented as {"uid":"1"} And I wa...

1

Solved

I want to dynamically generate a Pydantic model at runtime. I can do this by calling create_model. For example, from pydantic import create_model create_model("MyModel", i=(int,...), s=(...
Euchromatin asked 24/9, 2022 at 22:57

© 2022 - 2025 — McMap. All rights reserved.