Skip to content
This repository was archived by the owner on May 16, 2022. It is now read-only.
This repository was archived by the owner on May 16, 2022. It is now read-only.

Class inheritance not supported in deserialization? #43

@LordDevil1980

Description

@LordDevil1980

Hey there :)

I was trying to switch over from Json.NET to your utf8Json.

But I found out that it does not support inheritance of classes?

Example:

public abstract class JsonDBItem
    {
        public int ID { get { return _id; } }
        private int _id = -1;
    }

   public class Card: JsonDBItem
    {
        public string Name { get { return name; } }
        private string name = 0;
    }

Json:
"_id": 1,
"name": "DummyName"

I have AllowPrivate set to true - so the Json file will deserialize the name, but not the properties from the inherited class JsonDBItem -> ID is still empty - in Json.NET this worked. Any chance to make this possible in utf8json?

Thanks alot,
Oliver

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions