Make height and width optional for photos
This commit is contained in:
parent
6f936caddf
commit
860aec96b9
3 changed files with 5 additions and 5 deletions
|
|
@ -14,8 +14,6 @@ This entity represents a photo. It can be standalone or nested in a [StatusMessa
|
||||||
| `created_at` | [Timestamp][timestamp] | The create timestamp of the photo. |
|
| `created_at` | [Timestamp][timestamp] | The create timestamp of the photo. |
|
||||||
| `remote_photo_path` | [URL][url] | The URL to the photo, without filename (see `remote_photo_name`) |
|
| `remote_photo_path` | [URL][url] | The URL to the photo, without filename (see `remote_photo_name`) |
|
||||||
| `remote_photo_name` | [String][string] (255) | The filename of the photo. |
|
| `remote_photo_name` | [String][string] (255) | The filename of the photo. |
|
||||||
| `height` | [Integer][integer] | The height of the photo in pixels. |
|
|
||||||
| `width` | [Integer][integer] | The width of the photo in pixels. |
|
|
||||||
|
|
||||||
## Optional Properties
|
## Optional Properties
|
||||||
|
|
||||||
|
|
@ -23,6 +21,8 @@ This entity represents a photo. It can be standalone or nested in a [StatusMessa
|
||||||
| --------------------- | ------------------------ | ------------------------------------------------------------------------------- |
|
| --------------------- | ------------------------ | ------------------------------------------------------------------------------- |
|
||||||
| `text` | [String][string] (65535) | Description text for the photo. |
|
| `text` | [String][string] (65535) | Description text for the photo. |
|
||||||
| `status_message_guid` | [GUID][guid] | The GUID of the [StatusMessage][status_message] to which the photo is attached. |
|
| `status_message_guid` | [GUID][guid] | The GUID of the [StatusMessage][status_message] to which the photo is attached. |
|
||||||
|
| `height` | [Integer][integer] | The height of the photo in pixels. |
|
||||||
|
| `width` | [Integer][integer] | The width of the photo in pixels. |
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,12 +48,12 @@ module DiasporaFederation
|
||||||
# @!attribute [r] height
|
# @!attribute [r] height
|
||||||
# Photo height
|
# Photo height
|
||||||
# @return [Integer] height
|
# @return [Integer] height
|
||||||
property :height, :integer
|
property :height, :integer, optional: true
|
||||||
|
|
||||||
# @!attribute [r] width
|
# @!attribute [r] width
|
||||||
# Photo width
|
# Photo width
|
||||||
# @return [Integer] width
|
# @return [Integer] width
|
||||||
property :width, :integer
|
property :width, :integer, optional: true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ module DiasporaFederation
|
||||||
it_behaves_like "a property with a value validation/restriction" do
|
it_behaves_like "a property with a value validation/restriction" do
|
||||||
let(:property) { prop }
|
let(:property) { prop }
|
||||||
let(:wrong_values) { [true, :num, "asdf"] }
|
let(:wrong_values) { [true, :num, "asdf"] }
|
||||||
let(:correct_values) { [123, "123"] }
|
let(:correct_values) { [123, "123", nil] }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue