code: def validate!
        if self.class.json_schema
          self.class.validator.instance_variable_set('@errors', [])
          self.class.validator.instance_variable_set('@data', stringify_keys(to_h(persist: true)))
          self.class.validator.validate
          true
        end
      end
docs: Validates the object against the schema.
  
   @raises [JSON::Schema::ValidationError] if the object is invalid