Skip to content

Commit 1d91e91

Browse files
committed
nit
1 parent 0889f8b commit 1d91e91

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

internal/protoschema/protoschema.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,10 @@ func getFieldAliases(fieldSchema *protoschemav1.FieldSchema) ([]protoreflect.Nam
5959

6060
func getFieldAliasesJSON(jsonAliases []string, aliases []protoreflect.Name) []string {
6161
if len(jsonAliases) > 0 {
62+
// Use the provided JSON aliases if they are present.
6263
return jsonAliases
6364
}
64-
if len(aliases) == 0 {
65-
return nil
66-
}
65+
// Otherwise, generate JSON aliases from the field aliases.
6766
result := make([]string, len(aliases))
6867
for i, alias := range aliases {
6968
result[i] = JSONName(string(alias))

0 commit comments

Comments
 (0)