Ajv: any way to skip validation for a property of an object

Created on 27 Jul 2019  路  5Comments  路  Source: ajv-validator/ajv

 {
"title": "product",
"type": "object",
"properties": {
    "name": {
        "type": "string",
        "title": "Name",
        "propertyOrder": 1
    },
    "images": {
        "type": "array",
        "title": "acme.form.product.images",
        "items": {
            "type": "string",
            "title": "prototype",
            "format": "data-url"
        },
        "propertyOrder": 3
    }
}

I'd like to skip validation of images.items.

bug report

All 5 comments

Remove it from the schema.

I don't think this is a bug report, but a question.

@m-mohr , the images.items schema has to be there, because my UI is based on the schema.

Then clone it, remove images.items and pass the modified object to ajv. I don't think there is and should be a way to ignore parts of the schema in ajv.

I see, thank you.

@m-mohr , it seems custom keyword is another solution, check here

Was this page helpful?
0 / 5 - 0 ratings