Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protoc-gen-openapiv2: generate hybrid files #5088

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading