update release notes and update `pyproject.toml` for 0.22 release

Commit 6e3459c · patx · 2025-08-20T22:35:25-04:00

Changeset
6e3459ca06ff4eac709b2347fc6539bc75dd824c
Parents
a05a10e3d8ca2a39d8c1e2bb8f6d07919ccd3787

View source at this commit

Comments

No comments yet.

Log in to comment

Diff

diff --git a/docs/release_notes.md b/docs/release_notes.md
index 201acd2..75db80f 100644
--- a/docs/release_notes.md
+++ b/docs/release_notes.md
@@ -1,6 +1,7 @@
 [![Logo](https://patx.github.io/micropie/logo.png)](https://patx.github.io/micropie)
 
 ## Releases Notes
+- **[0.22](https://github.com/patx/micropie/releases/tag/v0.22)** - Bug fix release. Fix sub-app body parsing bug by ensuring `Request` object inherits scope's `body_params` and `body_parsed`, preventing redundant parsing in sub-app
 - **[0.21](https://github.com/patx/micropie/releases/tag/v0.21)** - Bug fix release. Make sure index route handler can handle path params
 - **[0.20](https://github.com/patx/micropie/releases/tag/v0.20)** - Enable concurrent multipart parsing and file writing with bounded queues
 - **[0.19](https://github.com/patx/micropie/releases/tag/v0.19)** - Easier debugging with `traceback`. Add `_sub_app` attribute to allow middleware to mount other ASGI applications
diff --git a/examples/middleware/subapp.py b/examples/middleware/subapp.py
index f0d5d15..0439669 100644
--- a/examples/middleware/subapp.py
+++ b/examples/middleware/subapp.py
@@ -74,6 +74,13 @@ class ApiApp(App):
     async def plogin(self, name):
         return f"Hello {name}"
 
+class UserApp(App):
+    async def index(self):
+        return {"msg": "Hello world"}
+    
+    async def hello(self, name="world"):
+        return f"hello {name}"
+
 # Define a Middleware to Mount the Sub-App
 class SubAppMiddleware(HttpMiddleware):
     def __init__(self, mount_path: str, subapp: App):
@@ -105,7 +112,10 @@ class MainApp(App):
 app = MainApp()
 api_app = ApiApp()
 api_app.middlewares.append(CSRFMiddleware(app=app, secret_key="my-secret-key"))
+user_app = UserApp()
+
+apiapp_middleware = SubAppMiddleware(mount_path="/api", subapp=api_app)
+userapp_middleware = SubAppMiddleware(mount_path="/user", subapp=user_app)
 
-# Mount the sub-app at /api
-subapp_middleware = SubAppMiddleware(mount_path="/api", subapp=api_app)
-app.middlewares.append(subapp_middleware)
+app.middlewares.append(apiapp_middleware)
+app.middlewares.append(userapp_middleware)
diff --git a/pyproject.toml b/pyproject.toml
index fa25ae8..ba3fe3d 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"
 
 [project]
 name = "micropie"
-version = "0.21"
+version = "0.22"
 description = "An ultra micro ASGI web framework"
 keywords = ["micropie", "asgi", "microframework", "http"]
 readme = "docs/README.md"