(schema, value, path)
| 182 | return [] |
| 183 | }, |
| 184 | oneOf (schema, value, path) { |
| 185 | let valid = 0 |
| 186 | const oneofErrors = [] |
| 187 | schema.oneOf.forEach((o, i) => { |
| 188 | /* Set the error paths to be path.oneOf[i].rest.of.path */ |
| 189 | const tmp = this._validateSchema(o, value, path) |
| 190 | if (!tmp.length) { |
| 191 | valid++ |
| 192 | } |
| 193 | |
| 194 | tmp.forEach(e => { |
| 195 | e.path = `${path}.oneOf[${i}]${e.path.substr(path.length)}` |
| 196 | }) |
| 197 | oneofErrors.push(...tmp) |
| 198 | }) |
| 199 | const errors = [] |
| 200 | if (valid !== 1) { |
| 201 | errors.push({ |
| 202 | path, |
| 203 | property: 'oneOf', |
| 204 | message: this.translate('error_oneOf', [valid], schema) |
| 205 | }) |
| 206 | errors.push(...oneofErrors) |
| 207 | } |
| 208 | return errors |
| 209 | }, |
| 210 | not (schema, value, path) { |
| 211 | if (!this._validateSchema(schema.not, value, path).length) { |
| 212 | return [{ |
nothing calls this directly
no test coverage detected