Skip to content

Commit

Permalink
feat: use full proto package name in generated schema filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
niklaskb committed Sep 14, 2022
1 parent e2b4bb4 commit 3b0b219
Show file tree
Hide file tree
Showing 17 changed files with 4 additions and 5 deletions.
5 changes: 1 addition & 4 deletions internal/examples/proto/buf.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,4 @@ deps:
- remote: buf.build
owner: googleapis
repository: googleapis
branch: main
commit: d1a849b8f8304950832335723096e954
digest: b1-zJkwX0YeOp1Wa0Jaj_RqMLa2-oEzePH6PJEK8aaMeI4=
create_time: 2021-08-26T15:07:19.652533Z
commit: 8d7204855ec14631a499bd7393ce1970
4 changes: 3 additions & 1 deletion protoc-gen-bq-json-schema/genjson/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ package genjson

import (
"fmt"
"strings"

"go.einride.tech/protobuf-bigquery/encoding/jsonbq"
"google.golang.org/protobuf/compiler/protogen"
)

func GenerateSchemaFile(gen *protogen.Plugin, msg *protogen.Message, config Config) error {
g := gen.NewGeneratedFile(fmt.Sprintf("%s.json", msg.Desc.Name()), "")
filename := strings.ReplaceAll(strings.ToLower(string(msg.Desc.FullName())), ".", "_")
g := gen.NewGeneratedFile(fmt.Sprintf("%s.json", filename), "")
schema := config.SchemaOptions.InferMessageSchema(msg.Desc)
jsonOpt := jsonbq.MarshalOptions{}
if config.Format {
Expand Down

0 comments on commit 3b0b219

Please sign in to comment.