docs: add a section how to define path parameters

This commit is contained in:
Stefan Stammberger 2021-09-16 19:25:01 +02:00
parent 3bae5c92c2
commit 24bb2e0dc9
No known key found for this signature in database
GPG Key ID: 645FA807E935D9D5

View File

@ -1,3 +1,17 @@
## Defining a route with path parameters
**old:**
```python
# with <>
@offlineshop_ext.route("/lnurl/<item_id>", methods=["GET"])
```
**new:**
```python
# with curly braces: {}
@offlineshop_ext.get("/lnurl/{item_id}")
```
## Check if a user exists and access user object
**old:**
```python