Skip to content

feat: map Enclosure.title to JSON Feed attachment title#138

Merged
otnc merged 1 commit into
mainfrom
feat/enclosure-title-jsonfeed
Jul 14, 2026
Merged

feat: map Enclosure.title to JSON Feed attachment title#138
otnc merged 1 commit into
mainfrom
feat/enclosure-title-jsonfeed

Conversation

@otnc

@otnc otnc commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix bug(s)
  • New feature(s)
  • Others

Adds title to the Enclosure interface, mapped to the JSON Feed
attachment title field.

Why?

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). It's the last spec-defined attachment
field the model couldn't express — url/mime_type/size_in_bytes/
duration_in_seconds were 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. RFC
4287 §4.2.7.5 would technically allow one on the Atom rel="enclosure"
link's title attribute, but I kept this change additive and minimal
rather than bundling an optional Atom mapping in — pinned with a test that
Atom continues to ignore enclosure.title, matching the existing
enclosure.duration precedent.

Additive and backward-compatible.

Related issue(s)

closes #130

Check

  • Check if duplicate PR(s) already exist.
  • Read CONTRIBUTING.md (rules)
  • Run pnpm check (lint & format)
  • Run pnpm test (functions test)
  • Run pnpm build (dist/)
  • (optional) Run pnpm test:coverage and check nothing new went uncovered

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.
@github-actions github-actions Bot added enhancement New feature or request to main for Pull Request to main labels Jul 14, 2026
@otnc otnc merged commit 62e3529 into main Jul 14, 2026
8 checks passed
@otnc otnc deleted the feat/enclosure-title-jsonfeed branch July 14, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request to main for Pull Request to main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSON Feed: Enclosure.title mapping to attachment title

1 participant