File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,8 @@ def _run_proto_gen_openapi(
53
53
protoc_gen_openapiv2 ,
54
54
grpc_api_configuration ,
55
55
single_output ,
56
- json_names_for_fields ):
56
+ json_names_for_fields ,
57
+ fqn_for_swagger_name ):
57
58
args = actions .args ()
58
59
59
60
args .add ("--plugin" , "protoc-gen-openapiv2=%s" % protoc_gen_openapiv2 .path )
@@ -69,6 +70,9 @@ def _run_proto_gen_openapi(
69
70
if not json_names_for_fields :
70
71
args .add ("--openapiv2_opt" , "json_names_for_fields=false" )
71
72
73
+ if fqn_for_swagger_name :
74
+ args .add ("--swagger_opt" , "fqn_for_swagger_name=true" )
75
+
72
76
proto_file_infos = _direct_source_infos (proto_info )
73
77
74
78
# TODO(yannic): Use |proto_info.transitive_descriptor_sets| when
@@ -153,6 +157,7 @@ def _proto_gen_openapi_impl(ctx):
153
157
grpc_api_configuration = ctx .file .grpc_api_configuration ,
154
158
single_output = ctx .attr .single_output ,
155
159
json_names_for_fields = ctx .attr .json_names_for_fields ,
160
+ fqn_for_swagger_name = ctx .attr .fqn_for_swagger_name ,
156
161
),
157
162
),
158
163
),
@@ -176,6 +181,10 @@ protoc_gen_openapiv2 = rule(
176
181
default = True ,
177
182
mandatory = False ,
178
183
),
184
+ "fqn_for_swagger_name" : attr .bool (
185
+ default = False ,
186
+ mandatory = False ,
187
+ ),
179
188
"_protoc" : attr .label (
180
189
default = "@com_google_protobuf//:protoc" ,
181
190
executable = True ,
You can’t perform that action at this time.
0 commit comments