mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-22 08:36:33 +03:00
fix: do not crash on incompatible allOf, console.warn instead
fixes #1156
This commit is contained in:
parent
846065916d
commit
6e607b9a29
|
@ -43,9 +43,10 @@ export class Schema extends React.Component<Partial<SchemaProps>> {
|
|||
|
||||
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 (
|
||||
<ObjectSchema
|
||||
|
|
|
@ -239,7 +239,9 @@ export class OpenAPIParser {
|
|||
receiver.type !== undefined &&
|
||||
subSchema.type !== undefined
|
||||
) {
|
||||
throw new Error(`Incompatible types in allOf at "${$ref}"`);
|
||||
console.warn(
|
||||
`Incompatible types in allOf at "${$ref}": "${receiver.type}" and "${subSchema.type}"`,
|
||||
);
|
||||
}
|
||||
|
||||
if (subSchema.type !== undefined) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user