Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic/Unknown type deserialization #571

Open
shravan2x opened this issue Mar 3, 2023 · 0 comments
Open

Dynamic/Unknown type deserialization #571

shravan2x opened this issue Mar 3, 2023 · 0 comments
Labels
enhancement Issues describing an enhancement or pull requests adding an enhancement.

Comments

@shravan2x
Copy link
Contributor

Describe the feature

I couldn't find documentation in the README about this. Does the library support a way to deserialize objects without knowing what type they are?

I'm trying to use this approach in a webpage where there are multiple schema.org types. I currently do a string search for all the jsons that contain "@type": "Car" and then deserialize those only. But it would be much cleaner to do htmlNodes.Select(x => SchemaSerializer.DeserializeObject<Thing>(x.InnerHtml)!).OfType<Car>(), where the OfType call does the actual filtering cleanly.

Schema objects

No response

@shravan2x shravan2x added the enhancement Issues describing an enhancement or pull requests adding an enhancement. label Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues describing an enhancement or pull requests adding an enhancement.
Projects
None yet
Development

No branches or pull requests

1 participant