I was wanting to do something similar recently, ended up getting it to work with Ajv validation instead, this topic might be helpful to you:
@danny-dainton has a more concise example here of Ajv validation if that’s all you’ll need:
I ended up ditching Schema validation and testing it a different way as the API I’m testing has become really complicated and the schema way was just a bit too advanced for me to do for now.