(
cls: Type['Model'],
b: StrBytes,
*,
content_type: str = None,
encoding: str = 'utf8',
proto: Protocol = None,
allow_pickle: bool = False,
)
| 550 | |
| 551 | @classmethod |
| 552 | def parse_raw( |
| 553 | cls: Type['Model'], |
| 554 | b: StrBytes, |
| 555 | *, |
| 556 | content_type: str = None, |
| 557 | encoding: str = 'utf8', |
| 558 | proto: Protocol = None, |
| 559 | allow_pickle: bool = False, |
| 560 | ) -> 'Model': |
| 561 | try: |
| 562 | obj = load_str_bytes( |
| 563 | b, |
| 564 | proto=proto, |
| 565 | content_type=content_type, |
| 566 | encoding=encoding, |
| 567 | allow_pickle=allow_pickle, |
| 568 | json_loads=cls.__config__.json_loads, |
| 569 | ) |
| 570 | except (ValueError, TypeError, UnicodeDecodeError) as e: |
| 571 | raise ValidationError([ErrorWrapper(e, loc=ROOT_KEY)], cls) |
| 572 | return cls.parse_obj(obj) |
| 573 | |
| 574 | @classmethod |
| 575 | def parse_file( |
nothing calls this directly
no test coverage detected