diff --git a/packages/core/src/getters/discriminators.ts b/packages/core/src/getters/discriminators.ts index 7fdb3c30f..3f48fe52c 100644 --- a/packages/core/src/getters/discriminators.ts +++ b/packages/core/src/getters/discriminators.ts @@ -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 = [