aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev/build-libs.js6
-rw-r--r--ext/data/schemas/dictionary-kanji-bank-v1-schema.json1
-rw-r--r--ext/data/schemas/dictionary-kanji-bank-v3-schema.json1
-rw-r--r--ext/data/schemas/dictionary-kanji-meta-bank-v3-schema.json1
-rw-r--r--ext/data/schemas/dictionary-tag-bank-v3-schema.json1
-rw-r--r--ext/data/schemas/dictionary-term-bank-v1-schema.json1
-rw-r--r--ext/data/schemas/dictionary-term-bank-v3-schema.json1
-rw-r--r--ext/data/schemas/dictionary-term-meta-bank-v3-schema.json5
-rw-r--r--ext/data/schemas/options-schema.json2
9 files changed, 18 insertions, 1 deletions
diff --git a/dev/build-libs.js b/dev/build-libs.js
index 5caabec7..c3994ab3 100644
--- a/dev/build-libs.js
+++ b/dev/build-libs.js
@@ -60,7 +60,11 @@ export async function buildLibs() {
const schemaDir = path.join(extDir, 'data/schemas/');
const schemaFileNames = fs.readdirSync(schemaDir);
const schemas = schemaFileNames.map((schemaFileName) => JSON.parse(fs.readFileSync(path.join(schemaDir, schemaFileName), {encoding: 'utf8'})));
- const ajv = new Ajv({schemas: schemas, code: {source: true, esm: true}});
+ const ajv = new Ajv({
+ schemas,
+ code: {source: true, esm: true},
+ allowUnionTypes: true
+ });
const moduleCode = standaloneCode(ajv);
// https://github.com/ajv-validator/ajv/issues/2209
diff --git a/ext/data/schemas/dictionary-kanji-bank-v1-schema.json b/ext/data/schemas/dictionary-kanji-bank-v1-schema.json
index d506a19d..d13e143b 100644
--- a/ext/data/schemas/dictionary-kanji-bank-v1-schema.json
+++ b/ext/data/schemas/dictionary-kanji-bank-v1-schema.json
@@ -7,6 +7,7 @@
"type": "array",
"description": "Information about a single kanji character.",
"minItems": 4,
+ "maxItems": 4,
"items": [
{
"type": "string",
diff --git a/ext/data/schemas/dictionary-kanji-bank-v3-schema.json b/ext/data/schemas/dictionary-kanji-bank-v3-schema.json
index 763ce3b1..79272985 100644
--- a/ext/data/schemas/dictionary-kanji-bank-v3-schema.json
+++ b/ext/data/schemas/dictionary-kanji-bank-v3-schema.json
@@ -7,6 +7,7 @@
"type": "array",
"description": "Information about a single kanji character.",
"minItems": 6,
+ "maxItems": 6,
"additionalItems": false,
"items": [
{
diff --git a/ext/data/schemas/dictionary-kanji-meta-bank-v3-schema.json b/ext/data/schemas/dictionary-kanji-meta-bank-v3-schema.json
index d8f5031b..1cd80565 100644
--- a/ext/data/schemas/dictionary-kanji-meta-bank-v3-schema.json
+++ b/ext/data/schemas/dictionary-kanji-meta-bank-v3-schema.json
@@ -31,6 +31,7 @@
"type": "array",
"description": "Metadata about a single kanji character.",
"minItems": 3,
+ "maxItems": 3,
"additionalItems": false,
"items": [
{
diff --git a/ext/data/schemas/dictionary-tag-bank-v3-schema.json b/ext/data/schemas/dictionary-tag-bank-v3-schema.json
index ab6e3377..af8844e8 100644
--- a/ext/data/schemas/dictionary-tag-bank-v3-schema.json
+++ b/ext/data/schemas/dictionary-tag-bank-v3-schema.json
@@ -7,6 +7,7 @@
"type": "array",
"description": "Information about a single tag.",
"minItems": 5,
+ "maxItems": 5,
"additionalItems": false,
"items": [
{
diff --git a/ext/data/schemas/dictionary-term-bank-v1-schema.json b/ext/data/schemas/dictionary-term-bank-v1-schema.json
index ab4c49f6..4dd6e185 100644
--- a/ext/data/schemas/dictionary-term-bank-v1-schema.json
+++ b/ext/data/schemas/dictionary-term-bank-v1-schema.json
@@ -7,6 +7,7 @@
"type": "array",
"description": "Information about a single term.",
"minItems": 5,
+ "maxItems": 5,
"items": [
{
"type": "string",
diff --git a/ext/data/schemas/dictionary-term-bank-v3-schema.json b/ext/data/schemas/dictionary-term-bank-v3-schema.json
index 1df99135..2fc39c2e 100644
--- a/ext/data/schemas/dictionary-term-bank-v3-schema.json
+++ b/ext/data/schemas/dictionary-term-bank-v3-schema.json
@@ -315,6 +315,7 @@
"type": "array",
"description": "Information about a single term.",
"minItems": 8,
+ "maxItems": 8,
"additionalItems": false,
"items": [
{
diff --git a/ext/data/schemas/dictionary-term-meta-bank-v3-schema.json b/ext/data/schemas/dictionary-term-meta-bank-v3-schema.json
index 86e4af93..995c456a 100644
--- a/ext/data/schemas/dictionary-term-meta-bank-v3-schema.json
+++ b/ext/data/schemas/dictionary-term-meta-bank-v3-schema.json
@@ -31,6 +31,7 @@
"type": "array",
"description": "Metadata about a single term.",
"minItems": 3,
+ "maxItems": 3,
"additionalItems": false,
"items": [
{
@@ -48,6 +49,8 @@
],
"oneOf": [
{
+ "minItems": 3,
+ "maxItems": 3,
"items": [
{},
{"const": "freq"},
@@ -80,6 +83,8 @@
]
},
{
+ "minItems": 3,
+ "maxItems": 3,
"items": [
{},
{"const": "pitch"},
diff --git a/ext/data/schemas/options-schema.json b/ext/data/schemas/options-schema.json
index 7c131ecc..f5b24160 100644
--- a/ext/data/schemas/options-schema.json
+++ b/ext/data/schemas/options-schema.json
@@ -496,6 +496,7 @@
}
],
"items": {
+ "type": "object",
"required": [
"include",
"exclude",
@@ -776,6 +777,7 @@
"items": {
"type": "array",
"items": {
+ "type": "object",
"required": [
"pattern",
"ignoreCase",