rootturk
rootturk

Reputation: 316

Swagger Editor generated python-flask null type error

I created my rest-ful api endpoint documentation on Swagger hub/Swagger editor. I have python-sanic based restful api endpoints. I'm generate and run python-flask server but I received error message.

Uncaught TypeError: Swagger 2.0 does not support null types ([object Object]).

enter image description here

I have investigated this problem but have not found a result for the solution.

Upvotes: 0

Views: 785

Answers (1)

Helen
Helen

Reputation: 97540

The error message in the browser console:

Swagger 2.0 does not support null types

implies that you have type: null somewhere in your API definition. OpenAPI/Swagger 2.0 does not support nulls.

If you need nullable types, use OpenAPI 3.0 which supports nullable: true.

Upvotes: 2

Related Questions