Skip to content

feat: register the web app manifest media type - #1523

Merged
He-Pin merged 1 commit into
apache:mainfrom
He-Pin:feat/webmanifest-media-type
Nov 20, 2026
Merged

He-Pin merged 1 commit into
apache:mainfrom
He-Pin:feat/webmanifest-media-type

Conversation

@He-Pin

@He-Pin He-Pin commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Motivation

Web app manifests have the registered application/manifest+json media type
and .webmanifest extension, but the default registry does not recognize them.

Modification

Add fixed-UTF-8 Scala and Java media type constants and the exact extension
mapping. Cover typed parsing, extension lookup, Java use, and the file
resolver's independence from the default text charset. Document the mapping.

Result

Web manifests resolve to application/manifest+json without a charset
parameter. Existing .json and .manifest mappings remain unchanged.

Tests

  • Offline Scala 2.13.18 and Java focused compilation passed.
  • HeaderSpec selected test: 1 passed with current header parser overlay.
  • Java positive test method and four extracted resolver cases passed.
  • Exact main registry assertion failed before and passed after this change.
  • Cached scalafmt 3.11.5 and Java formatter 1.28.0 applied; diff check passed.
  • Public javap comparison: only new manifest getters and Java constant.
  • Full routing suite, sbt checks, MiMa and Scala 3 were not run locally; cached route
    testkit artifacts unavailable. Unchanged parser compile has an existing
    non-exhaustive-match warning.

GitHub Actions passed on this exact head: Validate and test, Headers, Scalafmt. Validate and test passed for Scala 2.13, Scala 3, next, and Checks.

References

https://www.iana.org/assignments/media-types/application/manifest+json
https://www.rfc-editor.org/rfc/rfc8259#section-8.1
netty/netty#16036 (independent implementation)

@He-Pin
He-Pin force-pushed the feat/webmanifest-media-type branch 2 times, most recently from 58a4931 to 3773a8c Compare November 20, 2026 06:34
@He-Pin
He-Pin marked this pull request as ready for review November 20, 2026 06:56
Motivation:
Web app manifests have the registered application/manifest+json media type
and .webmanifest extension, but the default registry does not recognize them.

Modification:
Add fixed-UTF-8 Scala and Java media type constants and the exact extension
mapping. Cover typed parsing, extension lookup, Java use, and the file
resolver's independence from the default text charset. Document the mapping.
Use explicit nested foreach blocks for the two resolver test dimensions,
so the filename is scoped consistently across Scala versions.

Result:
Web manifests resolve to application/manifest+json without a charset
parameter. Existing .json and .manifest mappings remain unchanged.

Tests:
- Prior revision passed the Scala 2.13 CI job; Scala 3 and next failed to
  compile the new resolver test with an out-of-scope filename.
- The revised test body was compiled and run for all four resolver cases
  offline on Scala 2.13.18; Scalafmt and git diff --check passed.
- Scala 3 and next have not been rerun on this revision.

References:
https://www.iana.org/assignments/media-types/application/manifest+json
https://www.rfc-editor.org/rfc/rfc8259#section-8.1
netty/netty#16036 (independent implementation)
@He-Pin
He-Pin force-pushed the feat/webmanifest-media-type branch from 3773a8c to 6011974 Compare November 20, 2026 14:34
@He-Pin He-Pin added this to the 2.1.0 milestone Nov 20, 2026
@He-Pin
He-Pin merged commit b5a300b into apache:main Nov 20, 2026
6 checks passed
@He-Pin
He-Pin deleted the feat/webmanifest-media-type branch November 20, 2026 15:02
pjfanning added a commit that referenced this pull request Nov 21, 2026
Motivation:
The text/javascript, application/manifest+json and audio/aac changes
(#1522, #1523, #1524) put their registry tests in HeaderSpec rather than
MediaTypesSpec, mixed in unrelated control assertions, and scattered
their docs notes through the "Registering Custom Media Types" section.

Modification:
Move the registry tests to MediaTypesSpec, dropping the unrelated
css/unknown-extension/mp3 assertions. Collect the default extension
mappings in a "File Extension Mappings" docs section. Align the
text/javascript val and drop stray blank lines around TEXT_JAVASCRIPT.

Result:
Media type tests and docs live in one place each. No behaviour change.

Tests:
- sbt "http-core / testOnly ...MediaTypesSpec ...HeaderSpec
  ...HttpMessageTest": 50 passed

References:
Refs #1522, #1523, #1524
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants