• Is valid attribute validator

    Parameters

    • attributeService: AttributeDataService

      injected service use to handle the attribute related operations

      • getAttributeList
    • attributesField: TargetField

      which field to get the attributes from context

    • logger: Logger

      injected logger used to handle the logging

    • context: AdapterHandlerContext

      request context [headers, body, params, query].

    Returns Promise<number>

    200 Status Ok

    Description

    This validator is used to check if the attribute is valid by applying the following steps in sequence:

    1. Get the attribute data list from the context

    2. If attribute data list is empty return 200

    3. Get attribute list from attributeId (attributeService.getAttributeList)

    4. Check if attributes exists

    5. Check attributes type matches with it values

    6. Return 200

    Throws

    400 NBError Wrong parameter

    • attributeId is missing in attributeIdFieldInfo.type, attributeIdFieldInfo.name

    Throws

    404 NBError Not found

    • attribute not found: attributeId

Generated using TypeDoc