| 1 | import type {CodeKeywordDefinition} from "../../types" |
| 2 | import type {KeywordCxt} from "../../compile/validate" |
| 3 | import {validateProperties, error} from "./properties" |
| 4 | |
| 5 | const def: CodeKeywordDefinition = { |
| 6 | keyword: "optionalProperties", |
| 7 | schemaType: "object", |
| 8 | error, |
| 9 | code(cxt: KeywordCxt) { |
| 10 | if (cxt.parentSchema.properties) return |
| 11 | validateProperties(cxt) |
| 12 | }, |
| 13 | } |
| 14 | |
| 15 | export default def |