@@ -104,6 +104,7 @@ class OneOfCaseInsensitive(colander.OneOf):
104
104
"""
105
105
Validator that ensures the given value matches one of the available choices, but allowing case insensitive values.
106
106
"""
107
+
107
108
def __call__ (self , node , value ):
108
109
if str (value ).lower () not in (choice .lower () for choice in self .choices ):
109
110
return super (OneOfCaseInsensitive , self ).__call__ (node , value )
@@ -113,6 +114,7 @@ class StringRange(colander.Range):
113
114
"""
114
115
Validator that provides the same functionalities as :class:`colander.Range` for a numerical string value.
115
116
"""
117
+
116
118
def __init__ (self , min = None , max = None , ** kwargs ):
117
119
try :
118
120
if isinstance (min , str ):
@@ -139,6 +141,7 @@ class SchemeURL(colander.Regex):
139
141
:class:`colander.url` [remote http(s)/ftp(s)]
140
142
:class:`colander.file_uri` [local file://]
141
143
"""
144
+
142
145
def __init__ (self , schemes = None , msg = None , flags = re .IGNORECASE ):
143
146
if not schemes :
144
147
schemes = ["" ]
@@ -875,6 +878,7 @@ class AnyKeyObject(PermissiveMappingSchema):
875
878
This class is only a shorthand definition of ``unknown`` keyword for convenience.
876
879
All :class:`colander.MappingSchema` support this natively.
877
880
"""
881
+
878
882
def __init__ (self , * args , ** kwargs ):
879
883
kwargs ["unknown" ] = "preserve"
880
884
super (PermissiveMappingSchema , self ).__init__ (* args , ** kwargs )
@@ -1509,6 +1513,7 @@ def _deserialize_keyword(self, cstruct):
1509
1513
1510
1514
class KeywordTypeConverter (TypeConverter ):
1511
1515
"""Generic keyword converter that builds schema with a list of sub-schemas under the keyword."""
1516
+
1512
1517
def convert_type (self , schema_node ):
1513
1518
keyword = schema_node .get_keyword_name ()
1514
1519
keyword_schema = {
@@ -1531,6 +1536,7 @@ class OneOfKeywordTypeConverter(KeywordTypeConverter):
1531
1536
.. seealso::
1532
1537
- :class:`OneOfKeywordSchema`
1533
1538
"""
1539
+
1534
1540
def convert_type (self , schema_node ):
1535
1541
# type: (OneOfKeywordSchema) -> Dict
1536
1542
keyword = schema_node .get_keyword_name ()
@@ -1599,6 +1605,7 @@ class VariableObjectTypeConverter(ObjectTypeConverter):
1599
1605
Updates the mapping object's ``additionalProperties`` for each ``properties``
1600
1606
that a marked as :class:`VariableSchemaNode`.
1601
1607
"""
1608
+
1602
1609
def convert_type (self , schema_node ):
1603
1610
converted = super (VariableObjectTypeConverter , self ).convert_type (schema_node )
1604
1611
converted .setdefault ("additionalProperties" , {})
0 commit comments