Skip to content

Commit

Permalink
protoc-gen-openapiv2: generate hybrid files (#5088)
Browse files Browse the repository at this point in the history
Fixes #5046
  • Loading branch information
johanbrandhorst authored Dec 20, 2024
1 parent bb4c906 commit c89fdf7
Show file tree
Hide file tree
Showing 8 changed files with 5,792 additions and 407 deletions.
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ proto:
rm ./examples/internal/proto/examplepb/generated_input.pb.go
rm ./examples/internal/proto/examplepb/generated_input_grpc.pb.go
rm ./examples/internal/proto/examplepb/generated_input.pb.gw.go
# Remove swagger files for openapiv2 definitions, they're unused
rm ./protoc-gen-openapiv2/options/annotations.swagger.json
rm ./protoc-gen-openapiv2/options/openapiv2.swagger.json
buf generate \
--template ./examples/internal/proto/examplepb/openapi_merge.buf.gen.yaml \
--path ./examples/internal/proto/examplepb/openapi_merge_a.proto \
Expand Down Expand Up @@ -144,6 +147,10 @@ proto:
buf generate \
--template examples/internal/proto/examplepb/enum_with_single_value.buf.gen.yaml \
--path examples/internal/proto/examplepb/enum_with_single_value.proto
buf generate \
--template ./protoc-gen-openapiv2/options/buf.gen.yaml \
--path ./protoc-gen-openapiv2/options/annotations.proto \
--path ./protoc-gen-openapiv2/options/openapiv2.proto

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

Expand Down
4 changes: 3 additions & 1 deletion protoc-gen-openapiv2/options/annotations.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 0 additions & 44 deletions protoc-gen-openapiv2/options/annotations.swagger.json

This file was deleted.

269 changes: 269 additions & 0 deletions protoc-gen-openapiv2/options/annotations_protoopaque.pb.go

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions protoc-gen-openapiv2/options/buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: v2
plugins:
- remote: buf.build/protocolbuffers/go:v1.36.0
out: .
opt:
- paths=source_relative
- default_api_level=API_HYBRID
Loading

0 comments on commit c89fdf7

Please sign in to comment.