providedh / collaborative-platform

Collaboration made easy
GNU Affero General Public License v3.0
0 stars 1 forks source link

Adding uncertainty to a new entity property sends an invalid request #243

Open bug-rancher opened 3 years ago

bug-rancher commented 3 years ago

Creating an entity with an attribute and uncertainty added to the attribute causes an error (response from server { status: 500, message: "Unhandled exception.", body_content: null }).

Steps to reproduce the error

Cause of error In the request, in the element ["payload"][3]["new_element_id"] (the element responsible for adding uncertainty) the name of the attribute to which the uncertainty is added is missing. Currently it gives the number of the operation in which the entity is created (in this case 1), and according to the documentation the name of the attribute to which the uncertainty is added should also be added (in this case the correct form is: "1/name")

Example request

{
    "method": "modify",
    "payload": [
        {
            "element_type": "tag",
            "method": "POST",
            "parameters": {
                "end_pos": 1150,
                "start_pos": 1144
            }
        },
        {
            "edited_element_id": 0,
            "element_type": "reference",
            "method": "POST",
            "parameters": {
                "entity_type": "person"
            }
        },
        {
            "edited_element_id": 1,
            "element_type": "entity_property",
            "method": "POST",
            "parameters": {
                "name": "n"
            }
        },
        {
            "element_type": "certainty",
            "method": "POST",
            "new_element_id": 1,
            "parameters": {
                "asserted_value": "ccc",
                "categories": [],
                "certainty": "low",
                "description": "",
                "locus": "attribute"
            }
        }
    ]
}