diff --git a/app/serializers/rest/collection_serializer.rb b/app/serializers/rest/collection_serializer.rb index c668ec37dc..8354699710 100644 --- a/app/serializers/rest/collection_serializer.rb +++ b/app/serializers/rest/collection_serializer.rb @@ -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? diff --git a/spec/serializers/rest/collection_serializer_spec.rb b/spec/serializers/rest/collection_serializer_spec.rb index 67ff464d18..ded12f229e 100644 --- a/spec/serializers/rest/collection_serializer_spec.rb +++ b/spec/serializers/rest/collection_serializer_spec.rb @@ -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',