-
- {configShow.errors && error &&
}
- {configShow.info &&
}
- {configShow.servers &&
}
- {configShow.operations &&
}
- {configShow.messages &&
}
- {configShow.schemas &&
}
+
+
+ {configShow.sidebar &&
}
+
+
+ {configShow.info && }
+ {configShow.servers && }
+ {configShow.operations && }
+ {configShow.messages && }
+ {configShow.schemas && }
+
+
-
-
+
diff --git a/library/src/containers/AsyncApi/Standalone.tsx b/library/src/containers/AsyncApi/Standalone.tsx
index 9c5cc3c8e..b4ac3665a 100644
--- a/library/src/containers/AsyncApi/Standalone.tsx
+++ b/library/src/containers/AsyncApi/Standalone.tsx
@@ -84,13 +84,7 @@ class AsyncApiComponent extends Component
{
);
}
- return (
-
- );
+ return ;
}
private updateState(schema: PropsSchema) {
diff --git a/library/src/containers/Error/Error.tsx b/library/src/containers/Error/Error.tsx
index eba833efa..e22618ea3 100644
--- a/library/src/containers/Error/Error.tsx
+++ b/library/src/containers/Error/Error.tsx
@@ -15,7 +15,10 @@ const renderErrors = (errors: ValidationError[]): React.ReactNode => {
}
return (
- {`line ${singleError?.location?.startLine + singleError?.location?.startOffset}:`}
+ {(singleError?.location?.startLine ??
+ singleError?.location?.startOffset) && (
+ {`line ${singleError?.location?.startLine + singleError?.location?.startOffset}:`}
+ )}
{singleError.title}
diff --git a/library/src/types.ts b/library/src/types.ts
index c1d52ae4c..9f58864e2 100644
--- a/library/src/types.ts
+++ b/library/src/types.ts
@@ -44,7 +44,7 @@ export interface MessageExample {
export interface ValidationError {
title: string;
- location: {
+ location?: {
jsonPointer: string;
startLine: number;
startColumn: number;
diff --git a/package-lock.json b/package-lock.json
index b93d8ed72..810d58f86 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -47,6 +47,7 @@
"isomorphic-dompurify": "^2.14.0",
"marked": "^4.0.14",
"openapi-sampler": "^1.2.1",
+ "react-error-boundary": "^4.1.2",
"use-resize-observer": "^9.1.0"
},
"devDependencies": {
@@ -22049,6 +22050,18 @@
"loose-envify": "^1.1.0"
}
},
+ "node_modules/react-error-boundary": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/react-error-boundary/-/react-error-boundary-4.1.2.tgz",
+ "integrity": "sha512-GQDxZ5Jd+Aq/qUxbCm1UtzmL/s++V7zKgE8yMktJiCQXCCFZnMZh9ng+6/Ne6PjNSXH0L9CjeOEREfRnq6Duag==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/runtime": "^7.12.5"
+ },
+ "peerDependencies": {
+ "react": ">=16.13.1"
+ }
+ },
"node_modules/react-is": {
"version": "17.0.2",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",