[validation] Allow `maybe_simple_value` to not have default key in complex value (#7294)

This commit is contained in:
Jesse Hills 2024-08-16 11:05:26 +12:00 committed by GitHub
parent 9001d1c0d4
commit c3668b9a4d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1850,7 +1850,7 @@ def maybe_simple_value(*validators, **kwargs):
if value == SCHEMA_EXTRACT: if value == SCHEMA_EXTRACT:
return (validator, key) return (validator, key)
if isinstance(value, dict) and key in value: if isinstance(value, dict):
return validator(value) return validator(value)
return validator({key: value}) return validator({key: value})