From 24bb2e0dc95b35a7651d7a3644097a5cda308c15 Mon Sep 17 00:00:00 2001 From: Stefan Stammberger Date: Thu, 16 Sep 2021 19:25:01 +0200 Subject: [PATCH] docs: add a section how to define path parameters --- docs/guide/fastapi_transition.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/guide/fastapi_transition.md b/docs/guide/fastapi_transition.md index 6ae179e24..7a3670049 100644 --- a/docs/guide/fastapi_transition.md +++ b/docs/guide/fastapi_transition.md @@ -1,3 +1,17 @@ + +## Defining a route with path parameters +**old:** +```python +# with <> +@offlineshop_ext.route("/lnurl/", methods=["GET"]) +``` + +**new:** +```python +# with curly braces: {} +@offlineshop_ext.get("/lnurl/{item_id}") +``` + ## Check if a user exists and access user object **old:** ```python