not registered",python,flask,pytest,flask-restplus"/>

首页 > 解决方案 > Flask restplus swagger "Model not registered"

问题描述

I keep getting the following error whenever I try send a request.

<flask_restplus.fields.List object at 0x7f0a0878c790> not registered

The code can be found at - https://github.com/Trace-Share/Trace-API/blob/9a30d5084b90bb1e9d58f21a8862113994e3d61d/traces_api/modules/unit/schemas.py#L43-L48

I found that removing mac_mapping and ips attribute lines removes the exception. Trying to add the tcp_timestamp_min attribute twice (under different name) causes the error to be risen again.

I have no idea what this exception means. It gets risen even when I try adding some bogus attributes that only lead to string. It always specifies List.

I am executing this by executing a unit test only for this specific function.

标签: pythonflaskpytestflask-restplus

解决方案


我不认识这个错误,所以这可能不是一个有用的答案,但 Flask-Restplus 已经死了。因此考虑更改Flask-RESTX,它是一个维护的分支,以消除从那里出现错误的可能性。


推荐阅读