feat: map Enclosure.title to JSON Feed attachment title#138
Merged
Conversation
Per the JSON Feed 1.1 spec, an attachment's title "is a name for the attachment" (with the note that multiple attachments sharing the same name should be considered alternates) — the last spec-defined attachment field the model couldn't express; url/mime_type/ size_in_bytes/duration_in_seconds were all already mapped. JSON Feed only, following the same one-format-first pattern as Enclosure.duration (#71): RSS <enclosure> has no title attribute, and while RFC 4287 §4.2.7.5 would allow one on the rel="enclosure" Atom link, this keeps the change additive and minimal. Pinned with a test that Atom continues to ignore it. Additive and backward-compatible.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds
titleto theEnclosureinterface, mapped to the JSON Feedattachment
titlefield.Why?
Per the JSON Feed 1.1 spec, an attachment's
title"is a name for theattachment" (with the note that multiple attachments sharing the same name
should be considered alternates). It's the last spec-defined attachment
field the model couldn't express —
url/mime_type/size_in_bytes/duration_in_secondswere all already mapped.Mapped for JSON Feed only, following the same one-format-first pattern as
Enclosure.duration(#71). RSS<enclosure>has no title attribute. RFC4287 §4.2.7.5 would technically allow one on the Atom
rel="enclosure"link's
titleattribute, but I kept this change additive and minimalrather than bundling an optional Atom mapping in — pinned with a test that
Atom continues to ignore
enclosure.title, matching the existingenclosure.durationprecedent.Additive and backward-compatible.
Related issue(s)
closes #130
Check
CONTRIBUTING.md(rules)pnpm check(lint & format)pnpm test(functions test)pnpm build(dist/)pnpm test:coverageand check nothing new went uncovered