_jsonschema.py 文件源码

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

项目:lymph-schema 作者: deliveryhero 项目源码 文件源码
def _from_python_type(field, pytype):
    json_schema = {
        'title': field.attribute or field.name,
    }
    for key, val in TYPE_MAP[pytype].items():
        json_schema[key] = val
    if field.default is not missing:
        json_schema['default'] = field.default

    return json_schema
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号