Skip to content

Commit

Permalink
doc: Added documentation about wthe VALIDATE_PARAMS_MAX_DEPTH
Browse files Browse the repository at this point in the history
  • Loading branch information
Seluj78 committed Sep 22, 2024
1 parent d6f5efc commit afa688e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions flask_utils/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ class FlaskUtils(object):
fu = FlaskUtils(app)
app.config["VALIDATE_PARAMS_MAX_DEPTH"] = 3
The `VALIDATE_PARAMS_MAX_DEPTH` configuration determines the maximum depth of nested dictionary validation
when using the `validate_params` decorator. This allows fine-tuning of validation behavior for
complex nested structures.
.. versionadded:: 0.5.0
"""

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

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

0 comments on commit afa688e

Please sign in to comment.