Skip to content

Commit 347e306

Browse files
properly process discriminators
1 parent 1de5b2c commit 347e306

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/middlewares/parsers/schema.preprocessor.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,17 @@ export class SchemaPreprocessor<
243243
node.object,
244244
);
245245

246+
if (seenObjects.has(resolvedObject)) {
247+
if (hasNodeType(node, 'schema')) {
248+
this.processDiscriminator(
249+
hasNodeType(parent, 'schema') ? parent : undefined,
250+
node,
251+
);
252+
}
253+
254+
return;
255+
}
256+
246257
// Resolve reference object in parent, then process again with resolved schema
247258
// As every object (aka schema) is 'pass-by-reference', this will update the actual apiDoc.
248259
if (node.pathFromParent && node.pathFromParent.length > 0) {

0 commit comments

Comments
 (0)