Properly default Version field to 1 and ignore fields when left out intentionally.

lua-bytecode
Icedream 2014-10-22 19:47:00 +02:00
parent c6118e7ca2
commit 5582debcee
1 changed files with 7 additions and 2 deletions

View File

@ -9,7 +9,12 @@ namespace GarrysMod.AddonCreator
{ {
public class AddonJson public class AddonJson
{ {
[JsonProperty("title")] public AddonJson()
{
Version = 1;
}
[JsonProperty("title", NullValueHandling=NullValueHandling.Ignore)]
public string Title { get; set; } public string Title { get; set; }
[JsonProperty("description")] [JsonProperty("description")]
@ -21,7 +26,7 @@ namespace GarrysMod.AddonCreator
[JsonProperty("tags")] [JsonProperty("tags")]
public List<string> Tags { get; set; } public List<string> Tags { get; set; }
[JsonProperty("ignore")] [JsonProperty("ignore", NullValueHandling = NullValueHandling.Ignore)]
public List<string> Ignores { get; set; } public List<string> Ignores { get; set; }
[JsonProperty("version")] [JsonProperty("version")]