mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Added more info for when enums aren't matched
This commit is contained in:
parent
955057183d
commit
82e60cd2cf
@ -367,7 +367,55 @@
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"required": ["activePath","alive","ammo","category","categoryDisplayName","coalition","contacts","controlled","country","desiredAltitude","desiredAltitudeType","desiredSpeed","desiredSpeedType","emissionsCountermeasures","followRoads","formationOffset","fuel","generalSettings","groupName","hasTask","heading","health","horizontalVelocity","human","ID","isActiveAWACS","isActiveTanker","isLeader","leaderID","name","onOff","operateAs","position","radio","reactionToThreat","ROE","shotsIntensity","shotsScatter","speed","state","TACAN","targetID","targetPosition","task","track","unitName","verticalVelocity"]
|
||||
"required": [
|
||||
"activePath",
|
||||
"alive",
|
||||
"ammo",
|
||||
"category",
|
||||
"categoryDisplayName",
|
||||
"coalition",
|
||||
"contacts",
|
||||
"controlled",
|
||||
"country",
|
||||
"desiredAltitude",
|
||||
"desiredAltitudeType",
|
||||
"desiredSpeed",
|
||||
"desiredSpeedType",
|
||||
"emissionsCountermeasures",
|
||||
"followRoads",
|
||||
"formationOffset",
|
||||
"fuel",
|
||||
"generalSettings",
|
||||
"groupName",
|
||||
"hasTask",
|
||||
"heading",
|
||||
"health",
|
||||
"horizontalVelocity",
|
||||
"human",
|
||||
"ID",
|
||||
"isActiveAWACS",
|
||||
"isActiveTanker",
|
||||
"isLeader",
|
||||
"leaderID",
|
||||
"name",
|
||||
"onOff",
|
||||
"operateAs",
|
||||
"position",
|
||||
"radio",
|
||||
"reactionToThreat",
|
||||
"ROE",
|
||||
"shotsIntensity",
|
||||
"shotsScatter",
|
||||
"speed",
|
||||
"state",
|
||||
"TACAN",
|
||||
"targetID",
|
||||
"targetPosition",
|
||||
"task",
|
||||
"track",
|
||||
"unitName",
|
||||
"verticalVelocity"
|
||||
]
|
||||
},
|
||||
"minItems": 1,
|
||||
"type": "array"
|
||||
|
||||
@ -68,7 +68,13 @@ export class UnitDataFileImport extends UnitDataFile {
|
||||
const validator = new ImportFileJSONSchemaValidator();
|
||||
if (!validator.validate(this.#fileData)) {
|
||||
const errors = validator.getErrors().reduce((acc:any, error:any) => {
|
||||
acc.push(error.instancePath + ": " + error.message)
|
||||
let errorString = error.instancePath.substring(1) + ": " + error.message;
|
||||
if (error.params) {
|
||||
const {allowedValues} = error.params;
|
||||
if (allowedValues)
|
||||
errorString += ": " + allowedValues.join(', ');
|
||||
}
|
||||
acc.push(errorString);
|
||||
return acc;
|
||||
}, [] as string[]);
|
||||
this.#showFileDataErrors(errors);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user