diff --git a/src/components/Schema/Schema.tsx b/src/components/Schema/Schema.tsx index 1be8d4cb11..d875071029 100644 --- a/src/components/Schema/Schema.tsx +++ b/src/components/Schema/Schema.tsx @@ -40,6 +40,13 @@ export class Schema extends React.Component> { } if (discriminatorProp !== undefined) { + if (!oneOf || !oneOf.length) { + throw new Error( + `Looks like you are using discriminator wrong: you don't have any definition inherited from the ${ + schema.title + }`, + ); + } return (