MediaTypePrioritizer

Provides deterministic ordering of media types example extraction.

Media types are ordered by priority to ensure JSON-like formats are preferred:

  1. application/json (exact match)

  2. text/json (exact match)

  3. *+json suffixes (e.g., application/hal+json)

  4. application/jwt (exact match)

  5. *+jwt suffixes (e.g., application/secevent+jwt)

  6. application/xml (exact match)

  7. text/xml (exact match)

  8. *+xml suffixes (e.g., application/atom+xml)

  9. application/yaml (exact match)

  10. application/x-www-form-urlencoded (exact match)

  11. All other media types (alphabetically)

Functions

Link copied to clipboard
Link copied to clipboard
fun orderedMediaTypeKeys(content: Content): List<String>

Returns media type keys ordered by priority for example extraction.