sanic-org / sanic-openapi

Easily document your Sanic API with a UI

Home Page:https://sanic-openapi.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]TypeError: Object of type Spec is not JSON serializable

oleeks opened this issue · comments

Describe the bug
image

Screenshots
image

image

Environment (please complete the following information):

  • OS: windos10
  • Browser [e.g. chrome, firefox]
  • Version [e.g. 0.5.3]
  • sanic-version 20.3.0
    Additional context
    Add any other context about the problem here. This might be how to fix this bug or some hint to fix it.

Hi @guifa2015, this issue is due to the new release of ujson. Please try to use ujson==1.3.5 instead. I will close this issue first and if you need more help, please reopen and let me know your issue. 😄

I tried pip install ujson==1.35 and the bug was fixed.

I wonder why 3.0.0 is buggy in that way?

The new release of ujson changes its behavior so the JSON serialization not working as before. This serialization already fixed in #157 but we haven't released this fixed version to PyPI yet.