-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathbuf.gen.yaml
More file actions
75 lines (70 loc) · 2.87 KB
/
buf.gen.yaml
File metadata and controls
75 lines (70 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Buf code generation configuration v2
version: v2
# Managed mode - automatically manages go_package options
managed:
enabled: true
override:
# Set default Go package prefix for generated code
- file_option: go_package_prefix
value: github.com/SebastienMelki/sebuf/examples/multi-service-api/api
# Disable package prefix for Google APIs (use their standard packages)
- file_option: go_package_prefix
module: buf.build/googleapis/googleapis
value: ""
# Disable package prefix for protovalidate (use their standard packages)
- file_option: go_package_prefix
module: buf.build/bufbuild/protovalidate
value: ""
# Disable package prefix for sebuf (use standard import path)
- file_option: go_package_prefix
module: buf.build/sebmelki/sebuf
value: ""
# Local protoc plugins (installed via make install)
plugins:
# Standard Go protobuf code generation
- local: protoc-gen-go
out: ./api
opt: module=github.com/SebastienMelki/sebuf/examples/multi-service-api/api
# OpenAPI v3 documentation generation in YAML format.
# Per-service files (UserService.openapi.yaml, AdminService.openapi.yaml, ...)
# PLUS a single origin-level bundle (openapi.yaml) configured via bundle_* opts.
# The bundle is what you point agent SDKs, Postman, and RFC 9727 catalogs at.
#
# strategy: all is REQUIRED for bundle mode — buf's default "directory" strategy
# invokes the plugin once per proto directory, which would produce one partial
# bundle per directory and emit duplicate-filename warnings.
- local: ../../bin/protoc-gen-openapiv3
out: ./docs
strategy: all
opt:
- bundle=true
- bundle_title=Multi-Service API
- bundle_version=1.0.0
- bundle_description=Example origin-level bundle spanning User\, Admin\, and Public services.
- bundle_server=https://api.example.com
- bundle_contact_name=API Team
- bundle_contact_email=api@example.com
- bundle_license_name=Apache-2.0
- bundle_license_url=https://www.apache.org/licenses/LICENSE-2.0
# OpenAPI v3 documentation generation in JSON format (same bundle config)
- local: ../../bin/protoc-gen-openapiv3
out: ./docs
strategy: all
opt:
- format=json
- bundle=true
- bundle_output=openapi.json
- bundle_title=Multi-Service API
- bundle_version=1.0.0
- bundle_description=Example origin-level bundle spanning User\, Admin\, and Public services.
- bundle_server=https://api.example.com
- bundle_contact_name=API Team
- bundle_contact_email=api@example.com
- bundle_license_name=Apache-2.0
- bundle_license_url=https://www.apache.org/licenses/LICENSE-2.0
# HTTP service generation (custom)
- local: ../../bin/protoc-gen-go-http
out: api
opt:
- module=github.com/SebastienMelki/sebuf/examples/multi-service-api/api
- generate_mock=false