BUG: Unique items in array of dictionaries
Closed this issue · 0 comments
ghandic commented
Since current implementation is making use of set
s in Python, dicts are not hashable, change would be needed to rectify this.
Example
"errors": {
"type": "object",
"properties": {
"validationErrors": {
"type": "array",
"minItems": 0,
"maxItems": 2,
"uniqueItems": false,
"items": [
{
"type": "object",
"$state": {
"error": "lambda: random.choice([{'code':'3013','message':'Mandatory field is either Null or blank','field':'IDNumber'}, {'code':'2013','message':'Mandatory field is either Null or blank','field':'IDNumber'}])"
},
"properties": {
"code": {
"type": "string",
"description": "Error code from Digital gateway validation checks",
"$provider": "lambda: state['validationErrors[0]']['error']['code']"
},
"message": {
"type": "string",
"description": "",
"$provider": "lambda: state['validationErrors[0]']['error']['message']"
},
"field": {
"type": "string",
"description": "",
"$provider": "lambda: state['validationErrors[0]']['error']['field']"
}
},
"required": ["code", "message", "field"]
}
]
}
},
"required": ["validationErrors"]
}