Add media attachment description limit to instance API response (#33153)

This commit is contained in:
Matt Jankowski 2024-12-04 10:10:20 -05:00 committed by GitHub
parent 48ea7552dd
commit 0fcf227a92
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View file

@ -77,12 +77,13 @@ class REST::InstanceSerializer < ActiveModel::Serializer
}, },
media_attachments: { media_attachments: {
supported_mime_types: MediaAttachment.supported_mime_types, description_limit: MediaAttachment::MAX_DESCRIPTION_LENGTH,
image_size_limit: MediaAttachment::IMAGE_LIMIT,
image_matrix_limit: Attachmentable::MAX_MATRIX_LIMIT, image_matrix_limit: Attachmentable::MAX_MATRIX_LIMIT,
video_size_limit: MediaAttachment::VIDEO_LIMIT, image_size_limit: MediaAttachment::IMAGE_LIMIT,
supported_mime_types: MediaAttachment.supported_mime_types,
video_frame_rate_limit: MediaAttachment::MAX_VIDEO_FRAME_RATE, video_frame_rate_limit: MediaAttachment::MAX_VIDEO_FRAME_RATE,
video_matrix_limit: MediaAttachment::MAX_VIDEO_MATRIX_LIMIT, video_matrix_limit: MediaAttachment::MAX_VIDEO_MATRIX_LIMIT,
video_size_limit: MediaAttachment::VIDEO_LIMIT,
}, },
polls: { polls: {

View file

@ -55,6 +55,9 @@ RSpec.describe 'Instances' do
max_characters: StatusLengthValidator::MAX_CHARS, max_characters: StatusLengthValidator::MAX_CHARS,
max_media_attachments: Status::MEDIA_ATTACHMENTS_LIMIT max_media_attachments: Status::MEDIA_ATTACHMENTS_LIMIT
), ),
media_attachments: include(
description_limit: MediaAttachment::MAX_DESCRIPTION_LENGTH
),
polls: include( polls: include(
max_options: PollValidator::MAX_OPTIONS max_options: PollValidator::MAX_OPTIONS
) )