json.py 文件源码

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

项目:qal 作者: OptimalBPM 项目源码 文件源码
def _get_child_types(self):
        _result = {}
        _result["datatypes"] = {"type": "string", "pattern": "(integer|string|string(\(.*\))|serial|timestamp)"}
        _result["db_types"] = {"type": "string", "enum": db_types()}
        _result["and_or"] = {"type": "string", "enum": and_or()}
        _result["in_types"] = {"type": "string", "enum": in_types()}
        _result["index_types"] = {"type": "string", "enum": index_types()}
        _result["constraint_types"] = {"type": "string", "enum": constraint_types()}
        _result["set_operator"] = {"type": "string", "enum": set_operator()}
        _result["quoting"] = {"type": "string", "enum": quoting_types()}

        _result["csv_dialects"] = {"type": "string", "enum": list_dialects()}
        _result["join_types"] = {"type": "string", "enum": join_types()}

        _result["xpath_data_format"] = {"type": "string", "enum": xpath_data_formats()}

        def make_one_of(_classes):
            return {"type": "object",
                    "anyOf":
                         [{"properties": {x: {"$ref": "#/definitions/" + x}}} for x in _classes]
                    }

        _result["statement"] = make_one_of(verbs())
        _result["condition_part"] = make_one_of(condition_part())
        _result["TabularExpressionItem"] = make_one_of(tabular_expression_item_types())
        _result["data_source_types"] = make_one_of(data_source_types())

        _result["ArrayString"] = {"type": "array", "items": {"type": "string"}}
        _result["ArrayList"] = {"type": "array"}

        _result["ArrayParameterString"] = self._child_array_of(['#/definitions/ParameterString'])
        _result["ArrayParameterConstraint"] = self._child_array_of(['#/definitions/ParameterConstraint'])
        _result["ArrayParameterColumndefinition"] = self._child_array_of(['#/definitions/ParameterColumndefinition'])
        _result["ArrayParameterSource"] = self._child_array_of(['#/definitions/ParameterSource'])
        _result["ArrayParameterWhen"] = self._child_array_of(['#/definitions/ParameterWhen'])
        _result["ArrayParameterIdentifier"] = self._child_array_of(['#/definitions/ParameterIdentifier'])
        _result["ArrayStatement"] = self._child_array_of(['#/definitions/statement'])
        _result["ArrayParameterOrderByItem"] = self._child_array_of(['#/definitions/ParameterOrderByItem'])
        _result["ArrayParameterCondition"] = self._child_array_of(['#/definitions/ParameterCondition'])
        _result["ArrayParameterField"] = self._child_array_of(['#/definitions/ParameterField'])
        _result["ArrayParameterAssignment"] = self._child_array_of(['#/definitions/ParameterAssignment'])
        _result["ArrayExpressionItem"] = self._child_array_of(make_one_of(expression_item_types()))
        _result["ArrayTabularExpressionItem"] = self._child_array_of(make_one_of(tabular_expression_item_types()))


        return _result
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号