Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: Suggestion.source is documented as a string, currently returns list of strings #29071

Closed
VyrCossont opened this issue Feb 3, 2024 · 2 comments · Fixed by #29108
Closed
Labels
api REST API, Streaming API, Web Push API breaking Incompatible with previous versions bug Something isn't working

Comments

@VyrCossont
Copy link
Contributor

Steps to reproduce the problem

  1. On mastodon.social, call /api/v2/suggestions
  2. Attempt to decode output as documented, as an array of Suggestion objects
  3. Decoding fails because object has changed from documented format

Expected behaviour

Suggestion.source should be a string

Actual behaviour

Suggestion.source is an array of strings

Detailed description

I'm not sure when this changed, but it's not documented, or backwards compatible with existing clients. My suggestion for the fix would be to keep source as a string, populate it with the first or most important of the possible source strings, deprecate source, and return the full list of sources as a new sources property on Suggestion.

Mastodon instance

mastodon.social

Mastodon version

v4.3.0-nightly.2024-02-02

Technical details

No response

@VyrCossont VyrCossont added bug Something isn't working status/to triage This issue needs to be triaged labels Feb 3, 2024
@trwnh
Copy link
Member

trwnh commented Feb 4, 2024

I believe this was added recently in main (see mastodon/documentation#1398 for more, and #28314 for the PR itself), but yes, it does represent a breaking API change. I'd like to see this reworked to be backwards-compatible, or otherwise use an /api/v2 method prefix.

@trwnh trwnh added api REST API, Streaming API, Web Push API breaking Incompatible with previous versions and removed status/to triage This issue needs to be triaged labels Feb 4, 2024
@andypiper
Copy link
Sponsor Member

Noted and I agree that a change like this which is visible via nightly on mastodon.social and mastodon.online should not be causing disruption -> we should look into ways to either make it backwards compatible, or move to a different prefix until a formal relase is made. Will follow up with the rest of the team here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api REST API, Streaming API, Web Push API breaking Incompatible with previous versions bug Something isn't working
Projects
None yet
3 participants