mirror of
https://github.com/kennethreitz/pydantic.git
synced 2026-06-05 23:00:18 +00:00
Update validator function name in examples to show that value must b… (#3327)
* Update validator function name in examples to show that value must be bar vs must contain a space * Add md file in
This commit is contained in:
@@ -10,7 +10,7 @@ class Model(BaseModel):
|
||||
foo: str
|
||||
|
||||
@validator('foo')
|
||||
def name_must_contain_space(cls, v):
|
||||
def value_must_equal_bar(cls, v):
|
||||
if v != 'bar':
|
||||
raise NotABarError(wrong_value=v)
|
||||
return v
|
||||
|
||||
Reference in New Issue
Block a user