API issue from POC
Customer is testing API calls for DQ and encountering an issue. Could use some advice on what the issue might be here?
Please find below the input & the response for rule import via API.
Input:
{
“businessCategory”: “”,
“businessDesc”: “”,
“columnName”: “POSTAL_CODE”,
“dataset”: “PSJDIADB.OWLDQ_POC_3”,
“dimId”: null,
“dimName”: null,
“exception”: null,
“isActive”: 1,
“perc”: 1.0,
“points”: 1,
“ruleNm”: “123”,
“ruleRepo”: “”,
“ruleType”: “SQLG”,
“ruleValue”: “ADDRESS != '123”,
“ruleValueBuilder”: “{“condition”:“AND”,“rules”:[{“id”:null,“field”:null,“type”:null,“input”:null,“operator”:null}],“not”:false,“valid”:false}”,
“userNm”: “admin”
}
Response:
{
“timestamp”: “2021-12-15T16:00:07.775+0000”,
“status”: 400,
“error”: “Bad Request”,
“errors”: [
{
"codes": [
"Pattern.ruleDTO.ruleNm",
"Pattern.ruleNm",
"Pattern.java.lang.String",
"Pattern"
],
"arguments": [
{
"codes": [
"ruleDTO.ruleNm",
"ruleNm"
],
"arguments": null,
"defaultMessage": "ruleNm",
"code": "ruleNm"
},
[],
{
"defaultMessage": "[^a-zA-Z0-9_-]",
"arguments": null,
"codes": [
"[^a-zA-Z0-9_-]"
]
}
],
"defaultMessage": "No special character allowed as rule name",
"objectName": "ruleDTO",
"field": "ruleNm",
"rejectedValue": "123",
"bindingFailure": false,
"code": "Pattern"
}
],
“message”: “Validation failed for object=‘ruleDTO’. Error count: 1”,
“path”: “/v3/rules”
}
adamblalock
OP4 years ago · EditedAs a note, the error appears to be saying that there is a special character in the rule name.
The rule name being proposed is “123” and this was tested with something as simple as “testRule” for example as well.