Skip to content

Commit e49e93d

Browse files
committed
Scaffold openapiv3 plugin
1 parent a070de7 commit e49e93d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+30123
-2
lines changed

.devcontainer/devcontainer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
"bazel.buildifierExecutable": "/go/bin/buildifier",
2020
"bazel.buildifierFixOnFormat": true,
2121
"bazel.enableCodeLens": true,
22-
"extensions": ["golang.Go", "bazelbuild.vscode-bazel"]
22+
"extensions": [
23+
"golang.Go",
24+
"bazelbuild.vscode-bazel"
25+
]
2326
}
2427
}
25-
}
28+
}

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ proto:
151151
--template ./protoc-gen-openapiv2/options/buf.gen.yaml \
152152
--path ./protoc-gen-openapiv2/options/annotations.proto \
153153
--path ./protoc-gen-openapiv2/options/openapiv2.proto
154+
buf generate \
155+
--template ./protoc-gen-openapiv3/options/buf.gen.yaml \
156+
--path ./protoc-gen-openapiv3/options/annotations.proto \
157+
--path ./protoc-gen-openapiv3/options/openapiv3.proto
154158

155159
generate: proto $(ECHO_EXAMPLE_SRCS) $(ABE_EXAMPLE_SRCS) $(UNANNOTATED_ECHO_EXAMPLE_SRCS) $(RESPONSE_BODY_EXAMPLE_SRCS) $(GENERATE_UNBOUND_METHODS_EXAMPLE_SRCS)
156160

internal/descriptor/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ go_library(
1717
"//internal/codegenerator",
1818
"//internal/descriptor/apiconfig",
1919
"//internal/descriptor/openapiconfig",
20+
"//internal/descriptor/openapiconfigv3:openapiconfig",
2021
"//internal/httprule",
2122
"//protoc-gen-openapiv2/options",
23+
"//protoc-gen-openapiv3/options",
2224
"@in_gopkg_yaml_v3//:yaml_v3",
2325
"@org_golang_google_genproto_googleapis_api//annotations",
2426
"@org_golang_google_grpc//grpclog",
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_library")
2+
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
3+
load("@rules_proto//proto:defs.bzl", "proto_library")
4+
5+
proto_library(
6+
name = "openapiconfig_proto",
7+
srcs = ["openapiconfig.proto"],
8+
visibility = ["//:__subpackages__"],
9+
deps = ["//protoc-gen-openapiv3/options:options_proto"],
10+
)
11+
12+
go_proto_library(
13+
name = "openapiconfig_go_proto",
14+
compilers = ["//:go_apiv2"],
15+
importpath = "github.com/grpc-ecosystem/grpc-gateway/v2/internal/descriptor/openapiconfigv3",
16+
proto = ":openapiconfig_proto",
17+
visibility = ["//:__subpackages__"],
18+
deps = ["//protoc-gen-openapiv3/options"],
19+
)
20+
21+
go_library(
22+
name = "openapiconfig",
23+
embed = [":openapiconfig_go_proto"],
24+
importpath = "github.com/grpc-ecosystem/grpc-gateway/v2/internal/descriptor/openapiconfigv3",
25+
visibility = ["//:__subpackages__"],
26+
)
27+
28+
alias(
29+
name = "go_default_library",
30+
actual = ":openapiconfigv3",
31+
visibility = ["//:__subpackages__"],
32+
)

0 commit comments

Comments
 (0)