From 12fbb724358739059e15d7c9d8f0ddfa637de848 Mon Sep 17 00:00:00 2001 From: HebaruSan Date: Mon, 21 Aug 2023 21:25:42 +0000 Subject: [PATCH] Fix schema issue with install_to: GameData/Mods (#3887) --- CKAN.schema | 2 +- .../Validators/ObeysCKANSchemaValidatorTests.cs | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CKAN.schema b/CKAN.schema index e2fd249e06..085d57ab1a 100644 --- a/CKAN.schema +++ b/CKAN.schema @@ -432,7 +432,7 @@ }, "install_to" : { "description" : "Where file should be installed to. As of v1.2, GameData may take a path", - "oneOf" : [ + "anyOf" : [ { "description" : "Spec version 1 targets", "enum" : [ "GameData", "Ships", "GameRoot", "Tutorial", "Scenarios" ] diff --git a/Tests/NetKAN/Validators/ObeysCKANSchemaValidatorTests.cs b/Tests/NetKAN/Validators/ObeysCKANSchemaValidatorTests.cs index 23580a009d..386db6c2dc 100644 --- a/Tests/NetKAN/Validators/ObeysCKANSchemaValidatorTests.cs +++ b/Tests/NetKAN/Validators/ObeysCKANSchemaValidatorTests.cs @@ -52,6 +52,18 @@ public void Validate_DuplicateLocalizations_Throws(string json, string localizat ); } + public void Validate_InstallToGameDataSlashmods_DoesNotThrow() + { + Assert.DoesNotThrow( + () => TryModule(boringModule, null, "install", + JArray.Parse(@"[ + { + ""find"": ""BetterPartsManager"", + ""install_to"": ""GameData/Mods"" + } + ]"))); + } + private void TryModule(string json, string removeProperty = null, string addProperty = null, JToken addPropertyValue = null) { // Arrange