Skip to content

Commit 53beef2

Browse files
committed
refactor(runValidation): Add coment why strict flag of ajv is off
1 parent 005701b commit 53beef2

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/tools/run_manifest_validation/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default function registerTool(registerTool: RegisterTool, context: Contex
1010
registerTool("run_manifest_validation", {
1111
title: "Manifest Validation",
1212
description:
13-
"Validates UI5 manifest file." +
13+
"Validates UI5 manifest file. " +
1414
"After making changes, you should always run the validation again " +
1515
"to verify that no new problems have been introduced.",
1616
annotations: {

src/tools/run_manifest_validation/runValidation.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,14 @@ const AJV_SCHEMA_PATHS = {
2222
async function createUI5ManifestValidateFunction(ui5Schema: object) {
2323
try {
2424
const ajv = new Ajv2020.default({
25-
allErrors: true, // Collect all errors, not just the first one
26-
strict: false, // Allow additional properties that are not in schema
27-
unicodeRegExp: false, // Don't use Unicode-aware regular expressions,
25+
// Collect all errors, not just the first one
26+
allErrors: true,
27+
// Allow additional properties that are not in schema such as "i18n",
28+
// otherwise compilation fails
29+
strict: false,
30+
// Don't use Unicode-aware regular expressions,
2831
// otherwise compilation fails with "Invalid escape" errors
32+
unicodeRegExp: false,
2933
loadSchema: async (uri) => {
3034
const release = await fetchSchemaMutex.acquire();
3135

0 commit comments

Comments
 (0)