This commit is contained in:
k.a 2022-08-04 12:37:43 -07:00
Родитель 65fd105923
Коммит f13d7bab83
2 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -58,8 +58,8 @@ examples: $(BQ_PLUGIN)
run:
go build -o ~/bin/protoc-gen-bq-schema cmd/main.go
protoc \
-I ~/commerce/commerce-apis/ \
-I ~/commerce/commerce-apis/third_party/ \
-I ~/proto/commerce-apis/ \
-I ~/proto/googleapis/ \
--bq-schema_out=.scratch \
--bq-schema_opt=single-message \
--bq-schema_opt=Mcommerce/order.created.proto=subscription \

Просмотреть файл

@ -95,8 +95,10 @@ func _traverseField(pkgName string, bqField *BQField, protoField *descriptor.Fie
)
if _, ok := parentMessages[desc]; !ok {
if IsRecordType(inner) {
parentMessages[desc] = true
innerBQField = _traverseField(pkgName, innerBQField, inner, desc, parentMessages)
bqField.Fields = append(bqField.Fields, innerBQField)
parentMessages[desc] = false
} else {
bqField.Fields = append(bqField.Fields, innerBQField)
}