JSON schema validation not working

liquibase-mongodb → 4.5.0

rule validations are not created for the collection.

example of a databaseChangeLog file:

{
“databaseChangeLog”: [
{
“changeSet”: {
“id”: “1”,
“author”: “author”,
“preConditions”: [
{
“onFail”: “WARN”
},
{
“documentExists”: {
“collectionName”: “student”
}
}
],
“comment”: “Create collection”,
“changes”: [
{
“createCollection”: {
“collectionName”: “student”,
“validator”: {
“$jsonSchema”: {
“bsonType”: “object”
“properties”: {
“studentId”: {
“bsonType”: “string”,
“maxLength”: 8,
“description”: “student id”
},
“description”: {
“bsonType”: “string”,
“maxLength”: 50,
“description”: “description”
}
}
}
},
“validationAction”: “error”,
“validationLevel”: “strict”
}
}
]
}
}
]
}