Describe the bug
无法在Service下设置SecuritySchemes,甚至在修改一部分源码后还是设置不完全
To Reproduce
Steps to reproduce the behavior:
-
使用的是thrift,在文件中设置如下
service SwaggerDocService {}
(
openapi.document = '{
info: {
title: "自定义Swagger文档",
version: "1.0.0",
description: "这是一个使用thrift-gen-http-swagger生成的Swagger文档示例"
},
components: {
security_schemes: {
additional_properties: [
{
name: "bearerAuth"
value: {
security_scheme: {
_type: "http"
scheme: "bearer"
}
}
},
{
name: "jwtAuth"
value: {
security_scheme: {
_type: "http"
scheme: "JWT"
}
}
}
]
}
},
security: {
additional_properties: [
{
name: "bearerAuth"
value: {
value: []
}
}
]
}
}'
)
这个在生成的时候直接报错rror merging document option: document:failed to parse option:no [] when parse list
-
修改thrift-gen-http-swagger源码open_api.go下方法BuildDocument,增加默认SecuritySchemes,但是里边有个字段_Type无法正常赋值,我查看protoc-gen-http-swagger中相同代码,使用的Type没有下划线,2个项目不统一是不是有问题啊。
希望能够有设置SecuritySchemes配置的地方,并且能够设置为全局需要验证,不用验证的接口单独进行设置。
Describe the bug
无法在Service下设置SecuritySchemes,甚至在修改一部分源码后还是设置不完全
To Reproduce
Steps to reproduce the behavior:
使用的是thrift,在文件中设置如下
service SwaggerDocService {}
(
openapi.document = '{
info: {
title: "自定义Swagger文档",
version: "1.0.0",
description: "这是一个使用thrift-gen-http-swagger生成的Swagger文档示例"
},
components: {
security_schemes: {
additional_properties: [
{
name: "bearerAuth"
value: {
security_scheme: {
_type: "http"
scheme: "bearer"
}
}
},
{
name: "jwtAuth"
value: {
security_scheme: {
_type: "http"
scheme: "JWT"
}
}
}
]
}
},
security: {
additional_properties: [
{
name: "bearerAuth"
value: {
value: []
}
}
]
}
}'
)
这个在生成的时候直接报错rror merging document option: document:failed to parse option:no [] when parse list
修改thrift-gen-http-swagger源码open_api.go下方法BuildDocument,增加默认SecuritySchemes,但是里边有个字段_Type无法正常赋值,我查看protoc-gen-http-swagger中相同代码,使用的Type没有下划线,2个项目不统一是不是有问题啊。
希望能够有设置SecuritySchemes配置的地方,并且能够设置为全局需要验证,不用验证的接口单独进行设置。