From c258406bcbf96cf27bb61363d723a1b1aeee5c3c Mon Sep 17 00:00:00 2001 From: stevenh Date: Thu, 16 Feb 2012 12:01:02 +0000 Subject: [PATCH] Added parameterless constructor for RestObject required for JavaScriptSerializer.Deserialize --- TShockAPI/Rest/RestObject.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/TShockAPI/Rest/RestObject.cs b/TShockAPI/Rest/RestObject.cs index e63233dc..130e2ec8 100644 --- a/TShockAPI/Rest/RestObject.cs +++ b/TShockAPI/Rest/RestObject.cs @@ -41,7 +41,14 @@ namespace Rests set { this["response"] = value; } } - public RestObject(string status = "200") + // Parameterless constructor for deseralisation required by JavaScriptSerializer.Deserialize in TShockRestTestPlugin + // Note: The constructor with all defaults isn't good enough :( + public RestObject() + { + Status = "200"; + } + + public RestObject(string status = "200") { Status = status; }