Re-add sizes.raw to the photo JSON

because we need it for showing the raw image in the lightbox. This got lost, as the photo extension was made after API development started.
This commit is contained in:
Dennis Schubert 2020-02-04 14:38:49 +01:00
parent 2e7526bac5
commit bf55d07580
No known key found for this signature in database
GPG key ID: 5A0304BEA7966D7E
3 changed files with 7 additions and 3 deletions

View file

@ -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
}
}

View file

@ -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
},

View file

@ -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