validator.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:ingest-client 作者: jhuapl-boss 项目源码 文件源码
def validate_schema(self):
        """
        Method to validate the JSON data against the schema

        Args:

        Returns:
            str: An error message if schema validation fails

        """
        if not self.schema:
            raise ValueError("Schema has not been populated yet. Cannot validate.")

        try:
            jsonschema.validate(self.config, self.schema)
        except jsonschema.ValidationError as e:
            return e

        return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号