Commit 53ca0aaf authored by Diegodlh's avatar Diegodlh
Browse files

Additional changes for better JSON editor appearance

parent 79e5f0d3
...@@ -4,8 +4,9 @@ ...@@ -4,8 +4,9 @@
"title": "Domain URL path patterns configuration for Web2Cit", "title": "Domain URL path patterns configuration for Web2Cit",
"description": "A list of URL path patterns", "description": "A list of URL path patterns",
"type": "array", "type": "array",
"format": "tabs",
"items": { "items": {
"title": "URL path pattern", "title": "Path pattern",
"description": "A URL path pattern defines a translation subgroup within a domain", "description": "A URL path pattern defines a translation subgroup within a domain",
"type": "object", "type": "object",
"properties": { "properties": {
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
"title": "Domain translation tests configuration for Web2Cit", "title": "Domain translation tests configuration for Web2Cit",
"description": "Each translation test defines translation output goals for a specific test webpage (see https://meta.wikimedia.org/wiki/Web2Cit/Early_adopters#tests.json)", "description": "Each translation test defines translation output goals for a specific test webpage (see https://meta.wikimedia.org/wiki/Web2Cit/Early_adopters#tests.json)",
"type": "array", "type": "array",
"format": "tabs-top",
"items": { "items": {
"title": "Translation test", "title": "Translation test",
"type": "object", "type": "object",
...@@ -22,30 +23,51 @@ ...@@ -22,30 +23,51 @@
"fields": { "fields": {
"title": "Fields", "title": "Fields",
"description": "Each test field specifies a translation output goal for a specific citation field (see https://meta.wikimedia.org/wiki/Web2Cit/Early_adopters#Translation_field_types)", "description": "Each test field specifies a translation output goal for a specific citation field (see https://meta.wikimedia.org/wiki/Web2Cit/Early_adopters#Translation_field_types)",
"options": { "infoText": "Duplicate test fields with the same field name will be ignored." }, "options": {
"infoText": "Duplicate test fields with the same field name will be ignored.",
"disable_array_reorder": true
},
"type": "array", "type": "array",
"format": "tabs-top",
"items": { "items": {
"title": "Test field", "title": "Test field",
"options": { "error_messages": { "options": { "error_messages": {
"en": { "error_oneOf": "Invalid translation goal" } "en": { "error_oneOf": "Invalid translation goal" }
}}, }},
"type": "object",
"properties": {
"fieldname": {
"type": "string",
"options": { "hidden": true }
},
"goal": {
"title": "Translation goal",
"description": "A list of values representing the expected translation output for a test field.",
"options": { "infoText": "Provide an empty list to explicitly express that no output is expected." },
"type": "array",
"format": "table",
"items": {
"title": "Output value",
"type": "string"
}
}
},
"required": [
"fieldname",
"goal"
],
"oneOf": [ "oneOf": [
{ {
"title": "Item type field", "title": "Item type field",
"description": "Type of the cited resource", "description": "Type of the cited resource",
"type": "object",
"properties": { "properties": {
"fieldname": { "fieldname": {
"title": "Field name", "title": "Field name",
"type": "string", "enum": ["itemType"]
"enum": ["itemType"],
"options": { "hidden": true }
}, },
"goal": { "goal": {
"$ref": "#/definitions/goal",
"maxItems": 1, "maxItems": 1,
"items": { "items": {
"$ref": "#/definitions/value",
"description": "One of the Citoid/Zotero supported types", "description": "One of the Citoid/Zotero supported types",
"enum": [ "enum": [
"artwork", "artwork",
...@@ -87,28 +109,19 @@ ...@@ -87,28 +109,19 @@
] ]
} }
} }
}, }
"required": [
"fieldname",
"goal"
]
}, },
{ {
"title": "Title field", "title": "Title field",
"description": "Title of the cited resource", "description": "Title of the cited resource",
"type": "object",
"properties": { "properties": {
"fieldname": { "fieldname": {
"title": "Field name", "title": "Field name",
"type": "string", "enum": ["title"]
"enum": ["title"],
"options": { "hidden": true }
}, },
"goal": { "goal": {
"$ref": "#/definitions/goal",
"maxItems": 1, "maxItems": 1,
"items": { "items": {
"$ref": "#/definitions/value",
"description": "A non-empty string", "description": "A non-empty string",
"pattern": "^.+$", "pattern": "^.+$",
"options": { "options": {
...@@ -116,27 +129,18 @@ ...@@ -116,27 +129,18 @@
} }
} }
} }
}, }
"required": [
"fieldname",
"goal"
]
}, },
{ {
"title": "Author last/full names field", "title": "Author last/full names field",
"description": "Authors' last or full names", "description": "Authors' last or full names",
"type": "object",
"properties": { "properties": {
"fieldname": { "fieldname": {
"title": "Field name", "title": "Field name",
"type": "string", "enum": ["authorLast"]
"enum": ["authorLast"],
"options": { "hidden": true }
}, },
"goal": { "goal": {
"$ref": "#/definitions/goal",
"items": { "items": {
"$ref": "#/definitions/value",
"description": "A non-empty string", "description": "A non-empty string",
"pattern": "^.+$", "pattern": "^.+$",
"options": { "options": {
...@@ -144,53 +148,35 @@ ...@@ -144,53 +148,35 @@
} }
} }
} }
}, }
"required": [
"fieldname",
"goal"
]
}, },
{ {
"title": "Author first names field", "title": "Author first names field",
"description": "Authors' first names", "description": "Authors' first names",
"type": "object",
"properties": { "properties": {
"fieldname": { "fieldname": {
"title": "Field name", "title": "Field name",
"type": "string", "enum": ["authorFirst"]
"enum": ["authorFirst"],
"options": { "hidden": true }
}, },
"goal": { "goal": {
"$ref": "#/definitions/goal",
"items": { "items": {
"$ref": "#/definitions/value",
"description": "An empty or non-empty string", "description": "An empty or non-empty string",
"pattern": "^.*$" "pattern": "^.*$"
} }
} }
}, }
"required": [
"fieldname",
"goal"
]
}, },
{ {
"title": "Date field", "title": "Date field",
"description": "Publishing date", "description": "Publishing date",
"type": "object",
"properties": { "properties": {
"fieldname": { "fieldname": {
"title": "Field name", "title": "Field name",
"type": "string", "enum": ["date"]
"enum": ["date"],
"options": { "hidden": true }
}, },
"goal": { "goal": {
"$ref": "#/definitions/goal",
"maxItems": 1, "maxItems": 1,
"items": { "items": {
"$ref": "#/definitions/value",
"description": "A date matching yyyy-mm-dd, yyyy-mm or yyyy formats", "description": "A date matching yyyy-mm-dd, yyyy-mm or yyyy formats",
"pattern": "^\\d{4}(-\\d{2}(-\\d{2})?)?$", "pattern": "^\\d{4}(-\\d{2}(-\\d{2})?)?$",
"options": { "options": {
...@@ -198,28 +184,19 @@ ...@@ -198,28 +184,19 @@
} }
} }
} }
}, }
"required": [
"fieldname",
"goal"
]
}, },
{ {
"title": "Published in field", "title": "Published in field",
"description": "Work containing the cited resource", "description": "Work containing the cited resource",
"type": "object",
"properties": { "properties": {
"fieldname": { "fieldname": {
"title": "Field name", "title": "Field name",
"type": "string", "enum": ["publishedIn"]
"enum": ["publishedIn"],
"options": { "hidden": true }
}, },
"goal": { "goal": {
"$ref": "#/definitions/goal",
"maxItems": 1, "maxItems": 1,
"items": { "items": {
"$ref": "#/definitions/value",
"description": "A non-empty string", "description": "A non-empty string",
"pattern": "^.+$", "pattern": "^.+$",
"options": { "options": {
...@@ -227,28 +204,19 @@ ...@@ -227,28 +204,19 @@
} }
} }
} }
}, }
"required": [
"fieldname",
"goal"
]
}, },
{ {
"title": "Published by field", "title": "Published by field",
"description": "Publisher of the cited resource", "description": "Publisher of the cited resource",
"type": "object",
"properties": { "properties": {
"fieldname": { "fieldname": {
"title": "Field name", "title": "Field name",
"type": "string", "enum": ["publishedBy"]
"enum": ["publishedBy"],
"options": { "hidden": true }
}, },
"goal": { "goal": {
"$ref": "#/definitions/goal",
"maxItems": 1, "maxItems": 1,
"items": { "items": {
"$ref": "#/definitions/value",
"description": "A non-empty string", "description": "A non-empty string",
"pattern": "^.+$", "pattern": "^.+$",
"options": { "options": {
...@@ -256,37 +224,24 @@ ...@@ -256,37 +224,24 @@
} }
} }
} }
}, }
"required": [
"fieldname",
"goal"
]
}, },
{ {
"title": "Language field", "title": "Language field",
"description": "Publishing language", "description": "Publishing language",
"type": "object",
"properties": { "properties": {
"fieldname": { "fieldname": {
"title": "Field name", "title": "Field name",
"type": "string", "enum": ["language"]
"enum": ["language"],
"options": { "hidden": true }
}, },
"goal": { "goal": {
"$ref": "#/definitions/goal",
"maxItems": 1, "maxItems": 1,
"items": { "items": {
"$ref": "#/definitions/value",
"description": "A language code matching xx or xx-xx* formats", "description": "A language code matching xx or xx-xx* formats",
"pattern": "^[a-zA-Z]{2}(?:-?[a-zA-Z]{2,})*$" "pattern": "^[a-zA-Z]{2}(?:-?[a-zA-Z]{2,})*$"
} }
} }
}, }
"required": [
"fieldname",
"goal"
]
} }
] ]
} }
...@@ -296,17 +251,4 @@ ...@@ -296,17 +251,4 @@
"path", "path",
"fields" "fields"
] ]
}, }}
"definitions": {
"goal": {
"title": "Translation goal",
"description": "A list of values representing the expected translation output for a test field.",
"options": { "infoText": "Provide an empty list to explicitly express that no output is expected." },
"type": "array"
},
"value": {
"title": "Output value",
"type": "string"
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment