Skip to content

@ui5/project/validation/validator

A collection of validation related APIs

Description: A collection of validation related APIs

Source: project/lib/validation/validator.js, line 4

Methods

(static) getDefaults(options) → {Promise<options>}

Description: Validates the given ui5 configuration and returns default values if none are provided.

Source: project/lib/validation/validator.js, line 159

Parameters:
NameTypeDescription
optionsobject
Properties:
NameTypeAttributesDescription
configobjectThe UI5 Configuration to validate
projectobjectProject information
Properties
NameTypeDescription
idstringID of the project
yamlobjectoptionalYAML information
Properties
NameTypeAttributesDefaultDescription
pathstringPath of the YAML file
sourcestringContent of the YAML file
documentIndexnumberoptional0Document index in case the YAML file contains multiple documents
Throws:

Rejects with a ValidationError when the validation fails.

Type: module:@ui5/project/validation/ValidationError

Returns:

Returns a Promise that resolves when the validation succeeds

Type: Promise<options>

(static) validate(options) → {Promise<undefined>}

Description: Validates the given ui5 configuration.

Source: project/lib/validation/validator.js, line 136

Parameters:
NameTypeDescription
optionsobject
Properties:
NameTypeAttributesDescription
configobjectUI5 Configuration to validate
projectobjectProject information
Properties
NameTypeDescription
idstringID of the project
yamlobjectoptionalYAML information
Properties
NameTypeAttributesDefaultDescription
pathstringPath of the YAML file
sourcestringContent of the YAML file
documentIndexnumberoptional0Document index in case the YAML file contains multiple documents
Throws:

Rejects with a ValidationError when the validation fails.

Type: @ui5/project/validation/ValidationError

Returns:

Returns a Promise that resolves when the validation succeeds

Type: Promise<undefined>

(static) validateWorkspace(options) → {Promise<undefined>}

Description: Validates the given ui5-workspace configuration.

Source: project/lib/validation/validator.js, line 203

Parameters:
NameTypeDescription
optionsobject
Properties:
NameTypeAttributesDescription
configobjectui5-workspace Configuration to validate
yamlobjectoptionalYAML information
Properties
NameTypeAttributesDefaultDescription
pathstringPath of the YAML file
sourcestringContent of the YAML file
documentIndexnumberoptional0Document index in case the YAML file contains multiple documents
Throws:

Rejects with a ValidationError when the validation fails.

Type: @ui5/project/validation/ValidationError

Returns:

Returns a Promise that resolves when the validation succeeds

Type: Promise<undefined>