You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -265,6 +265,18 @@ You can also easily add any Falcon style middleware using:
265
265
__hug__.http.add_middleware(MiddlewareObject())
266
266
```
267
267
268
+
**Parameter mapping** can be used to override inferred parameter names, eg. for reserved keywords:
269
+
270
+
```py
271
+
import marshmallow.fields as fields
272
+
...
273
+
274
+
@hug.get('/foo', map_params={'from': 'from_date'}) # API call uses 'from'
275
+
defget_foo_by_date(from_date: fields.DateTime()):
276
+
return find_foo(from_date)
277
+
```
278
+
279
+
Input formatters are mapped based on the `content_type` of the request data, and only perform basic parsing. More detailed parsing should be done by the Type Annotations present on your `api_function`
0 commit comments