From 38a76b5108f679fedb0032a1d70bd8ca89f47283 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 22 May 2021 11:24:34 -0400 Subject: allow comments and trailing commas in schemas for VSCode The `allowComments` and `allowTrailingCommas` fields are VSCode-specific extensions to JSON Schema. --- src/SMAPI.Web/wwwroot/schemas/content-patcher.json | 5 ++++- src/SMAPI.Web/wwwroot/schemas/i18n.json | 5 ++++- src/SMAPI.Web/wwwroot/schemas/manifest.json | 4 ++++ 3 files changed, 12 insertions(+), 2 deletions(-) (limited to 'src/SMAPI.Web') diff --git a/src/SMAPI.Web/wwwroot/schemas/content-patcher.json b/src/SMAPI.Web/wwwroot/schemas/content-patcher.json index 49900da6..6e6278de 100644 --- a/src/SMAPI.Web/wwwroot/schemas/content-patcher.json +++ b/src/SMAPI.Web/wwwroot/schemas/content-patcher.json @@ -4,8 +4,11 @@ "title": "Content Patcher content pack", "description": "Content Patcher content file for mods", "@documentationUrl": "https://github.com/Pathoschild/StardewMods/tree/develop/ContentPatcher#readme", - "type": "object", + "allowComments": true, + "allowTrailingCommas": true, + + "type": "object", "properties": { "Format": { "title": "Format version", diff --git a/src/SMAPI.Web/wwwroot/schemas/i18n.json b/src/SMAPI.Web/wwwroot/schemas/i18n.json index 493ad213..313daa59 100644 --- a/src/SMAPI.Web/wwwroot/schemas/i18n.json +++ b/src/SMAPI.Web/wwwroot/schemas/i18n.json @@ -4,8 +4,11 @@ "title": "SMAPI i18n file", "description": "A translation file for a SMAPI mod or content pack.", "@documentationUrl": "https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Translation", - "type": "object", + "allowComments": true, + "allowTrailingCommas": true, + + "type": "object", "properties": { "$schema": { "title": "Schema", diff --git a/src/SMAPI.Web/wwwroot/schemas/manifest.json b/src/SMAPI.Web/wwwroot/schemas/manifest.json index 0b265201..05698ba2 100644 --- a/src/SMAPI.Web/wwwroot/schemas/manifest.json +++ b/src/SMAPI.Web/wwwroot/schemas/manifest.json @@ -4,6 +4,10 @@ "title": "SMAPI manifest", "description": "Manifest file for a SMAPI mod or content pack", "@documentationUrl": "https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Manifest", + + "allowComments": true, + "allowTrailingCommas": true, + "type": "object", "properties": { "Name": { -- cgit From 112b505118e65d2741a5cfebce44abd02742dd2f Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 25 May 2021 17:42:24 -0400 Subject: update schema for Content Patcher 1.23 --- docs/release-notes.md | 3 +++ src/SMAPI.Web/wwwroot/schemas/content-patcher.json | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/SMAPI.Web') diff --git a/docs/release-notes.md b/docs/release-notes.md index 1497d6c9..b12e8931 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -18,6 +18,9 @@ * Fixed validation for mods with version `0.0.0`. * Fixed _loaded with custom settings_ trace log when using default settings. +* For the web UI: + * Updated the JSON validator/schema for Content Patcher 1.23. + ## 3.10.1 Released 03 May 2021 for Stardew Valley 1.5.4 or later. diff --git a/src/SMAPI.Web/wwwroot/schemas/content-patcher.json b/src/SMAPI.Web/wwwroot/schemas/content-patcher.json index 6e6278de..aac4ff0f 100644 --- a/src/SMAPI.Web/wwwroot/schemas/content-patcher.json +++ b/src/SMAPI.Web/wwwroot/schemas/content-patcher.json @@ -14,9 +14,9 @@ "title": "Format version", "description": "The format version. You should always use the latest version to enable the latest features and avoid obsolete behavior.", "type": "string", - "const": "1.22.0", + "const": "1.23.0", "@errorMessages": { - "const": "Incorrect value '@value'. This should be set to the latest format version, currently '1.22.0'." + "const": "Incorrect value '@value'. This should be set to the latest format version, currently '1.23.0'." } }, "ConfigSchema": { -- cgit From dfa3beb6a6ba09d350aecc5bc3a8db3f2bd99ab7 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 28 May 2021 20:24:29 -0400 Subject: fix i18n schema requiring wrong $schema value --- docs/release-notes.md | 3 ++- src/SMAPI.Web/wwwroot/schemas/i18n.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/SMAPI.Web') diff --git a/docs/release-notes.md b/docs/release-notes.md index b7b053b8..3475a26a 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -16,7 +16,8 @@ * Added `World.FurnitureListChanged` event (thanks to DiscipleOfEris!). * Added asset propagation for building/house paint masks. * Added validation for the manifest `Dependencies` field. - * When using Visual Studio Code to edit JSON files [with a SMAPI JSON schema](technical/web.md#using-a-schema-file-directly), it will no longer warn about comments or trailing commas. + * Fixed [JSON schema](technical/web.md#using-a-schema-file-directly) in Visual Studio Code warning about comments or trailing commas. + * Fixed JSON schema for `i18n` files requiring the wrong value for the `$schema` field. * Fixed validation for mods with version `0.0.0`. * Fixed _loaded with custom settings_ trace log when using default settings. diff --git a/src/SMAPI.Web/wwwroot/schemas/i18n.json b/src/SMAPI.Web/wwwroot/schemas/i18n.json index 313daa59..36c04890 100644 --- a/src/SMAPI.Web/wwwroot/schemas/i18n.json +++ b/src/SMAPI.Web/wwwroot/schemas/i18n.json @@ -14,7 +14,7 @@ "title": "Schema", "description": "A reference to this JSON schema. Not part of the actual format, but useful for validation tools.", "type": "string", - "const": "https://smapi.io/schemas/manifest.json" + "const": "https://smapi.io/schemas/i18n.json" } }, -- cgit