连接操作与旧版协议映射
原能力
登记连接操作和旧版映射,保留原请求、版本及错误语义。(合同附件 R7 21.10)
首选项目
python-jsonschema(MIT)。 python-jsonschema
匹配范围
验证旧/新结构映射并使用标准交易事件组件。
源码
python-jsonschema · def iter_errors(self, instance
jsonschema/validators.py · 352–365 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
def iter_errors(self, instance, _schema=None):
if _schema is not None:
warnings.warn(
(
"Passing a schema to Validator.iter_errors "
"is deprecated and will be removed in a future "
"release. Call validator.evolve(schema=new_schema)."
"iter_errors(...) instead."
),
DeprecationWarning,
stacklevel=2,
)
validators = [
(self.VALIDATORS[k], k, v)
实现与验收要点
定义特定协议映射、精度和无法转换失败行为。