Skip to content

Commit 4b18a93

Browse files
authored
Update buf.gen.yaml input for buf 1.51.0 release (SchemaStore#4621)
* Update buf.gen.yaml input for buf 1.51.0 release This updates `buf.gen.json` to add support for the improved filtering in buf 1.51.0. Type filter was added to plugins, and the new field exclude_types. * Add missing
1 parent c5bd54d commit 4b18a93

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

src/schemas/json/buf.gen.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111
"type": "string"
1212
}
1313
},
14+
"exclude_types": {
15+
"description": "Exclude the specified types when generating.",
16+
"type": "array",
17+
"minItems": 1,
18+
"items": {
19+
"type": "string"
20+
}
21+
},
1422
"paths": {
1523
"description": "Include only the specified paths when generating.",
1624
"type": "array",
@@ -129,6 +137,12 @@
129137
}
130138
}
131139
]
140+
},
141+
"types": {
142+
"$ref": "#/$defs/types"
143+
},
144+
"exclude_types": {
145+
"$ref": "#/$defs/exclude_types"
132146
}
133147
},
134148
"required": ["out"],
@@ -543,6 +557,12 @@
543557
"$comment": "https://buf.build/docs/configuration/v2/buf-gen-yaml#include_wkt",
544558
"description": "Optional. Generates Well-Known Types. Can't be set without --include-imports. This setting works the same as the --include-wkt flag on buf generate—if they conflict with each other, the flag gets precedence.",
545559
"type": "boolean"
560+
},
561+
"types": {
562+
"$ref": "#/$defs/types"
563+
},
564+
"exclude_types": {
565+
"$ref": "#/$defs/exclude_types"
546566
}
547567
}
548568
}
@@ -561,6 +581,9 @@
561581
"types": {
562582
"$ref": "#/$defs/types"
563583
},
584+
"exclude_types": {
585+
"$ref": "#/$defs/exclude_types"
586+
},
564587
"paths": {
565588
"$ref": "#/$defs/paths"
566589
},
@@ -581,6 +604,9 @@
581604
"types": {
582605
"$ref": "#/$defs/types"
583606
},
607+
"exclude_types": {
608+
"$ref": "#/$defs/exclude_types"
609+
},
584610
"paths": {
585611
"$ref": "#/$defs/paths"
586612
},
@@ -606,6 +632,9 @@
606632
"types": {
607633
"$ref": "#/$defs/types"
608634
},
635+
"exclude_types": {
636+
"$ref": "#/$defs/exclude_types"
637+
},
609638
"paths": {
610639
"$ref": "#/$defs/paths"
611640
},
@@ -651,6 +680,9 @@
651680
"types": {
652681
"$ref": "#/$defs/types"
653682
},
683+
"exclude_types": {
684+
"$ref": "#/$defs/exclude_types"
685+
},
654686
"paths": {
655687
"$ref": "#/$defs/paths"
656688
},
@@ -684,6 +716,9 @@
684716
"types": {
685717
"$ref": "#/$defs/types"
686718
},
719+
"exclude_types": {
720+
"$ref": "#/$defs/exclude_types"
721+
},
687722
"paths": {
688723
"$ref": "#/$defs/paths"
689724
},
@@ -716,6 +751,13 @@
716751
"type": "string"
717752
}
718753
},
754+
"exclude_types": {
755+
"type": "array",
756+
"minItems": 1,
757+
"items": {
758+
"type": "string"
759+
}
760+
},
719761
"paths": {
720762
"type": "array",
721763
"minItems": 1,
@@ -748,6 +790,9 @@
748790
"types": {
749791
"$ref": "#/$defs/types"
750792
},
793+
"exclude_types": {
794+
"$ref": "#/$defs/exclude_types"
795+
},
751796
"paths": {
752797
"$ref": "#/$defs/paths"
753798
},
@@ -773,6 +818,9 @@
773818
"types": {
774819
"$ref": "#/$defs/types"
775820
},
821+
"exclude_types": {
822+
"$ref": "#/$defs/exclude_types"
823+
},
776824
"paths": {
777825
"$ref": "#/$defs/paths"
778826
},
@@ -798,6 +846,9 @@
798846
"types": {
799847
"$ref": "#/$defs/types"
800848
},
849+
"exclude_types": {
850+
"$ref": "#/$defs/exclude_types"
851+
},
801852
"paths": {
802853
"$ref": "#/$defs/paths"
803854
},
@@ -823,6 +874,9 @@
823874
"types": {
824875
"$ref": "#/$defs/types"
825876
},
877+
"exclude_types": {
878+
"$ref": "#/$defs/exclude_types"
879+
},
826880
"paths": {
827881
"$ref": "#/$defs/paths"
828882
},

src/test/buf.gen/v2.buf.gen.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ plugins:
107107
strategy: all
108108
include_imports: true
109109
include_wkt: true
110+
types:
111+
- 'foo.v1.User'
112+
- 'foo.v1.UserService'
113+
exclude_types:
114+
- 'foo.v1.User.Password'
115+
- 'foo.v1.User.Email'
110116

111117
inputs:
112118
# Git repository
@@ -119,6 +125,9 @@ inputs:
119125
types:
120126
- 'foo.v1.User'
121127
- 'foo.v1.UserService'
128+
exclude_types:
129+
- 'foo.v1.User.Password'
130+
- 'foo.v1.User.Email'
122131
# If empty, include all paths.
123132
paths:
124133
- a/b/c

0 commit comments

Comments
 (0)