jointakahe/takahe

statuses: `status` field not optional when `media_ids[]` present

ishigoya opened this issue · 1 comments

I encountered this issue while creating a request with curl.

In the Mastodon API, the status field is optional when media_ids[] is present, however even in this case it appears to be required in Takahe.

Against mastodon.social (results in a successful post):

$ curl -H "Authorization: Bearer <snip>" \
    -X POST -H "Content-Type: multipart/form-data" \
    https://mastodon.social/api/v1/media \ 
    --form file="@map.png" | jq
$ curl -k -X POST     \
     -H "Authorization: Bearer <snip>"   \
    -F 'media_ids[]=<from above>'  \
    https://mastodon.social/api/v1/statuses

A similar request against a Takahe instance returns the following error:

{
  "error": "invalid_input",
  "error_details": [
    {
      "loc": [
        "details",
        "status"
      ],
      "msg": "field required",
      "type": "value_error.missing"
    }
  ]
}

Yup, I guess that makes sense. This will be a good first bug for someone to fix.