json-serialization Questions

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

2

I am using .net Maui MVVM source generators to create properties as observable properties. I am using System.Text.Json.Serialization to serialize the properties of a class to JSON. When I use [Json...

3

I'm trying to generate my json helper functions for an object, that contains a list with the type of an abstract class, like this: import 'package:json_annotation/json_annotation.dart'; import 'ex...
Osmunda asked 5/4, 2020 at 12:53

3

Solved

Here is a json file person.json { "first_name": "John", "last_name": "Doe" } Here is the Person class import 'package:json_annotation/json_annotation.dart...
Atalayah asked 17/7, 2022 at 14:31

2

Solved

I have an ASP.NET 5 MVC Core application controller with the below code inside: using System.Text.Json; public async Task<IActionResult> EstoAPICall() { ... EstoOst estoOst; var json = Js...

2

Solved

I'm trying to call a Web API from code in an Azure Function that I've just ported to .NET 6 (isolated hosting model). I took the chance of the migration to get rid of the RestSharp and Json.NET dep...

4

Solved

Is there a way to ignore the serialization of a property within a JsonSerializable class? I'm using build_runner to generate the mapping code. One way to achieve this is by commenting the mapping...
Darlenedarline asked 15/3, 2019 at 9:45

4

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

4

Solved

Im looking into the Order class example and found that the Item class is not converted to Map. class Order { int count; int itemNumber; bool isRushed; Item item; Map<String, dynamic> t...
Slickenside asked 24/11, 2018 at 13:17

3

I have a class: import 'package:google_maps_flutter/google_maps_flutter.dart'; class Place { Place({ this.address, this.coordinates, }); final String address; final LatLng coordinates; } ...
Grenadines asked 13/1, 2020 at 12:22

3

Solved

My application requires the (almost default) JSON serialization settings: services.AddMvc() .SetCompatibilityVersion(CompatibilityVersion.Version_2_2) .AddJsonOptions(options => { options.S...
Nasho asked 14/5, 2019 at 9:47

1

I have a class: class Setting { String configurationName; String configuration; } I want to return the string representation how configuration will look like. This can be different object bas...
Suzan asked 2/7, 2021 at 22:43

3

Solved

I would need to take the question about json serialization of @dataclass from Make the Python json encoder support Python's new dataclasses a bit further: consider when they are in a nested str...
Detrude asked 2/4, 2020 at 20:25

5

Situation: I have multiple Web service API calls that deliver object structures. Currently, I declare explicit types to bind those object structures together. For the sake of simplicity, here's an ...
Psychognosis asked 29/8, 2017 at 6:20

1

I'm serialising a BigInteger to JSON using System.Text.Json: JsonSerializer.Serialize(new {foo = new BigInteger(ulong.MaxValue) + 1}) This results in the following output: {"foo":{"...

9

Solved

I'm attempting to use the following code to serialize an anonymous type to JSON: var serializer = new DataContractJsonSerializer(thing.GetType()); var ms = new MemoryStream(); serializer.WriteObje...

3

Solved

I am working in .net core project. I want to serialize the objects using JavaScriptSerializer. JavaScriptSerializer Serializer = new JavaScriptSerializer(); I added the namespace using System.We...
Catamenia asked 9/1, 2019 at 12:40

1

I'm new to dart development... I can't figure out how to use the Json_serializable package with enum types. my database has the enum values as an integer, but it looks like JSON_Serializable wants...
Giddings asked 2/4, 2019 at 2:6

2

I have an class which consist in which i have some problems filling a jsonElement from a json file as such { "entities": [ { "name": "DateTimeENT1", "description": "This a example", "uil": {...
Gog asked 19/3, 2020 at 16:55

1

Consider the following json: [ { "id": 1 "name": "foo" }, { "id": 1 "name": "foo" } ] I am trying to parse this using json_serializable library. json.decode(response.body) returns List&...
Feverish asked 25/5, 2019 at 13:44

1

I have a Spring-Boot-Project with JPA and JSON-Serialization. I try to use @JsonView to serialize only specified Properties. It works ok, but for my associations in Order (e.g. order.user) it seria...
Irv asked 13/9, 2019 at 16:18

3

I'm using net core web api and need to return a payload with property name "$skip". I tried using the DataAnnotations: public class ApiResponseMessage { [Display(Name ="$skip", ShortName = "$skip...
Sheath asked 27/6, 2017 at 17:2

1

Solved

I'm using json_serializable plugin, but it doesn't seem to work with File for images. 'myclass.g.dart' is not generated. I don't have any troubles for the other types. (https://pub.dev/packages/jso...
Gamogenesis asked 11/6, 2019 at 10:20

1

I am new to Angular and I have several doubts about what is the best way to serialize a Date property of an object added to a POST request. Given the sample class export class MyClass{ public dat...
Brittney asked 29/10, 2018 at 23:41

2

Solved

According to the json_serializable package installing instructions, you should add the following dependency: dependencies: json_serializable: ^2.0.3 This is my code: import 'package:json_annot...
Vance asked 25/3, 2019 at 21:40

© 2022 - 2025 — McMap. All rights reserved.