Skip to content

Commit

Permalink
fix: fix displaying top-level object without any properties
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanHotsiy committed Sep 24, 2020
1 parent f3e8ab4 commit a5468fb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/Schema/Schema.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ export class Schema extends React.Component<Partial<SchemaProps>> {

switch (type) {
case 'object':
return <ObjectSchema {...(this.props as any)} />;
if (schema.fields?.length) {
return <ObjectSchema {...(this.props as any)} />;
}
break;
case 'array':
return <ArraySchema {...(this.props as any)} />;
}
Expand Down

0 comments on commit a5468fb

Please sign in to comment.