From 6e607b9a2928b062c7705087432c0f0d88e74f5d Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Sun, 10 May 2020 21:59:48 +0300 Subject: [PATCH] fix: do not crash on incompatible allOf, console.warn instead fixes #1156 --- src/components/Schema/Schema.tsx | 3 ++- src/services/OpenAPIParser.ts | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/Schema/Schema.tsx b/src/components/Schema/Schema.tsx index 2a533190..91553ce8 100644 --- a/src/components/Schema/Schema.tsx +++ b/src/components/Schema/Schema.tsx @@ -43,9 +43,10 @@ export class Schema extends React.Component> { if (discriminatorProp !== undefined) { if (!oneOf || !oneOf.length) { - throw new Error( + console.warn( `Looks like you are using discriminator wrong: you don't have any definition inherited from the ${schema.title}`, ); + return null; } return (