diff --git a/package.json b/package.json
index 311eafcc..a60c027f 100644
--- a/package.json
+++ b/package.json
@@ -45,8 +45,8 @@
"react-dom": ">=16.8"
},
"dependencies": {
- "@stoplight/json": "^3.17.1",
- "@stoplight/json-schema-tree": "^2.2.1",
+ "@stoplight/json": "^3.20.1",
+ "@stoplight/json-schema-tree": "^2.2.2",
"@stoplight/react-error-boundary": "^2.0.0",
"@types/json-schema": "^7.0.7",
"classnames": "^2.2.6",
diff --git a/src/__tests__/__snapshots__/index.spec.tsx.snap b/src/__tests__/__snapshots__/index.spec.tsx.snap
index 6837c649..e105dfa5 100644
--- a/src/__tests__/__snapshots__/index.spec.tsx.snap
+++ b/src/__tests__/__snapshots__/index.spec.tsx.snap
@@ -658,3 +658,37 @@ exports[`HTML Output given write mode, should populate proper nodes 1`] = `
"
`;
+
+exports[`HTML Output should render top-level description on allOf 1`] = `
+"
+
+
+
+
This is a description that should be rendered
+
+
+
+
+"
+`;
diff --git a/src/__tests__/index.spec.tsx b/src/__tests__/index.spec.tsx
index 32c00713..f25dc3bb 100644
--- a/src/__tests__/index.spec.tsx
+++ b/src/__tests__/index.spec.tsx
@@ -164,6 +164,32 @@ describe('HTML Output', () => {
expect(dumpDom()).toMatchSnapshot();
});
+
+ it('should render top-level description on allOf', () => {
+ const schema: JSONSchema4 = {
+ description: 'This is a description that should be rendered',
+ allOf: [
+ {
+ type: 'object',
+ properties: {
+ foo: {
+ type: 'string',
+ },
+ },
+ },
+ {
+ type: 'object',
+ properties: {
+ baz: {
+ type: 'string',
+ },
+ },
+ },
+ ],
+ };
+
+ expect(dumpDom()).toMatchSnapshot();
+ });
});
describe.each([{}, { unknown: '' }, { $ref: null }])('given empty schema, should render empty text', schema => {
diff --git a/src/components/SchemaRow/TopLevelSchemaRow.tsx b/src/components/SchemaRow/TopLevelSchemaRow.tsx
index 30747261..dbf82db3 100644
--- a/src/components/SchemaRow/TopLevelSchemaRow.tsx
+++ b/src/components/SchemaRow/TopLevelSchemaRow.tsx
@@ -7,6 +7,7 @@ import { COMBINER_NAME_MAP } from '../../consts';
import { useIsOnScreen } from '../../hooks/useIsOnScreen';
import { calculateChildrenToShow, isComplexArray } from '../../tree';
import { showPathCrumbsAtom } from '../PathCrumbs/state';
+import { Description } from '../shared';
import { ChildStack } from '../shared/ChildStack';
import { getInternalSchemaError } from '../shared/Validations';
import { SchemaRow, SchemaRowProps } from './SchemaRow';
@@ -24,6 +25,7 @@ export const TopLevelSchemaRow = ({ schemaNode }: Pick
+
{internalSchemaError.hasError && (
@@ -38,6 +40,7 @@ export const TopLevelSchemaRow = ({ schemaNode }: Pick
+