Skip to navigation

Data Path property renamed

Breaking change notice (2023.2.0)

Itential Platform 2023.2 introduces a breaking change that affects any custom logic depending on the dataPath property in an API error object.

Input validation failures

Many APIs reported input validation failures as a list of validation report objects. These objects specified the individual property that caused the failure in a key called dataPath:

[
{
"keyword": "type",
"dataPath": ".failingProperty1",
"schemaPath": "#/properties/failingProperty1/type",
"params": { "type": "string" },
"message": "should be string"
},
{
"keyword": "type",
"dataPath": ".failingProperty2",
"schemaPath": "#/properties/failingProperty2/type",
"params": { "type": "string" },
"message": "should be string"
}
]

In previous releases, the dataPath value was formatted as a dotted path:

{
"keyword": "type",
"dataPath": ".my.nested.property",
"schemaPath": "#/properties/my/properties/nested/properties/property/type",
"params": { "type": "string" },
"message": "should be string"
}

With the 2023.2 release, the dataPath property is renamed to instancePath and its value is formatted as a JSON Pointer:

{
"keyword": "type",
"instancePath": "/my/nested/property",
"schemaPath": "#/properties/my/properties/nested/properties/property/type",
"params": { "type": "string" },
"message": "should be string"
}

What should I do?

Update any code referring to dataPath to use instancePath instead. If your logic uses the value of dataPath programmatically, update it to use the new JSON Pointer format.