I previously searched online for similar incomplete solutions and found that the generated OpenAPI specifications often had issues and lacked flexibility. Therefore, I referred to some other frameworks and combined them with my own ideas to write a demo. This demo might have some issues and is just for reference.
- Install required libraries
pip install sanic[ext]==23.12.1
- Run
sanic main:app -H localhost -p 9001 --auto-reload