luolingchun / flask-openapi3

Generate REST API and OpenAPI documentation for your Flask project.
https://luolingchun.github.io/flask-openapi3/
MIT License
203 stars 33 forks source link

Does not meet Flask specifications #166

Closed ZongXR closed 3 months ago

ZongXR commented 3 months ago

Very nice and useful framework. But does not meet Flask specifications. In Flask, third party packages initial itself by init_app() method, which is mentioned in flask official document , e.g. Flask-SQLalchemy, Flask-APScheduler, etc. But this framework use Flask by inherited Flask class. Thus, I strongly recommend to improve this by Flask Extension Development Document

luolingchun commented 3 months ago

In fact, flask-openapi3 is not an extension of Flask, but an inheritance and enhancement of Flask.

ZongXR commented 3 months ago

In fact, flask-openapi3 is not an extension of Flask, but an inheritance and enhancement of Flask.

请问通过装饰器app.route能实现参数类型的自动校验以及swagger的自动生成吗?根据demo样例app.get可以,但是实测app.route不可以

luolingchun commented 3 months ago

app.route是从Flask继承过来的装饰器,所以没有swagger相关功能,感兴趣可以阅读一下源码。

ZongXR commented 3 months ago

app.route是从Flask继承过来的装饰器,所以没有swagger相关功能,感兴趣可以阅读一下源码。

感谢解答,就是试过不行看完源码才有的疑问。既然是继承自Flask,可以考虑重写相关方法