烧瓶集默认安全字段用于验证装饰器
我刚刚为烧瓶应用程序添加了Secustreation Decorator的安全性:
@rest.post("/url")
@spectree.validate(json=InputSchema, security=[{"apiKey": "X-API-KEY"}, {"Source": "Authorization"}])
def ep_document(json: InputSchema):
...
是否有办法将其设置为默认安全性,以便我不必将此字段添加到所有Spectree Decorator中?
I just finished adding security to my spectree validate decorator for my flask app:
@rest.post("/url")
@spectree.validate(json=InputSchema, security=[{"apiKey": "X-API-KEY"}, {"Source": "Authorization"}])
def ep_document(json: InputSchema):
...
Is there a way to set this as a default security so that I don't have to add this field to all my spectree decorators?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,可以在Spectree Config直接进行此配置:
Turns out it's possible to do this config directly in spectree config: