Skip to content

Commit a5f6a86

Browse files
authored
fix: skip type check for default values in validation (#401)
1 parent 969cc35 commit a5f6a86

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

runpod/serverless/utils/rp_validator.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ def _validate_input_against_schema(schema, validated_input, error_list):
6868
except TypeError:
6969
continue
7070

71+
# skip type check assuming rare case, default value sets value
72+
if "default" in rules and isinstance(validated_input[key], type(rules["default"])):
73+
continue
74+
7175
# Check for the correct type.
7276
is_instance = isinstance(validated_input[key], rules["type"])
7377
if not is_instance:

0 commit comments

Comments
 (0)