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:
parent
2e7526bac5
commit
bf55d07580
3 changed files with 7 additions and 3 deletions
|
|
@ -12,7 +12,8 @@ class PhotoPresenter < BasePresenter
|
||||||
sizes: {
|
sizes: {
|
||||||
small: url(:thumb_small),
|
small: url(:thumb_small),
|
||||||
medium: url(:thumb_medium),
|
medium: url(:thumb_medium),
|
||||||
large: url(:scaled_full)
|
large: url(:scaled_full),
|
||||||
|
raw: url
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
@ -26,7 +27,8 @@ class PhotoPresenter < BasePresenter
|
||||||
sizes: {
|
sizes: {
|
||||||
small: url(:thumb_small),
|
small: url(:thumb_small),
|
||||||
medium: url(:thumb_medium),
|
medium: url(:thumb_medium),
|
||||||
large: url(:scaled_full)
|
large: url(:scaled_full),
|
||||||
|
raw: url
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -205,11 +205,12 @@
|
||||||
"photo_sizes": {
|
"photo_sizes": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"raw": { "$ref": "https://diaspora.software/api/v1/schema.json#/definitions/url" },
|
||||||
"large": { "$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" },
|
"medium": { "$ref": "https://diaspora.software/api/v1/schema.json#/definitions/url" },
|
||||||
"small": { "$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
|
"additionalProperties": true
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ describe PhotoPresenter do
|
||||||
expect(photo[:sizes][:small]).to be_truthy
|
expect(photo[:sizes][:small]).to be_truthy
|
||||||
expect(photo[:sizes][:medium]).to be_truthy
|
expect(photo[:sizes][:medium]).to be_truthy
|
||||||
expect(photo[:sizes][:large]).to be_truthy
|
expect(photo[:sizes][:large]).to be_truthy
|
||||||
|
expect(photo[:sizes][:raw]).to be_truthy
|
||||||
end
|
end
|
||||||
# rubocop:enable Metrics/AbcSize
|
# rubocop:enable Metrics/AbcSize
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue