Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 authored Mar 8, 2024
1 parent 7fbffe5 commit a2dbd8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function getSchemaForDoc(schema, res) {
const discriminatorValue = res[schema.discriminatorMapping.key];
let childSchema = undefined;
for (const name of Object.keys(schema.discriminators)) {
const matchValue = childSchema.discriminatorMapping.value || modelName;
const matchValue = schema.discriminators[name].discriminatorMapping.value || modelName;
if (matchValue === discriminatorValue) {
childSchema = schema.discriminators[name];
break;
Expand Down

0 comments on commit a2dbd8d

Please sign in to comment.