diff --git a/docs/Modders/Type-checking.md b/docs/Modders/Type-checking.md index 7aa8414dde..0a866af338 100644 --- a/docs/Modders/Type-checking.md +++ b/docs/Modders/Type-checking.md @@ -6,10 +6,11 @@ Computers can handle a lot of that themselves, so we can let them do the work to This also allows autocompletion when writing jsons! -As of now, only Buildings.json has a proper schema +As of now, only Buildings and Units have proper schema ## Using Android Studio + - Double-click space, search "json schema mappings", enter - Click the small '+' (top, under 'language & frameworks' text) - Put the URL as `https://raw.githubusercontent.com/yairm210/Unciv/master/docs/Modders/schemas/buildings.json` @@ -28,6 +29,12 @@ Tada! Now Android Studio will recognize all Buildings.json files as belonging to "*/Buildings.json" ], "url": "https://raw.githubusercontent.com/yairm210/Unciv/master/docs/Modders/schemas/buildings.json" + }, + { + "fileMatch": [ + "*/Units.json" + ], + "url": "https://raw.githubusercontent.com/yairm210/Unciv/master/docs/Modders/schemas/units.json" } ] ``` diff --git a/docs/Modders/schemas/uniques.json b/docs/Modders/schemas/uniques.json index 8e975ce420..7f885c4bda 100644 --- a/docs/Modders/schemas/uniques.json +++ b/docs/Modders/schemas/uniques.json @@ -1,4 +1,7 @@ { "type": "array", - "items": { "type": "string" } + "items": { + "type": "string", + "pattern": "^[^><]*(\\<[^>]*\\>[^><]*)*$" + } }