Expand description
Centralized MIME type constants for the conversion API.
These constants are bare MIME types — no parameters (no charset=utf-8,
no q=...). The Content-Type and Accept parsers strip parameters
before comparing against these values; the conversion handler appends
; charset=utf-8 when constructing response Content-Type headers.
§Why one canonical home
These strings appear in three places at runtime:
crate::mime_parser— validatingContent-Typeand negotiatingAccept.crate::metrics— as bounded label values for theinput_mime_typeandoutput_mime_typePrometheus labels.- Integration tests — asserting response shapes and error messages.
Defining them once here eliminates the risk that the validator and the metrics layer disagree on what counts as a “supported” MIME.
Constants§
- MIME_
BLOCKNOTE - MIME type for
BlockNoteJSON output. The primary output type returned on success when the client did not request a different format. - MIME_
BLOCKNOTE_ ALIAS - Accepted alias for the
BlockNoteoutput MIME (input-only onAccept; the server always returnsMIME_BLOCKNOTEin itsContent-Type). - MIME_
DOCX - MIME type for DOCX input. Strict — accepted as
Content-Typeonly when sent verbatim with no parameters (binary format; charset is meaningless). - MIME_
HTML - MIME type for HTML. Accepted as both input
Content-Typeand outputAccept; emitted as the responseContent-Typewhen the HTML writer is selected. - MIME_
MARKDOWN - MIME type for Markdown input. Accepted as
Content-TypeonPOST /conversion. - MIME_
OXA - MIME type for
oxa.devJSON output, emitted when theoxa.devwriter is selected. - MIME_
PANDOC_ NATIVE - MIME type for Pandoc native output, emitted when the Pandoc native writer is selected.