(schema, value, path, validatedProperties)
| 597 | return errors |
| 598 | }, |
| 599 | additionalProperties (schema, value, path, validatedProperties) { |
| 600 | const errors = [] |
| 601 | const keys = Object.keys(value) |
| 602 | for (let i = 0; i < keys.length; i++) { |
| 603 | const k = keys[i] |
| 604 | if (validatedProperties[k]) continue |
| 605 | /* No extra properties allowed */ |
| 606 | if (!schema.additionalProperties) { |
| 607 | errors.push({ |
| 608 | path, |
| 609 | property: 'additionalProperties', |
| 610 | message: this.translate('error_additional_properties', [k], schema) |
| 611 | }) |
| 612 | break |
| 613 | /* Allowed */ |
| 614 | } else if (schema.additionalProperties === true) { |
| 615 | break |
| 616 | /* Must match schema */ |
| 617 | /* TODO: incompatibility between version 3 and 4 of the spec */ |
| 618 | } else { |
| 619 | errors.push(...this._validateSchema(schema.additionalProperties, value[k], `${path}.${k}`)) |
| 620 | } |
| 621 | } |
| 622 | return errors |
| 623 | }, |
| 624 | dependencies (schema, value, path) { |
| 625 | const errors = [] |
| 626 | Object.entries(schema.dependencies).forEach(([i, dep]) => { |
nothing calls this directly
no test coverage detected