entities.py 文件源码

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

项目:drf_openapi 作者: limdauto 项目源码 文件源码
def fallback_schema_from_field(self, field):
        """ Fallback schema for field that isn't inspected properly by DRF
        and probably won't land in upstream canon due to its hacky nature only for doc purposes
        """
        title = force_text(field.label) if field.label else ''
        description = force_text(field.help_text) if field.help_text else ''

        # since we can't really inspect dictfield and jsonfield, at least display object as type
        # instead of string
        if isinstance(field, (serializers.DictField, serializers.JSONField)):
            return coreschema.Object(
                properties={},
                title=title,
                description=description
            )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号