Migrate internal schema validation to joi 2.0