pythonswaggeropenapipyramid

Swagger Documentation for Python Pyramid Application


I have an old python pyramid web application and I just wanted to create an API documentation (specifically Swagger or OpenAPI3) for it. Is there a way to do that without writing the entire swagger YAML schema yourself. Is there a library that automatically scans through all the @view_config routes in the application and then generates the document for it.

There are similar things in spring or spring-boot where the swagger schema/spec is autogenerated based on the code. Is there a similar of doing this for the python pyramid application.

PS. The application uses Poetry as the dependancy manager.


Solution

  • As far as I know, there isn't OpenAPI-sec generating solution for Pyramid. pyramid_openapi reads Yaml file and generates view bindings for you, not the opposite what you are asking in the question.

    My guess is that the best solution would be lift some code from FastAPI and integrate that to your Pyramid application.