<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: peter isaiah</title>
    <description>The latest articles on DEV Community by peter isaiah (@isaiahpeter).</description>
    <link>https://dev.to/isaiahpeter</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1108261%2F81c184d5-c783-4a3f-a4e8-47e3832eb1f4.jpeg</url>
      <title>DEV Community: peter isaiah</title>
      <link>https://dev.to/isaiahpeter</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/isaiahpeter"/>
    <language>en</language>
    <item>
      <title>Adding OpenAPI Support to Mummy, a Nim HTTP Framework</title>
      <dc:creator>peter isaiah</dc:creator>
      <pubDate>Tue, 25 Aug 2026 21:45:31 +0000</pubDate>
      <link>https://dev.to/isaiahpeter/adding-openapi-support-to-mummy-a-nim-http-framework-227m</link>
      <guid>https://dev.to/isaiahpeter/adding-openapi-support-to-mummy-a-nim-http-framework-227m</guid>
      <description>&lt;p&gt;Nim doesn't have a lot of options for building HTTP APIs with the kind of&lt;br&gt;
batteries-included developer experience you get in frameworks like FastAPI or&lt;br&gt;
Express with Swagger middleware. &lt;a href="https://github.com/guzba/mummy" rel="noopener noreferrer"&gt;mummy&lt;/a&gt; is a&lt;br&gt;
fast, solid HTTP/WebSocket server library for Nim (my fork with the&lt;br&gt;
additions below is at&lt;br&gt;
&lt;a href="https://github.com/isaiahpeter/mummy" rel="noopener noreferrer"&gt;github.com/isaiahpeter/mummy&lt;/a&gt;) — but out of the box, it&lt;br&gt;
doesn't generate OpenAPI specs, validate request bodies, or give you typed&lt;br&gt;
path parameters. So I forked it and added those.&lt;/p&gt;

&lt;p&gt;This post walks through what I built, why, and what I learned extending an&lt;br&gt;
existing Nim library instead of starting from scratch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why mummy, and why OpenAPI
&lt;/h2&gt;

&lt;p&gt;I wanted a Nim backend for a few projects (a contact-form API, a todo API&lt;br&gt;
demo) and kept missing three things I'd take for granted in other&lt;br&gt;
ecosystems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Auto-generated API docs&lt;/strong&gt; — a &lt;code&gt;/docs&lt;/code&gt; endpoint you can actually hand to
someone, generated from your routes instead of hand-written.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Typed path parameters&lt;/strong&gt; — pulling &lt;code&gt;id&lt;/code&gt; out of &lt;code&gt;/users/{id}&lt;/code&gt; as an &lt;code&gt;int&lt;/code&gt;
without manual parsing and error handling in every handler.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Request validation&lt;/strong&gt; — rejecting a bad JSON body before it reaches your
handler logic, with a schema to back it up.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;mummy is fast and minimal by design, which is exactly why it was worth&lt;br&gt;
extending rather than replacing.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I added
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;OpenAPI spec generation.&lt;/strong&gt; I added &lt;code&gt;openapi_schema.nim&lt;/code&gt; and&lt;br&gt;
&lt;code&gt;openapi_router.nim&lt;/code&gt;, which let you wrap routes in an &lt;code&gt;OpenApiRouter&lt;/code&gt; and&lt;br&gt;
attach a summary, tags, and a response schema via &lt;code&gt;schemaOf&lt;/code&gt;. The router&lt;br&gt;
serves both &lt;code&gt;/openapi.json&lt;/code&gt; and a browsable &lt;code&gt;/docs&lt;/code&gt; page generated from your&lt;br&gt;
actual route definitions — so the docs can't drift out of sync with the code&lt;br&gt;
the way hand-written API docs do.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Typed path parameters.&lt;/strong&gt; &lt;code&gt;pathParam[T](request, "id")&lt;/code&gt; pulls a path&lt;br&gt;
segment and parses it as the type you ask for, with a clean 400 response if&lt;br&gt;
parsing fails. One gotcha worth flagging if you try this yourself: in this&lt;br&gt;
Nim version, the generic dot-call form (&lt;code&gt;request.pathParam[int]("id")&lt;/code&gt;)&lt;br&gt;
doesn't parse — you have to call it as &lt;code&gt;pathParam[int](request, "id")&lt;/code&gt;&lt;br&gt;
instead.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Request body validation.&lt;/strong&gt; &lt;code&gt;parseValidatedBody[T]&lt;/code&gt; checks an incoming JSON&lt;br&gt;
body against the schema generated by &lt;code&gt;schemaOf&lt;/code&gt;, and returns a 400 with a&lt;br&gt;
clear error message on mismatch, instead of letting a malformed body reach&lt;br&gt;
your handler and fail in some less obvious way further down.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Composable middleware.&lt;/strong&gt; A &lt;code&gt;Middleware&lt;/code&gt; type and a &lt;code&gt;use()&lt;/code&gt; method on&lt;br&gt;
&lt;code&gt;OpenApiRouter&lt;/code&gt;, plus a couple of built-ins — &lt;code&gt;loggingMiddleware&lt;/code&gt; and&lt;br&gt;
&lt;code&gt;bearerAuthMiddleware&lt;/code&gt; — so cross-cutting concerns don't have to be copy-pasted&lt;br&gt;
into every handler.&lt;/p&gt;

&lt;h2&gt;
  
  
  Migrating the examples
&lt;/h2&gt;

&lt;p&gt;mummy ships with 12 example servers. I migrated all of them to the new&lt;br&gt;
&lt;code&gt;OpenApiRouter&lt;/code&gt; to sanity-check the additions against real, varied code&lt;br&gt;
instead of just a toy case. That surfaced a few real bugs I wouldn't have&lt;br&gt;
caught otherwise:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One example declared a &lt;code&gt;requestBody&lt;/code&gt; schema for a route whose handler
never actually read a JSON body — leftover from copy-pasting between
examples. Easy to miss, misleading if it ships in generated docs.&lt;/li&gt;
&lt;li&gt;The WebSocket example used a wildcard route (&lt;code&gt;/*&lt;/code&gt;) for channel names. I
converted it to a named path parameter (&lt;code&gt;@channel&lt;/code&gt;), which also fixed a
latent bug: the original handler read &lt;code&gt;request.uri&lt;/code&gt;, which can include a
&lt;code&gt;?query&lt;/code&gt; string, instead of the clean decoded path.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Only one example actually declared response schemas, and those checked out&lt;br&gt;
correctly — the rest use the router's default 200 OK, which needed no&lt;br&gt;
changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;p&gt;I'm using this fork to build a small todo API demo (deployed on Render) as a&lt;br&gt;
live, working example of the OpenAPI/validation/middleware features&lt;br&gt;
together, and a contact-form microservice for my own site. Both are useful&lt;br&gt;
proof that the additions hold up outside of the example suite they were&lt;br&gt;
tested against.&lt;/p&gt;

&lt;p&gt;If you're working in Nim and have hit the same "no OpenAPI docs, no request&lt;br&gt;
validation" gap with mummy or another minimal framework, I'd be curious to&lt;br&gt;
hear how you've worked around it — or if you want to look at the fork&lt;br&gt;
yourself, it's at &lt;a href="https://github.com/isaiahpeter/mummy" rel="noopener noreferrer"&gt;github.com/isaiahpeter/mummy&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>nim</category>
      <category>openapi</category>
      <category>backend</category>
      <category>api</category>
    </item>
    <item>
      <title>Things you need to know before learning django.</title>
      <dc:creator>peter isaiah</dc:creator>
      <pubDate>Mon, 11 Sep 2023 02:05:19 +0000</pubDate>
      <link>https://dev.to/isaiahpeter/things-you-need-to-know-before-learning-django-5039</link>
      <guid>https://dev.to/isaiahpeter/things-you-need-to-know-before-learning-django-5039</guid>
      <description>&lt;p&gt;The django framework is a web framework used to build web applications.It is also known as the framework for perfectionist with a deadline.The most trendy and popular python framework for web development.&lt;br&gt;
You might be wondering what are the topics or things you should know before learning django.&lt;br&gt;
First you must know the python programming language fundamentals.&lt;br&gt;
what are these fundamentals?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;variables&lt;/li&gt;
&lt;li&gt;list, tuples and dictionary&lt;/li&gt;
&lt;li&gt;functions&lt;/li&gt;
&lt;li&gt;class especially how to inherit from another class properly&lt;/li&gt;
&lt;li&gt;Understand object oriented programming &lt;/li&gt;
&lt;li&gt;You should also have a basic understanding of html, css and javascript it will come handy when you are writing your models that will be translated to an html element.&lt;/li&gt;
&lt;li&gt;know the GET and POST request what they mean and when to use them.&lt;/li&gt;
&lt;li&gt;You also need to understand database and sql like foreignkeys, relationship between tables and how they map to your python model.&lt;/li&gt;
&lt;li&gt;what a virtual environment is.&lt;/li&gt;
&lt;li&gt;why django is called an MVT framework.&lt;/li&gt;
&lt;li&gt;learn to use git and the django documentation.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>tutorial</category>
      <category>python</category>
    </item>
  </channel>
</rss>
