-
-
Notifications
You must be signed in to change notification settings - Fork 86
Closed
Labels
bugIssues describing a bug or pull requests fixing a bug.Issues describing a bug or pull requests fixing a bug.
Description
Author deserialization issue
Just run into situation:
for Book I have a list of Author type of Person
...
"author": [
{
"@type": "Person",
"name": "SomeName",
"description": "SomeDescription.md",
"image": "SomeImage",
"url": "https://someUrl.me",
"email": "someemail@gmail.com",
"jobTitle": "CEO SomeCompany Solutions"
},
{
"@type": "Person",
"name": "Иван Васильевич",
"image": "Images/Иван Васильевич.jpg",
"email": "car.kreml@yandex.ru",
"jobTitle": "просто Царь"
}
]
...the way I`m deserialize:
public static Book GetMetadata(string path)
{
var file = Path.Combine(path, FileNames.Metadata);
if (File.Exists(file))
{
var json = File.ReadAllText(file);
Book bookMetadata = JsonConvert.DeserializeObject<Book>(json) as Book;
return bookMetadata;
}
else
throw new ArgumentNullException("Metadata file is missing.");
}but after deserialization of my "schema.json" into c# class I got field "Author" type of Organization. Any other fields like "JobTitle" are ignored.
Metadata
Metadata
Assignees
Labels
bugIssues describing a bug or pull requests fixing a bug.Issues describing a bug or pull requests fixing a bug.
