Check datatype of a response body

hi @danny-dainton below i have mentioned the tried ajv methods but these all failed.
var Ajv = require(‘ajv’),

// ajv = new Ajv({logger: console}),

// schema = {

// “properties”: {

// “user_name”: {

// “type”:[“array”, “null”]

// }

// }

// };

// var Ajv = require(‘ajv’),

// ajv = new Ajv({logger: console}),

// schema = {

// “properties”: {

// “parentName”: {

// “type”:[“string”, “null”]

// }

// }

// };

// pm.test(‘Verify parentName is string’, function() {

// var resParentName = pm.response.json().demo[0].parentName;

// pm.expect(ajv.validate(schema, {parentName: resParentName})).to.be.true;

// });

var schema = {

“items”: {

"type": ["array","null"]

}

};

// pm.test(‘Schema is valid’, function() {

// console.log(pm.expect(tv4.validate(data1, schema)).to.be.true);

// });

// pm.test(“Validate schema by shyam new”, () => {

// for(var i = 0; i < respSize; i++){

// var data1 = [jsonData.response[i].user_name];

// //var data2 = [jsonData.response[i].alert_score];

// }

// pm.response.to.have.jsonSchema(data1,schema);

// });

// var Ajv = require(‘ajv’),

// ajv = new Ajv({ logger: console, allErrors: true }),

// schema = {

// “type”:“object”,

// “required”:[

// “user_name”,

// “alert_score”,

// “message”,

// “confidence_score”,

// “assigned_to”,

// “recommendation”

// ],

// “properties”:{

// “user_name”:{

// “$id”:"#/properties/User_name",

// “type”:[“array”,“null”]

// }

// }

// }

// pm.test(‘success shyam’, function() {

// pm.expect(ajv.validate(schema, pm.response.json()), JSON.stringify(ajv.errors)).to.be.true;

// });

// pm.test(‘again datatype check’, function() {

// for(var i = 0; i < respSize; i++){

// pm.expect( typeof(jsonData.response[i].user_name)).to.be.oneOf([ “array”,“null”]);

// }

// });