Self Checks
Dify version
1.1.3
Cloud or Self Hosted
Cloud
Steps to reproduce
Use the API call: /datasets/{{dataset_id}}/documents/metadata
Configure the API call as follow:
{
"operation_data": [
{
"document_id": "{{document_id}}",
"metadata_list": [
{
"id": "{{medatadata_id}}",
"value": "metadata-value",
"name": "metadata-name"
}
]
}
]
}
✔️ Expected Behavior
The field "id" (the metadata-id) is required because it is used to create the binding between the doc and metadata
Its value should be validated
The field "name" should be removed because it can be inferred from the database using the metada's "id"
And since it is not validated it also causes the addition of invalid data
❌ Actual Behavior
"id" can have any value, it invalid it will not be added to the bindings table
The value for the metadata is saved using as keyvalue "name":"value" and if "name" does not match the metadata name (retrieved by "id") the value is not displayed
Self Checks
Dify version
1.1.3
Cloud or Self Hosted
Cloud
Steps to reproduce
Use the API call: /datasets/{{dataset_id}}/documents/metadata
Configure the API call as follow:
{
"operation_data": [
{
"document_id": "{{document_id}}",
"metadata_list": [
{
"id": "{{medatadata_id}}",
"value": "metadata-value",
"name": "metadata-name"
}
]
}
]
}
✔️ Expected Behavior
The field "id" (the metadata-id) is required because it is used to create the binding between the doc and metadata
Its value should be validated
The field "name" should be removed because it can be inferred from the database using the metada's "id"
And since it is not validated it also causes the addition of invalid data
❌ Actual Behavior
"id" can have any value, it invalid it will not be added to the bindings table
The value for the metadata is saved using as keyvalue "name":"value" and if "name" does not match the metadata name (retrieved by "id") the value is not displayed