Open JuAlMan opened 3 months ago
should be fixed with, https://github.com/dc4eu/vc/commit/e1ea46f3d3bd5e1393e1686af6d9c465efd1d4ca
I tried with the same invalid identity object as i posted before, but still get no validation errors. The objects with the submitted identities array don't seem to be validated
When I tried with the above request, I got;
{
"error": {
"title": "validation_error",
"details": [
{
"field": "authentic_source",
"namespace": "authentic_source",
"type": "string",
"validation": "required",
"validationParam": "",
"value": ""
},
{
"field": "document_type",
"namespace": "document_type",
"type": "string",
"validation": "required",
"validationParam": "",
"value": ""
},
{
"field": "document_id",
"namespace": "document_id",
"type": "string",
"validation": "required",
"validationParam": "",
"value": ""
}
]
}
}
I am sorry, i guess i didn't outline the problem precisely enough.
What i meant is that the identity objects in the array are not validated. So if i submit a request like
{
"authentic_source": "data_existent_in_db",
"document_type": "data_existent_in_db",
"document_id": "data_existent_in_db",
"identities": [
{
"name": 2
}
]
}
This just works fine even though the submitted identity object is obviously not valid. Of course i get a validation error as well if i leave out any of the top-level attributes like document_id, etc.
Same behaviour with the upload call. So our request is that that every submitted identity object should be validated
Using image docker.sunet.se/dc4eu/apigw:apiv28
When uploading a document or using the PUT /document/identity call for adding identities, it is possible to submit invalid identity objects like this:
We propose that all identity objects in the array should be validated to make sure that all required attributes are set and the types are matching.