-
Notifications
You must be signed in to change notification settings - Fork 20
/
modifyproto.yml
65 lines (54 loc) · 3.52 KB
/
modifyproto.yml
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
# Source folder to read proto files from.
inputDirectory: src/main/proto
# Target directory to write resulting proto files. Proto files are placed in sub folders according to their package name
outputDirectory: target/modifydproto
# Any extra import locations to use when the linker is trying to validate the modified proto files.
customImportLocations:
- pathToRootFolder1OfProtobufImport
- pathToRootFolder2OfProtobufImport
# A heterogeneous set of rules to include and exclude types and members. If a member is included in the set, its type is implicitly also included. A type that
# is included without a specific member implicitly includes all of that type's members, but not its nested types.
#
#
# Rules in this set may be in the following forms:
#
# -Package names, followed by {@code .*}, like {@code squareup.protos.person.*}. This matches types and services defined in the package and its descendant
# packages.
# -Fully qualified type and service names, like {@code squareup.protos.person.Person}.
# -Fully qualified member names, which are type names followed by a '#', followed by a member name, like {@code squareup.protos.person.Person#address}.
# Members may be fields, enum constants or RPCs.
#
# An identifier set populated with {@code Movie} and {@code Actor#name} contains all members of {@code Movie} (such as {@code Movie#name} and
# {@code Movie#release_date}). It contains the type {@code Actor} and one member {@code Actor#name}, but not {@code Actor#birth_date} or {@code
# Actor#oscar_count}.
#
# This set has <i>included identifiers</i> and <i>excluded identifiers</i>, with excludes taking precedence over includes. That is, if a type {@code Movie} is
# in both the includes and the excludes, it is not contained in the set.
#
# If the includes set is empty, that implies that all elements should be included. Use this to exclude unwanted types and members without also including
# everything else.
includes:
- A
- B
# Include all types that are used as base types for included types: true|false.
includeBaseTypes: true
# See doc for includes field
excludes:
- LangType
# Add new field to given type. Note: All on same line (snake yaml)
newFields:
- { targetMessageType: existingPackageName.ExistingMessageType, name: field_name, type: packageName.FieldType, importProto: packageName/file.proto, label: repeated, fieldNumber: 12 }
- { targetMessageType: existingPackageName.ExistingMessageType, name: field_name_2, type: FieldTypeCommon, importProto: packageName/file2.proto, fieldNumber: 13 }
# Modify an existing field on an existing type. Note: All on same line (snake yaml)
modifyFields:
- { targetMessageType: existingPackageName.ExistingMessageType, name: existing_field_name, documentation: "This documentation completely replaces existing documentation on the field." }
- { targetMessageType: existingPackageName.ExistingMessageType, name: existing_field_name2, documentationPattern: "(.*)", documentation: "Replaces matching regex pattern of the existing documentation with this text - matching groups supported $1" }
# Add new enum value to existing enum. Note: All on same line (snake yaml)
newEnumConstants:
- { targetEnumType: existingPackageName.ExistingEnumType, name: ENUM_CONSTANT_TYPE_NEW_VALUE, fieldNumber: 12, documentation: "Enum value documentation" }
# Merge types from an external path into existing schema
mergeFrom:
- { sourceFolder: pathToSourceFolder, protoFile: protoPackage/protofile.proto }
# Include 'go_package' options in all files
includeGoPackageOptions: false
goPackageSourcePrefix: xxx.github/go/