Added pattern to uniques to catch bugs

This commit is contained in:
Yair Morgenstern
2023-09-22 10:47:56 +03:00
parent 8ccee2e862
commit 1891a37c66
2 changed files with 12 additions and 2 deletions

View File

@ -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! 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 ## Using Android Studio
- Double-click space, search "json schema mappings", enter - Double-click space, search "json schema mappings", enter
- Click the small '+' (top, under 'language & frameworks' text) - Click the small '+' (top, under 'language & frameworks' text)
- Put the URL as `https://raw.githubusercontent.com/yairm210/Unciv/master/docs/Modders/schemas/buildings.json` - 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" "*/Buildings.json"
], ],
"url": "https://raw.githubusercontent.com/yairm210/Unciv/master/docs/Modders/schemas/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"
} }
] ]
``` ```

View File

@ -1,4 +1,7 @@
{ {
"type": "array", "type": "array",
"items": { "type": "string" } "items": {
"type": "string",
"pattern": "^[^><]*(\\<[^>]*\\>[^><]*)*$"
}
} }