{
  "id": 3361448,
  "title": "Adding OpenAPI Support to Mummy, a Nim HTTP Framework",
  "url": "https://urgent.news/2026/08/25/adding-openapi-support-to-mummy-a-nim-http-framework",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-25T21:45:31.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/isaiahpeter/adding-openapi-support-to-mummy-a-nim-http-framework-227m"
  },
  "original_language": "en",
  "account": "Nim is a popular programming language that doesn't have many options for building HTTP APIs with the kind of developer experience you get in frameworks like FastAPI or Express. This article explains how the author extended the mummy HTTP/WebSocket server library for Nim by adding OpenAPI support, typed path parameters, and request validation. These features were missing in the original mummy library, but extending it proved to be a better option than starting from scratch. The author added openapi_schema.nim and openapi_router.nim to mummy, which allow you to wrap routes in an OpenApiRouter and attach a summary, tags, and a response schema via schemaOf. This generates both an OpenAPI JSON spec and a browsable /docs page, which keeps the documentation in sync with the code. The author also added pathParam[T](request, id) to pull path segments and parse them as the specified type, as well as parseValidatedBody[T] to validate request bodies against the schema generated by schemaOf. In addition, the author introduced composable middleware to handle cross-cutting concerns without having to copy-paste code into every handler. The author migrated all 12 mummy examples to the new OpenApiRouter, which led to the discovery of a few bugs that would have gone unnoticed otherwise. The WebSocket example was updated to use a named path parameter instead of a wildcard route, and only one example had correctly declared response schemas. The author is using this fork to build a small todo API demo and a contact-form microservice, both of which showcase the new features in action. The source code for the fork can be found at github.com/isaiahpeter/mummy.",
  "summary": "Nim doesn't have a lot of options for building HTTP APIs with the kind of batteries-included developer experience you get in frameworks like FastAPI or Express with Swagger middleware. mummy is a fast, solid HTTP/WebSocket server library for Nim (my fork with the additions below is at github.com/isaiahpeter/mummy ) — but out of the box, it doesn't generate OpenAPI specs, validate request bodies,…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}