MCPcopy
hub / github.com/marshmallow-code/marshmallow / _validate_missing

Method _validate_missing

src/marshmallow/fields.py:305–312  ·  view source on GitHub ↗

Validate missing values. Raise a :exc:`ValidationError` if `value` should be considered missing.

(self, value: typing.Any)

Source from the content-addressed store, hash-verified

303 return ValidationError(msg)
304
305 def _validate_missing(self, value: typing.Any) -> None:
306 """Validate missing values. Raise a :exc:`ValidationError` if
307 `value` should be considered missing.
308 """
309 if value is missing_ and self.required:
310 raise self.make_error("required")
311 if value is None and not self.allow_none:
312 raise self.make_error("null")
313
314 def serialize(
315 self,

Callers 1

deserializeMethod · 0.95

Calls 1

make_errorMethod · 0.95

Tested by

no test coverage detected