From d2db60a6d1648784b54395b4761872ec0f09a844 Mon Sep 17 00:00:00 2001 From: Souheil Chelfouh Date: Tue, 30 Apr 2024 11:20:12 +0200 Subject: [PATCH] Added min_len and max_len to sequence --- src/jsonschema_colander/types.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/jsonschema_colander/types.py b/src/jsonschema_colander/types.py index 26147a4..a4e7587 100644 --- a/src/jsonschema_colander/types.py +++ b/src/jsonschema_colander/types.py @@ -82,6 +82,10 @@ def extract(cls, params: Mapping, available: set): min=params.get('minLength', -1), max=params.get('maxLength', -1) )) + attributes['min_len'] = params.get('minLength', 0) + if 'maxLength' in params: + attributes['max_len'] = params.get['maxLength'] + if 'default' in available: attributes['default'] = params.get('default') if 'pattern' in available: