Closed JamesBonddu closed 1 year ago
carefree-creator 版本 0.2.1的fastapi的docs无法显示
fastapi的model_name_map在register_hint注册hint路由时,路由函数内写的函数内部包装类_Model处于函数内部的class作用域,在匿名内部类处无法识别出具象类的名称.
class _(IAlgorithm): model_class = _Model
class _(IAlgorithm): model_class = _Model model_class.__name__ = hint_model_class.__name__
https://ailab-huawei-cdn.nolibox.com/upload/images/3e66619f7e184e8d8aa91a02b069e73d.png
https://ailab-huawei-cdn.nolibox.com/upload/images/edb826435d1e47d29c50dbdb302157bb.png
Oh!多谢发现和改正!!😆
问题
carefree-creator 版本 0.2.1的fastapi的docs无法显示
原因
fastapi的model_name_map在register_hint注册hint路由时,路由函数内写的函数内部包装类_Model处于函数内部的class作用域,在匿名内部类处无法识别出具象类的名称.
修正
https://ailab-huawei-cdn.nolibox.com/upload/images/3e66619f7e184e8d8aa91a02b069e73d.png
https://ailab-huawei-cdn.nolibox.com/upload/images/edb826435d1e47d29c50dbdb302157bb.png