0

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.

3
  • Please post your Swagger definition so that others can try to reproduce your issue. Commented Aug 15, 2018 at 7:31
  • 1
    Do you happen to have type: null somewhere in the spec? In that case, the error message is correct - OpenAPI/Swagger 2.0 does not support nulls. Commented Aug 15, 2018 at 7:34
  • 1
    Oh, I'm sorry, I checked my .YAML file and remove null fields, problem resolved. Thanks, my mistake :) Commented Aug 15, 2018 at 7:42

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.