Skip to content

Commit

Permalink
fix: rename variables to fit new .json file names
Browse files Browse the repository at this point in the history
  • Loading branch information
ethangreen-dev committed Jan 27, 2025
1 parent 402801d commit 255975e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/model/schema/ThunderstoreSchema.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import Ajv from "ajv";
import addFormats from "ajv-formats";
import schema from "../../../ecosystem.json";
import schemaSchema from "../../../ecosystemJsonSchema.json";
import { GameSelectionDisplayMode } from "../game/GameSelectionDisplayMode";
import ecosystem from "../../../ecosystem.json";
import jsonSchema from "../../../ecosystemJsonSchema.json";
import R2Error from "../errors/R2Error";


Expand All @@ -14,22 +13,22 @@ export class EcosystemSchema {
*/
static get get() {
if (this._isValidated) {
return schema;
return ecosystem;
}

// Validate the schema via its schema schema.
const ajv = new Ajv();
addFormats(ajv);

const validate = ajv.compile(schemaSchema);
const isOk = validate(schema);
const validate = ajv.compile(jsonSchema);
const isOk = validate(ecosystem);

if (!isOk) {
throw new R2Error("Schema validation error", ajv.errorsText(validate.errors));
}

this._isValidated = true;
return schema;
return ecosystem;
}

/**
Expand Down

0 comments on commit 255975e

Please sign in to comment.