mastodon icon indicating copy to clipboard operation
mastodon copied to clipboard

API: ScheduledStatus serializer returns application ID (as integer)

Open trwnh opened this issue 3 years ago • 2 comments

Steps to reproduce the problem

GET /api/v1/scheduled_statuses or POST /api/v1/statuses?scheduled_at=...&...

Expected behaviour

application ID is returned as a string or not at all

Actual behaviour

application ID is returned as an integer

Detailed description

https://github.com/mastodon/mastodon/blob/cec1e902e006730f68bde0a4334e5b819a12a475/app/serializers/rest/scheduled_status_serializer.rb#L13

The line above implies that the application_id should not be returned, but it is:

{
    "id": "1",
    "scheduled_at": "2022-11-30T00:00:00.000Z",
    "params": {
        "text": "test post",
        "media_ids": null,
        "sensitive": null,
        "spoiler_text": null,
        "visibility": null,
        "language": null,
        "scheduled_at": null,
        "poll": null,
        "idempotency": null,
        "with_rate_limit": false,
        "in_reply_to_id": null,
        "application_id": 2
    },
    "media_attachments": []
}

Specifications

main

trwnh avatar Nov 28 '22 05:11 trwnh

For that matter, should params[scheduled_at] be returned either? And why is it null?

trwnh avatar Nov 28 '22 05:11 trwnh

And the in_reply_to_id is also an integer, when status IDs are supposed to be strings in theory

trwnh avatar Nov 28 '22 05:11 trwnh