@jambonz/schema 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -41,9 +41,24 @@
|
|
|
41
41
|
},
|
|
42
42
|
"hints": {
|
|
43
43
|
"type": "array",
|
|
44
|
-
"items": {
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
"items": {
|
|
45
|
+
"oneOf": [
|
|
46
|
+
{ "type": "string" },
|
|
47
|
+
{
|
|
48
|
+
"type": "object",
|
|
49
|
+
"properties": {
|
|
50
|
+
"phrase": { "type": "string" },
|
|
51
|
+
"boost": { "type": "number" }
|
|
52
|
+
},
|
|
53
|
+
"required": ["phrase"]
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
"description": "An array of words or phrases that the recognizer should favor. Each item can be a plain string or an object with 'phrase' and optional 'boost' properties.",
|
|
58
|
+
"examples": [
|
|
59
|
+
["jambonz", "drachtio", "SIP", "WebRTC"],
|
|
60
|
+
[{"phrase": "jambonz", "boost": 20}, {"phrase": "drachtio", "boost": 10}]
|
|
61
|
+
]
|
|
47
62
|
},
|
|
48
63
|
"hintsBoost": {
|
|
49
64
|
"type": "number",
|
package/lib/validator.js
CHANGED
|
@@ -88,9 +88,8 @@ function validateVerb(name, data, logger) {
|
|
|
88
88
|
if (!valid) {
|
|
89
89
|
const errors = validate.errors || [];
|
|
90
90
|
const details = errors.map((e) => {
|
|
91
|
-
const path = e.instancePath || '
|
|
92
|
-
|
|
93
|
-
let msg = `property '${prop}': ${e.message}`;
|
|
91
|
+
const path = e.instancePath || '(root)';
|
|
92
|
+
let msg = `'${path}': ${e.message}`;
|
|
94
93
|
if (e.params) {
|
|
95
94
|
if (e.params.type) msg += ` (expected ${e.params.type})`;
|
|
96
95
|
if (e.params.allowedValues) msg += ` (allowed: ${e.params.allowedValues.join(', ')})`;
|