I was searching for an example of how to do this yesterday. The example I found in the Discourse repo is here: GitHub - discourse/discourse-chat-integration · GitHub. You’ll see that in that plugin’s plugin.rb file, the validator class is required with the following command:
require_relative "lib/discourse_chat/provider/slack/slack_enabled_setting_validator"
For Discourse to find the validator, it needs to be included before the call to after_initialize.