summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-08-05 00:48:52 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-09-14 19:03:51 -0400
commitc785572fdd07df17487fedd67551cb9e5ff60a2d (patch)
treee2f709b57d0c7501ee91f8c6c47c209f34fc8864
parent84ad8b2a92eac9155cada821c57d62a517b958a8 (diff)
downloadSMAPI-c785572fdd07df17487fedd67551cb9e5ff60a2d.tar.gz
SMAPI-c785572fdd07df17487fedd67551cb9e5ff60a2d.tar.bz2
SMAPI-c785572fdd07df17487fedd67551cb9e5ff60a2d.zip
raise JSON validation error for duplicate fields (#654)
-rw-r--r--src/SMAPI.Web/Controllers/JsonValidatorController.cs5
-rw-r--r--src/SMAPI.Web/wwwroot/schemas/manifest.json2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/SMAPI.Web/Controllers/JsonValidatorController.cs b/src/SMAPI.Web/Controllers/JsonValidatorController.cs
index b69a1006..41c07cee 100644
--- a/src/SMAPI.Web/Controllers/JsonValidatorController.cs
+++ b/src/SMAPI.Web/Controllers/JsonValidatorController.cs
@@ -91,7 +91,10 @@ namespace StardewModdingAPI.Web.Controllers
JToken parsed;
try
{
- parsed = JToken.Parse(paste.Content);
+ parsed = JToken.Parse(paste.Content, new JsonLoadSettings
+ {
+ DuplicatePropertyNameHandling = DuplicatePropertyNameHandling.Error
+ });
}
catch (JsonReaderException ex)
{
diff --git a/src/SMAPI.Web/wwwroot/schemas/manifest.json b/src/SMAPI.Web/wwwroot/schemas/manifest.json
index 41d1ec2d..d4727eda 100644
--- a/src/SMAPI.Web/wwwroot/schemas/manifest.json
+++ b/src/SMAPI.Web/wwwroot/schemas/manifest.json
@@ -134,6 +134,6 @@
"additionalProperties": false,
"@errorMessages": {
"oneOf:valid against no schemas": "Missing required field: EntryDll or ContentPackFor.",
- "oneOf:valid against more than one schema": "Can't specify both EntryDll or ContentPackFor, they're mutually exclusive."
+ "oneOf:valid against more than one schema": "Can't specify both EntryDll and ContentPackFor, they're mutually exclusive."
}
}