A tiny zero-dependency CLI that grades API documentation for Content-Type, Accept, and media negotiation. It catches the boring-but-costly gaps that cause integrations to fail with mysterious 400, 406, or 415 errors.
Great API docs should make these obvious:
- Which endpoints require
application/json? - Does the API support
multipart/form-datauploads? - Is
charset=utf-8required? - What happens when
Content-Typeis missing or wrong? - Which
Acceptheaders are supported? - Where are 415 and 406 errors documented?
api-content-type-doctor turns those questions into a repeatable score.
npx api-content-type-doctor docs/media-types.md
npx api-content-type-doctor README.md --min-score 90
npx api-content-type-doctor docs/media-types.md --jsonNo dependencies. Node.js 18+.
- Request
Content-Typedocumentation - Response
Accept/ content negotiation behavior - JSON body rules, UTF-8 charset, malformed JSON behavior
application/x-www-form-urlencodedrulesmultipart/form-dataupload rules, boundaries, filenames, MIME handling- Charset and encoding support
415 unsupported_media_typeerror examples406 not_acceptablebehavior- Concrete curl examples with headers
- Endpoint media type matrix
- Upload security, MIME sniffing, malware scanning, and size limits
- Vendor media types and versioning
- OpenAPI
requestBody.content/responses.contentalignment
api-content-type-doctor <README.md|docs.md> [--min-score 80] [--json] [--expect-fail]
Exit codes:
0passes the minimum score1fails the minimum score2invalid CLI usage or unreadable file
npm test
npm run checkMIT