Add MetaDetails entity and update MediaAttachment meta properties #497
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds support for the
MetaDetailsentity and updates theMediaAttachmententity to includemeta[small]andmeta[original]properties, as specified in mastodon/documentation#1735.Changes
New MetaDetails Entity
Created a new
MetaDetailsentity in the Mastodon documentation with the following properties:width(nullable Integer) - The width of the attachment in pixels, or null if the attachment is not visualheight(nullable Integer) - The height of the attachment in pixels, or null if the attachment is not visualframe_rate(nullable String) - The frame rate of the video attachment (as a fraction), or null if the attachment is not a videoduration(nullable Float) - The duration of the video attachment, or null if the attachment is not video or audiobitrate(nullable Integer) - The media bitrate of the video or audio attachment, or null if the attachment is an imageaspect(nullable Float) - The media aspect ratio of the video or image attachment, or null if the attachment is not visualUpdated MediaAttachment Entity
Added two new optional, nullable properties to
MediaAttachment:meta[small]- Details about the small preview version of the attachment (referencesMetaDetails)meta[original]- Details about the original version of the attachment (referencesMetaDetails)Generated OpenAPI Schema
The OpenAPI schema now includes:
{ "MetaDetails": { "type": "object", "description": "Metadata details about a media attachment.", "properties": { "width": { "type": ["integer", "null"] }, "height": { "type": ["integer", "null"] }, "frame_rate": { "type": ["string", "null"] }, "duration": { "type": ["number", "null"] }, "bitrate": { "type": ["integer", "null"] }, "aspect": { "type": ["number", "null"] } } } }And
MediaAttachment.meta.smallandMediaAttachment.meta.originalproperly reference theMetaDetailsschema using$ref.Testing
EntityParser.metadetails.test.ts) with 6 tests covering:All 136 test suites pass (630 tests total).
Related
Ref: mastodon/documentation#1735
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
otel.cloud.redocly.comnode /home/REDACTED/work/mastodon-openapi/mastodon-openapi/node_modules/.bin/redocly lint --format=github-actions dist/schema.json(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Fixes #496
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.