documentation icon indicating copy to clipboard operation
documentation copied to clipboard

The `roles` attribute is missing from the `Account` entity

Open anosidium opened this issue 1 year ago • 3 comments

The documentation does not list roles (plural) attribute in the Account entity but it does list role (singular) attribute. I found out by inspecting the Instance entity of various instances using this endpoint: GET /api/v2/instance.

It returns an array of Role entities but permissions and highlighted attribute are absent. So the documentation for Role entity should mark these attributes as nullable.

anosidium avatar Jul 13 '24 01:07 anosidium

At this time, the CredentialAccount entity does have a (singular) role attribute, so that is correct.

The Account entity is indeed lacking documentation for the roles attribute added in Mastodon v4.1.0. The type of the CredentialAccount role attribute is slightly different from the Account roles, which indeed omits permissions and highlighted.

ClearlyClaire avatar Jul 16 '24 12:07 ClearlyClaire

So what you are saying is that CredentialAccount entity role attribute return a Role entity but roles attribute return an array of a different entity type? If so then that entity needs to be added to the API Entities list.

anosidium avatar Jul 16 '24 16:07 anosidium

Yes, that's it, they are of a different type, and the roles in Account are unfortunately currently undocumented.

ClearlyClaire avatar Jul 22 '24 12:07 ClearlyClaire