python - 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.
解决方案
我不认识这个错误,所以这可能不是一个有用的答案,但 Flask-Restplus 已经死了。因此考虑更改Flask-RESTX,它是一个维护的分支,以消除从那里出现错误的可能性。
推荐阅读
- azure - 从 Azure 函数/逻辑应用访问本地活动目录
- python - Python在循环中分配给嵌套字典
- java - JAVA - 如何使用正则表达式模式替换二进制文件 (.exe) 中的字符串
- javascript - 错误:找不到模块。在 Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15)
- c# - Microsoft Spark - JVM 方法执行失败:类的非静态方法“csv”失败
- regex - 匹配括号之间和大写的所有字符串
- android - 无法使用 kotlin android 保存 firebase firestore
- ios - MoreNavigationController 在字体大小更改时弄乱了行大小
- spring-mvc - 将选择下拉值分配给 Spring MVC 变量
- selenium - selenium webdriver中firefox上的无头模式没有响应