schema icon indicating copy to clipboard operation
schema copied to clipboard

Option to ignore entry based on value validation

Open Jerry-Ma opened this issue 4 years ago • 0 comments

Hi, I encounter the following use case, which requires adding a new option "ignore_extra_values":

from schema import Schema

s = Schema({str: int}, ignore_extra_values=True)

print(s.validate({'some_str': 2, 'a': 'some_str'}))

Expected output:

{'some_str': 2}

Is this some thing easy to do? Any help is greatly appreciated!

Jerry-Ma avatar Sep 22 '21 03:09 Jerry-Ma