A serializer built from the query string or the request body.
(self, node: ast.Call)
| 1054 | return |
| 1055 | |
| 1056 | def _record_validator(self, node: ast.Call) -> None: |
| 1057 | """A serializer built from the query string or the request body.""" |
| 1058 | ctx = self._input_stack[-1] |
| 1059 | for keyword in node.keywords: |
| 1060 | if keyword.arg != "data": |
| 1061 | continue |
| 1062 | # A class, by convention. Skips plain calls taking data=, and |
| 1063 | # runtime-chosen classes the schema could not name either. |
| 1064 | if not _looks_like_a_class(node.func): |
| 1065 | continue |
| 1066 | name = _name_of(node.func).rsplit(".", 1)[-1] |
| 1067 | if ctx.is_query(keyword.value): |
| 1068 | ctx.query_validators.append((node.lineno, node.col_offset, name)) |
| 1069 | elif ctx.is_body(keyword.value): |
| 1070 | ctx.body_validators.append((node.lineno, node.col_offset, name)) |
| 1071 | |
| 1072 | def _report_input(self, line: int, col: int, msg: str, rule: str) -> None: |
| 1073 | """Fatal only for an enforced rule; otherwise recorded unless asked for.""" |
no test coverage detected