Fix local collection uri not being serialized in REST API responses (#38645)

This commit is contained in:
Claire 2026-04-10 17:01:28 +02:00 committed by GitHub
parent 3b39562954
commit 8124d44ee1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View File

@ -13,6 +13,10 @@ class REST::CollectionSerializer < ActiveModel::Serializer
object.id.to_s
end
def uri
ActivityPub::TagManager.instance.uri_for(object)
end
def description
return object.description if object.local?
return if object.description_html.nil?

View File

@ -29,6 +29,7 @@ RSpec.describe REST::CollectionSerializer do
expect(subject)
.to include(
'account_id' => collection.account_id.to_s,
'uri' => include('2342'),
'id' => '2342',
'name' => 'Exquisite follows',
'description' => 'Always worth a follow',