When my response does not match with the schema defined, it throws an error and breaks the application. I want a solution to log this as an error/warning, instead of breaking the application.

As you can see in the image, relatedKeywords is type array. But from my code, for some reason, it was populated as object. I get this error then:

When my response does not match with the schema defined, it throws an error and breaks the application. I want a solution to log this as an error/warning, instead of breaking the application.
As you can see in the image,

relatedKeywordsis type array. But from my code, for some reason, it was populated as object. I get this error then: