@Override
  protected Result validate(Set<Path> pathsToWatch) {
    Result result = null;
    try {
      pathsToWatch.add(schemaPath);
      var schema = SchemaConfig.load(schemaPath);
      var examples = schema.examples();
      // examples can either be embedded in the yaml file, or referenced
      SchemaSpecification spec;
      if (examples instanceof String s) {
        var path = Path.of(s);
        if (!path.isAbsolute()) {
          path = schemaPath.resolveSibling(path);
        }
        // if referenced, make sure we watch that file for changes
        pathsToWatch.add(path);
        spec = SchemaSpecification.load(path);
      } else if (examples != null) {
        spec = YAML.convertValue(schema, SchemaSpecification.class);
      } else {
        spec = new SchemaSpecification(List.of());
      }
      result = validate(schema, spec);
    } catch (Exception exception) {
      Throwable rootCause = ExceptionUtils.getRootCause(exception);
      if (hasCause(exception, com.onthegomap.planetiler.custommap.expression.ParseException.class)) {
        output.println(AnsiColors.red("Malformed expression:\n\n" + rootCause.toString().indent(4)));
      } else if (hasCause(exception, YamlEngineException.class) || hasCause(exception, JacksonException.class)) {
        output.println(AnsiColors.red("Malformed yaml input:\n\n" + rootCause.toString().indent(4)));
      } else {
        output.println(AnsiColors.red(
          "Unexpected exception thrown:\n" + rootCause.toString().indent(4) + "\n" +
            String.join("\n", ExceptionUtils.getStackTrace(rootCause)))
          .indent(4));
      }
    }
    return result;
  }
Returns the result of validating the profile defined by {@code schema} against the examples in
{@code specification}.
planetiler-custommap/src/main/java/com/onthegomap/planetiler/custommap/validator/SchemaValidator.java