Skip to content

Commit

Permalink
fix: correct-enum-handling (#1386)
Browse files Browse the repository at this point in the history
  • Loading branch information
danyadanch authored May 24, 2024
1 parent ce27a26 commit d5574cd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/core/src/getters/discriminators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ export const resolveDiscriminators = (
...subTypeSchema.properties,
[propertyName]: {
type: 'string',
enum: [...(property?.enum ?? []), mappingKey],
enum: [
...(property?.enum?.filter((value) => value !== mappingKey) ??
[]),
mappingKey,
],
},
};
subTypeSchema.required = [
Expand Down

0 comments on commit d5574cd

Please sign in to comment.