Issue/Question
You observe intermittent failures when running conformance scans.
The failures show invalid requests being sent for the happy path scenario, where the requests are missing required data.
You notice "-d 'null'" in the cURL request.
Rerunning Conformance Scan sometimes appears to fix the issue.
Solution/Answer
This is a result of a minLength and maxLength parameters on your object conflicting with a pattern parameter.
When the minLength/maxLength values do not correspond with the string limits defined in the regex pattern, it’s possible for the scan algorithm to fail to find a valid sample data after a number of attempts. It may then default to using a null body.
For example, here there is a conflict between the minLength and maxLength values and the regex pattern. The pattern indicates a minimum length of 1 and maximum length of unlimited:
"routingNumber": {
"type": "string",
"minLength": 9,
"maxLength": 9,
"pattern": "^\d+$"
}
The recommended solution is to accurately tighten the regex pattern so that it does not conflict with the defined min and max lengths:
"routingNumber": {
"type": "string",
"minLength": 9,
"maxLength": 9,
"pattern": "^\d{9}$"
}
You can read more about this in the 42Crunch documentation: read more
Comments
0 comments
Please sign in to leave a comment.