Skip to content

Commit

Permalink
fix(converter): ignore case for writer name
Browse files Browse the repository at this point in the history
Signed-off-by: Jiyong Huang <[email protected]>
  • Loading branch information
ngjaying committed Mar 3, 2025
1 parent ba1b80a commit 1709a25
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/converter/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@ func GetOrCreateConverter(ctx api.StreamContext, format string, schemaId string,
}

func GetConvertWriter(ctx api.StreamContext, format string, schemaId string, schema map[string]*ast.JsonStreamField, props map[string]any) (message.ConvertWriter, error) {
if cw, ok := modules.ConvertWriters[format]; ok {
t := strings.ToLower(format)
if cw, ok := modules.ConvertWriters[t]; ok {
ctx.GetLogger().Infof("writer %s not found, fall back to stack writer", t)
return cw(ctx, schemaId, schema, props)
}
c, err := GetOrCreateConverter(ctx, format, schemaId, schema, props)
c, err := GetOrCreateConverter(ctx, t, schemaId, schema, props)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 1709a25

Please sign in to comment.