Skip to content

Commit

Permalink
docs(openapi): add OpenAPI documentation for greeter services
Browse files Browse the repository at this point in the history
- Add comprehensive OpenAPI 3.0.3 documentation for HelloGreeterAPI and SecondGreeterAPI
- Include definitions for all API endpoints, request/response models, and error handling
- Generate OpenAPI YAML using protoc-gen-openapi plugin
- Update buf.gen.yaml configuration for OpenAPI generation
  • Loading branch information
godcong committed Nov 8, 2024
1 parent 5b1d912 commit a84adaa
Show file tree
Hide file tree
Showing 2 changed files with 581 additions and 1 deletion.
5 changes: 4 additions & 1 deletion buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ managed:
# disable:
# - file_option: go_package_prefix
# module: buf.build/bufbuild/protovalidate

plugins:
# comment with error: duplicate generated file name "openapi.yaml". Generation will continue without error here and drop the second occurrence of this file, but please raise an issue with the maintainer of the plugin.
- local: protoc-gen-openapi
Expand All @@ -19,8 +20,10 @@ plugins:
# - depth=2 # Recursion depth of the loop message. The default value is 2
# - default_response=false # Adds a default response message. If true, a default response is automatically added for actions using the google.rpc.Status message. This is useful if you use envoy or grpc-gateway for transcoding, as they use this type as the default error response. Default value: true.
# - enum_type=string # Serialized type of enumeration type. Use "string" for string-based serialization. The default value is integer.
- output_mode=source_relative # Output file generation mode. By default, only one openapi.yaml file is generated in the output folder. Using "source_relative" generates a separate "[inputfile].openapi.yaml" file for each '[inputfile].proto' file. The default is: merged.
# - output_mode=source_relative # Output file generation mode. By default, only one openapi.yaml file is generated in the output folder. Using "source_relative" generates a separate "[inputfile].openapi.yaml" file for each '[inputfile].proto' file. The default is: merged.
# - output_mode=merge
- fq_schema_naming=true # Schema named whether to add a package name, is true, will add a package name, for example: system. Service. V1. ListDictDetailResponse, otherwise as follows: ListDictDetailResponse. The default value is false.
strategy: all
- local: protoc-gen-go
out: api/v1/services
opt: paths=source_relative
Expand Down
Loading

0 comments on commit a84adaa

Please sign in to comment.