Skip to content

Commit

Permalink
Show svro pretty display for nullable array elements (#1915)
Browse files Browse the repository at this point in the history
  • Loading branch information
Franciszek-Bubnicki authored Nov 7, 2024
1 parent 4180225 commit 6afc3ac
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
const getComplexType = (type: Type) => {
if (type.type === 'array') {
const arrayType = getTypes(type.items)[0];
return `[]${arrayType}`;
return `${arrayType}[]`;
} else if (type.type === 'map') {
const mapType = getTypes(type.values)[0];
return `map[string]${mapType}`;
Expand Down Expand Up @@ -45,7 +45,7 @@
.map((subType) => findNestedType(subType))
.find((subType) => Object.getOwnPropertyDescriptor(subType, 'type'));
}
if (type.type === 'array') return type.items;
if (type.type === 'array') return findNestedType(type.items);
if (type.type === 'map') return type.values;
return type;
};
Expand Down

0 comments on commit 6afc3ac

Please sign in to comment.