Class ConfigValidator

java.lang.Object
io.github.jspinak.brobot.json.schemaValidation.ConfigValidator

@Component public class ConfigValidator extends Object
Main validator class for Brobot configurations. This serves as a facade to different validation strategies.
  • Constructor Details

  • Method Details

    • validateConfiguration

      public ValidationResult validateConfiguration(String projectJson, String dslJson, Path imageBasePath) throws ConfigValidationException
      Validates a project configuration file.
      Parameters:
      projectJson - The project configuration JSON
      dslJson - The automation DSL JSON
      imageBasePath - Base path to look for referenced images
      Returns:
      Validation result with any errors found
      Throws:
      ConfigValidationException - if validation fails with critical errors
    • validateProjectSchemaOnly

      public ValidationResult validateProjectSchemaOnly(String projectJson)
      Validates only the project schema without performing full validation. Useful for quick schema checks.
      Parameters:
      projectJson - The project configuration JSON
      Returns:
      Validation result with any schema errors found
    • validateDslSchemaOnly

      public ValidationResult validateDslSchemaOnly(String dslJson)
      Validates only the DSL schema without performing full validation. Useful for quick schema checks.
      Parameters:
      dslJson - The automation DSL JSON
      Returns:
      Validation result with any schema errors found
    • validateImageResourcesOnly

      public ValidationResult validateImageResourcesOnly(String projectJson, Path imageBasePath)
      Validates only the images referenced in a project configuration. Useful for verifying resource availability.
      Parameters:
      projectJson - The project configuration JSON
      imageBasePath - Base path to look for referenced images
      Returns:
      Validation result with any image resource errors found