DataPower

DataPower

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

JSON schema validation on datapower does not vlaidate against "format" attrbute of the schema

  • 1.  JSON schema validation on datapower does not vlaidate against "format" attrbute of the schema

    Posted Thu February 18, 2021 11:46 AM

    Hi All,

    We have below definition for one of the fields in the json schema

    "UUID": {

    "type": "string",

    "format": "uuid",

    "maxLength": 36,

    "title": "UUID"

    }

    So ideally it should only allow field having the format of UUID. Correct me if I am misstating something.

    But when we pass this value in the json request, it does not throw an error. It does not really match against UUID format.

    "UUID : "abcd"

    I wanted to know whether datapower validates a json message against the format attribute mentioned in the json schema or the regex pattern needs to be mentioned explicitly.



    #DataPower
    #Support
    #SupportMigration


  • 2.  RE: JSON schema validation on datapower does not vlaidate against "format" attrbute of the schema

    Posted Tue February 23, 2021 02:31 PM

    Hi,

    DataPower does validate against format (try "ip-address"), but "uuid" is not among the implemented formats.

    Please use

    "pattern": "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"

    instead of:

    "format":"uuid"



    #DataPower
    #Support
    #SupportMigration