Skip to content

Commit c89fdf7

Browse files
protoc-gen-openapiv2: generate hybrid files (#5088)
Fixes #5046
1 parent bb4c906 commit c89fdf7

File tree

8 files changed

+5792
-407
lines changed

8 files changed

+5792
-407
lines changed

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ proto:
9898
rm ./examples/internal/proto/examplepb/generated_input.pb.go
9999
rm ./examples/internal/proto/examplepb/generated_input_grpc.pb.go
100100
rm ./examples/internal/proto/examplepb/generated_input.pb.gw.go
101+
# Remove swagger files for openapiv2 definitions, they're unused
102+
rm ./protoc-gen-openapiv2/options/annotations.swagger.json
103+
rm ./protoc-gen-openapiv2/options/openapiv2.swagger.json
101104
buf generate \
102105
--template ./examples/internal/proto/examplepb/openapi_merge.buf.gen.yaml \
103106
--path ./examples/internal/proto/examplepb/openapi_merge_a.proto \
@@ -144,6 +147,10 @@ proto:
144147
buf generate \
145148
--template examples/internal/proto/examplepb/enum_with_single_value.buf.gen.yaml \
146149
--path examples/internal/proto/examplepb/enum_with_single_value.proto
150+
buf generate \
151+
--template ./protoc-gen-openapiv2/options/buf.gen.yaml \
152+
--path ./protoc-gen-openapiv2/options/annotations.proto \
153+
--path ./protoc-gen-openapiv2/options/openapiv2.proto
147154

148155
generate: proto $(ECHO_EXAMPLE_SRCS) $(ABE_EXAMPLE_SRCS) $(UNANNOTATED_ECHO_EXAMPLE_SRCS) $(RESPONSE_BODY_EXAMPLE_SRCS) $(GENERATE_UNBOUND_METHODS_EXAMPLE_SRCS)
149156

protoc-gen-openapiv2/options/annotations.pb.go

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protoc-gen-openapiv2/options/annotations.swagger.json

Lines changed: 0 additions & 44 deletions
This file was deleted.

protoc-gen-openapiv2/options/annotations_protoopaque.pb.go

Lines changed: 269 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: v2
2+
plugins:
3+
- remote: buf.build/protocolbuffers/go:v1.36.0
4+
out: .
5+
opt:
6+
- paths=source_relative
7+
- default_api_level=API_HYBRID

0 commit comments

Comments
 (0)