diff --git a/app/presenters/photo_presenter.rb b/app/presenters/photo_presenter.rb index 2d2659400..0fa7e9a87 100644 --- a/app/presenters/photo_presenter.rb +++ b/app/presenters/photo_presenter.rb @@ -12,7 +12,8 @@ class PhotoPresenter < BasePresenter sizes: { small: url(:thumb_small), medium: url(:thumb_medium), - large: url(:scaled_full) + large: url(:scaled_full), + raw: url } } end @@ -26,7 +27,8 @@ class PhotoPresenter < BasePresenter sizes: { small: url(:thumb_small), medium: url(:thumb_medium), - large: url(:scaled_full) + large: url(:scaled_full), + raw: url } } diff --git a/lib/schemas/api_v1.json b/lib/schemas/api_v1.json index 46342dd48..a8c383417 100644 --- a/lib/schemas/api_v1.json +++ b/lib/schemas/api_v1.json @@ -205,11 +205,12 @@ "photo_sizes": { "type": "object", "properties": { + "raw": { "$ref": "https://diaspora.software/api/v1/schema.json#/definitions/url" }, "large": { "$ref": "https://diaspora.software/api/v1/schema.json#/definitions/url" }, "medium": { "$ref": "https://diaspora.software/api/v1/schema.json#/definitions/url" }, "small": { "$ref": "https://diaspora.software/api/v1/schema.json#/definitions/url" } }, - "required": ["large", "medium", "small"], + "required": ["raw", "large", "medium", "small"], "additionalProperties": true }, diff --git a/spec/presenters/photo_presenter_spec.rb b/spec/presenters/photo_presenter_spec.rb index e5bcb5677..840a8ed71 100644 --- a/spec/presenters/photo_presenter_spec.rb +++ b/spec/presenters/photo_presenter_spec.rb @@ -34,6 +34,7 @@ describe PhotoPresenter do expect(photo[:sizes][:small]).to be_truthy expect(photo[:sizes][:medium]).to be_truthy expect(photo[:sizes][:large]).to be_truthy + expect(photo[:sizes][:raw]).to be_truthy end # rubocop:enable Metrics/AbcSize end