Sanic: Swagger/OpenAPI Support

Created on 19 Oct 2016  路  6Comments  路  Source: sanic-org/sanic

It would be nice to have Swagger/OpenAPI support. I'm not sure what the most intuitive way to implement this is.

Some examples, for inspiration:

  • Flask-swagger - Uses YAML appended to docstring
  • Connexion - Reads YAML swagger doc files and hosts a swagger UI
intermediate needs investigation nice to have

Most helpful comment

Is there any swagger-first extension for Sanic?

All 6 comments

From the looks of it Flask-swagger should basically just work for sanic. Not nearly the features of Connexion, but a good start. You could probably just import Flask-swagger and use it. Since its just parsing the actual python file, and doesn't do anything flask specific.

Another place you might want to get inspiration from:

It can be somewhat opinionated about how to build things but has some nice features IMO.

See #380

Closed by @channelcat's extension here: https://github.com/channelcat/sanic-openapi

Is there any swagger-first extension for Sanic?

I'm writing a PoC of Sanic+Connexion https://github.com/zalando/connexion/pull/1250/files

Was this page helpful?
0 / 5 - 0 ratings