首页 文章

Swagger Editor生成了python-flask null类型错误

提问于
浏览
0

我在Swagger hub / Swagger编辑器上创建了我的rest-ful api endpoints 文档 . 我有基于python-sanic的restful api endpoints . 我生成并运行python-flask服务器,但收到错误消息 .

未捕获的TypeError:Swagger 2.0不支持空类型([object Object]) .

enter image description here

我已经调查了这个问题,但没有找到解决方案的结果 .

1 回答

  • 1

    浏览器控制台中的错误消息:

    Swagger 2.0不支持null类型

    暗示您在API定义中的某个位置 type: null . OpenAPI / Swagger 2.0 does not support nulls .

    如果需要可空类型,请使用支持 nullable: true 的OpenAPI 3.0 .

相关问题