protected override void WriteAdditionalPropertyInformation(JsonWriter writer, PropertyInfoContainer propertyInfoContainer, JsonSerializer serializer) { if (!propertyInfoContainer.IsValue) { var typeContainer = TypeInfoContainer.Create(propertyInfoContainer.Type); writer.WritePropertyName("TypeDefinition"); serializer.Serialize(writer, typeContainer); } }
public string Serialize(Type type) { var typeContainer = TypeInfoContainer.Create(type); var converters = JsonHelper.GetAssemblyDefinedConverters(Assembly.GetExecutingAssembly()).ToList(); converters.Add(new Newtonsoft.Json.Converters.StringEnumConverter()); var json = JsonConvert.SerializeObject(typeContainer, Formatting.Indented, converters.ToArray()); return(json); }