•  
      request #8794 Cannot remove the last attachment of a field using REST
    Infos
    #8794
    Joris MASSON (jmasson)
    2019-07-03 14:35
    2016-01-19 17:57
    8915
    Details
    Cannot remove the last attachment of a field using REST

    Given a file attachment field and given there was at least one file attached to it
    When I try to submit an empty value array for this field using either the REST route PUT /artifacts/{id} or the REST route POST /artifacts
    Then an error 400 Bad Request will be returned :

    "Bad Request: Invalid format for file field \"452\".  Correct format is {\"field_id\" : 425, \"value\" : [457, 258]}"

    Example JSON payload:

    {"values": [{"field_id": 452, "value": []}]}

    It was expected to be accepted as it is stated in the route documentation that this is how to empty a file field of its content.

     

    Agile Dashboard
    development
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Empty
    Closed
    2019-07-03
    Attachments
    Empty
    References
    References list is empty

    Follow-ups