diff --git a/NewHorizons/External/Configs/StarSystemConfig.cs b/NewHorizons/External/Configs/StarSystemConfig.cs index bf4cef06..bfed6035 100644 --- a/NewHorizons/External/Configs/StarSystemConfig.cs +++ b/NewHorizons/External/Configs/StarSystemConfig.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using System.ComponentModel; +using System.ComponentModel.DataAnnotations; using System.Linq; using NewHorizons.Utility; using Newtonsoft.Json; @@ -102,8 +102,16 @@ namespace NewHorizons.External.Configs public class NomaiCoordinates { + [MinLength(2)] + [MaxLength(6)] public int[] x; + + [MinLength(2)] + [MaxLength(6)] public int[] y; + + [MinLength(2)] + [MaxLength(6)] public int[] z; } diff --git a/SchemaExporter/SchemaExporter.cs b/SchemaExporter/SchemaExporter.cs index 87a701bd..7b0634fd 100644 --- a/SchemaExporter/SchemaExporter.cs +++ b/SchemaExporter/SchemaExporter.cs @@ -77,6 +77,14 @@ public static class SchemaExporter {"title", _title}, {"description", _description} }); + + if (_title == "Star System Schema") + { + schema.Definitions["NomaiCoordinates"].Properties["x"].UniqueItems = true; + schema.Definitions["NomaiCoordinates"].Properties["y"].UniqueItems = true; + schema.Definitions["NomaiCoordinates"].Properties["z"].UniqueItems = true; + } + return schema; } }