(cxt: KeywordCxt)
| 21 | schemaType: ["object", "boolean"], |
| 22 | error, |
| 23 | code(cxt: KeywordCxt) { |
| 24 | const {gen, schema, data, it} = cxt |
| 25 | if (alwaysValidSchema(it, schema)) return |
| 26 | const valid = gen.name("valid") |
| 27 | |
| 28 | gen.forIn("key", data, (key) => { |
| 29 | cxt.setParams({propertyName: key}) |
| 30 | cxt.subschema( |
| 31 | { |
| 32 | keyword: "propertyNames", |
| 33 | data: key, |
| 34 | dataTypes: ["string"], |
| 35 | propertyName: key, |
| 36 | compositeRule: true, |
| 37 | }, |
| 38 | valid |
| 39 | ) |
| 40 | gen.if(not(valid), () => { |
| 41 | cxt.error(true) |
| 42 | if (!it.allErrors) gen.break() |
| 43 | }) |
| 44 | }) |
| 45 | |
| 46 | cxt.ok(valid) |
| 47 | }, |
| 48 | } |
| 49 | |
| 50 | export default def |
nothing calls this directly
no test coverage detected
searching dependent graphs…