SAP-BTP-Spielwiese/app1/node_modules/ajv/lib/vocabularies/validation/limitContains.ts
Markus Rettig 775ac7b58c completed step 3 from the tutorial
you must login with an BTP account in order to see the app
2024-02-08 16:13:36 +01:00

16 lines
485 B
TypeScript

import type {CodeKeywordDefinition} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {checkStrictMode} from "../../compile/util"
const def: CodeKeywordDefinition = {
keyword: ["maxContains", "minContains"],
type: "array",
schemaType: "number",
code({keyword, parentSchema, it}: KeywordCxt) {
if (parentSchema.contains === undefined) {
checkStrictMode(it, `"${keyword}" without "contains" is ignored`)
}
},
}
export default def