Skip to content

[API] Push subscription type inconsistency  #10789

@buckket

Description

@buckket

GET /api/v1/push/subscription returns a Push subscription object containing an alerts dict which specifies which alert types are currently active. It’s a boolean value but they are presented as strings instead of true booleans. In other places the API correctly uses the boolean type to represent such values. I would expect this to be the case here also.

Edit: Also the alert object is currently undocumented.

Expected behaviour

{"id":1,"endpoint":"https://example.com","alerts":{"follow":true,"favourite":true,"reblog":true,"mention":true},"server_key":"foobar"}

Actual behaviour

{"id":1,"endpoint":"https://example.com","alerts":{"follow":"true","favourite":"true","reblog":"true","mention":"true"},"server_key":"foobar"}

Steps to reproduce the problem

GET /api/v1/push/subscription

Specifications

Tested using Mastodon 2.8.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions