InitTemplateBase._validatePropertiesDefinitions() method
Validates the structure and content of property definitions.
Signature
protected _validatePropertiesDefinitions(): void;
Returns
void
Remarks
This internal method performs comprehensive validation of the property definitions object during template construction, ensuring all definitions are well-formed and internally consistent before the template is used.
Validation steps:
- Overall structure:
- Verifies that
propertiesDefinitionsis an object. - Ensures at least one property is defined (not empty).
- Verifies that
- Common property fields:
label: Must be a non-empty string.description: Must be a non-empty string.isMandatory: Must be a boolean if present.type: Must be defined and one of:select,string,number,boolean.
- Type-specific validation:
- Select properties:
- Must have an
itemsobject with at least one entry. - Each item must be either a string (description) or an object with
platformsarray andmessagestring. - Non-mandatory properties must have a default value.
- Default values must be non-empty strings present in the items list.
- Must have an
- String properties: Default value must be a non-empty string if present.
- Number properties: Default value must be a number if present.
- Boolean properties: Default value must be a boolean if present.
- Select properties:
This validation ensures that templates are correctly configured before use, preventing runtime errors during property processing and interactive prompting. Any validation failure triggers an assertion error with a descriptive message indicating the specific problem.
Generated via tsdoc2docusaurus 1.3.2 by API Extractor/Documenter 7.57.2.