lzjun567 / flask-siwadoc Goto Github PK
View Code? Open in Web Editor NEWflask-siwadoc is a flask data validator and openapi document generator automaticly
License: MIT License
flask-siwadoc is a flask data validator and openapi document generator automaticly
License: MIT License
针对header仅提供了文档支持,但并未对header参数进行校验,不知是否有意为之?
siwadoc 是否支持 自定义 response code 和 description, 例如 5xx: 'something is invalid'
作者你好 请问什么时候会发新版
#注册告警接口蓝图
from alarm.main import blue
app.register_blueprint(blue, url_prefix='/alarmapi')
你好请问下 如果引入了蓝图要如何注册
AssertionError: A name collision occurred between blueprints <flask.blueprints.Blueprint object at 0x7f9ea0a14cc0> and <flask.blueprints.Blueprint object at 0x7f9ea0a149b0>. Both share the same name "siwadoc". Blueprints that are created on the fly need unique names.
siwa.doc 方法的x参数并没有用上
code_msg = {}
if code_msg:
wrapper.x = code_msg
这段代码相当于写死了,没有透出接口
大佬你好,这是一个非常棒的项目。但是我发现在用的时候,如果padantic模型中的一个数据校验来源于另一个模型时,flask在解析请求的时候会无法解析另一个模型类型的数据。例如,
class A(BaseModel):
aa: str
bb: int
class B(BaseModel):
dd: int
cc : List[A]
@app.route("/hello", methods=["POST"])
@siwa.doc(query=B, tags=["data_conf"], group="user")
def users_list(query: B):
print(query)
return jsonify(query)
这个时候对数据校验的时候, cc的部分就会无法解析。报错:
cc-> 0
value is not a valid dict (type=type_error.dict)
如果能够支持Form和files类型,那就非常完美了。
我是先用的Flask,后来看到fastapi的自动文档接口很爽试了一下,但一下没放弃Flask
试用了你的flask-siwadoc,效果很好,支持一下!
我看到doc函数支持query和Body两种来源的参数,但还有一种比较常用的是在Header里面,比如token,现在似乎还不支持?
希望在未来能够增加这一支持!
你好,flask-siwadoc这个包支持传入token吗?
我在后端做了接口token校验,没有token的话无法请求接口,那么在flask-siwadoc能不能像Java springboot中的swagger一样将token放在请求头,每次调用接口时自动携带
English description:
Hello, does the flask-siwadoc package support passing tokens?
I have done the token verification of the interface on the back end and cannot request the interface without the token. Then in flask-siwadoc, can I put the token in the request header like swagger in Java springboot and carry it automatically every time the interface is called
希望在公司内网使用,有些js脚本能否通过外网机器下载后配置到工程内,从而无Internet环境也能够打开文档页面?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.