Skip to content

Commit

Permalink
Add use_allof_for_refs definitions (#3092)
Browse files Browse the repository at this point in the history
Co-authored-by: Warren Brown <warren.brown@infosum.com>
  • Loading branch information
warrenb95 and warren-brown95 committed Dec 24, 2022
1 parent fe05614 commit 8cb1087
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion protoc-gen-openapiv2/defs.bzl
Expand Up @@ -69,7 +69,8 @@ def _run_proto_gen_openapi(
proto3_optional_nullable,
openapi_configuration,
generate_unbound_methods,
visibility_restriction_selectors):
visibility_restriction_selectors,
use_allof_for_refs):
args = actions.args()

args.add("--plugin", "protoc-gen-openapiv2=%s" % protoc_gen_openapiv2.path)
Expand Down Expand Up @@ -130,6 +131,9 @@ def _run_proto_gen_openapi(
for visibility_restriction_selector in visibility_restriction_selectors:
args.add("--openapiv2_opt", "visibility_restriction_selectors=%s" % visibility_restriction_selector)

if use_allof_for_refs:
args.add("--openapiv2_opt", "use_allof_for_refs=true")

args.add("--openapiv2_opt", "repeated_path_param_separator=%s" % repeated_path_param_separator)

proto_file_infos = _direct_source_infos(proto_info)
Expand Down Expand Up @@ -232,6 +236,7 @@ def _proto_gen_openapi_impl(ctx):
openapi_configuration = ctx.file.openapi_configuration,
generate_unbound_methods = ctx.attr.generate_unbound_methods,
visibility_restriction_selectors = ctx.attr.visibility_restriction_selectors,
use_allof_for_refs = ctx.attr.use_allof_for_refs,
),
),
),
Expand Down

0 comments on commit 8cb1087

Please sign in to comment.