Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit afa688e

Browse files
committed
doc: Added documentation about wthe VALIDATE_PARAMS_MAX_DEPTH
1 parent d6f5efc commit afa688e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

flask_utils/extension.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ class FlaskUtils(object):
4848
fu = FlaskUtils(app)
4949
app.config["VALIDATE_PARAMS_MAX_DEPTH"] = 3
5050
51+
The `VALIDATE_PARAMS_MAX_DEPTH` configuration determines the maximum depth of nested dictionary validation
52+
when using the `validate_params` decorator. This allows fine-tuning of validation behavior for
53+
complex nested structures.
54+
55+
5156
.. versionadded:: 0.5.0
5257
"""
5358

@@ -122,4 +127,5 @@ def init_app(self, app: Flask, register_error_handlers: bool = True) -> None:
122127
self.has_error_handlers_registered = True
123128

124129
app.extensions["flask_utils"] = self
130+
# Default depth of 4 allows for moderately nested structures while not slowing down too much the validation
125131
app.config.setdefault("VALIDATE_PARAMS_MAX_DEPTH", 4)

0 commit comments

Comments
 (0)