Class ConfigValidator
java.lang.Object
io.github.jspinak.brobot.json.schemaValidation.ConfigValidator
Main validator class for Brobot configurations.
This serves as a facade to different validation strategies.
-
Constructor Summary
ConstructorsConstructorDescriptionConfigValidator
(SchemaValidator schemaValidator, ReferenceValidator referenceValidator, BusinessRuleValidator businessRuleValidator, ImageResourceValidator imageResourceValidator) -
Method Summary
Modifier and TypeMethodDescriptionvalidateConfiguration
(String projectJson, String dslJson, Path imageBasePath) Validates a project configuration file.validateDslSchemaOnly
(String dslJson) Validates only the DSL schema without performing full validation.validateImageResourcesOnly
(String projectJson, Path imageBasePath) Validates only the images referenced in a project configuration.validateProjectSchemaOnly
(String projectJson) Validates only the project schema without performing full validation.
-
Constructor Details
-
ConfigValidator
public ConfigValidator(SchemaValidator schemaValidator, ReferenceValidator referenceValidator, BusinessRuleValidator businessRuleValidator, ImageResourceValidator imageResourceValidator)
-
-
Method Details
-
validateConfiguration
public ValidationResult validateConfiguration(String projectJson, String dslJson, Path imageBasePath) throws ConfigValidationException Validates a project configuration file.- Parameters:
projectJson
- The project configuration JSONdslJson
- The automation DSL JSONimageBasePath
- Base path to look for referenced images- Returns:
- Validation result with any errors found
- Throws:
ConfigValidationException
- if validation fails with critical errors
-
validateProjectSchemaOnly
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
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
Validates only the images referenced in a project configuration. Useful for verifying resource availability.- Parameters:
projectJson
- The project configuration JSONimageBasePath
- Base path to look for referenced images- Returns:
- Validation result with any image resource errors found
-