quicktype
quicktype copied to clipboard
[c#] missing partial keyword on generated "Serialize" class
example:
namespace QuickType
{
using System;
using System.Collections.Generic;
using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
public partial class Something
{
[JsonProperty("some_property")]
public string SomeProperty { get; set; }
}
public partial class Something
{
public static Something FromJson(string json) => JsonConvert.DeserializeObject<Something>(json, QuickType.Converter.Settings);
}
public static class Serialize
{
public static string ToJson(this Something self) => JsonConvert.SerializeObject(self, QuickType.Converter.Settings);
}
internal static class Converter
{
public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
{
MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
DateParseHandling = DateParseHandling.None,
Converters = {
new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }
},
};
}
}
as you can see the Serialize class doesnt have the partial keyword, resulting in compile errors if i generate multiple json objects within the same namespace