If I know my string is one of many "known" object types can I deserialized it, without deserializing it multiple times, trying each known type and catching the error and then trying another until I find the matching type?
Is creating a schema based on each object type and then trying to validate the schema any better of an idea? It almost seems worse.
JsonConverterto deserialize a polymorphic object, by loading to aJObjectand checking some type discriminator or the presence of appropriate properties.TypeNameHandlingas described in Json.net serialize/deserialize derived types? or how to deserialize JSON into IEnumerable<BaseType> with Newtonsoft JSON.NET - but watch out for the security risks explained in TypeNameHandling caution in Newtonsoft Json.TypeNameHandlingas described in Json.net serialize/deserialize derived types?? If that doesn't meet your needs, can you please edit your question to clarify your requirements? PossiblyTypeNameSerializationBinderfrom Using a custom type discriminator to tell JSON.net which type of a class hierarchy to deserialize meets your needs?