diff --git a/packages/mock/src/faker/getters/combine.ts b/packages/mock/src/faker/getters/combine.ts index 06169bc09..7461765a4 100644 --- a/packages/mock/src/faker/getters/combine.ts +++ b/packages/mock/src/faker/getters/combine.ts @@ -103,9 +103,9 @@ export const combineSchemasMock = ({ let currentValue = resolvedValue.value; if (itemResolvedValue?.value && separator === 'oneOf') { - currentValue = `${resolvedValue.value.slice(0, -1)},${ - itemResolvedValue.value - }}`; + const splitValues = resolvedValue.value.split('},{'); + const joined = splitValues.join(`,${itemResolvedValue.value}},{`); + currentValue = `${joined.slice(0, -1)},${itemResolvedValue.value}}`; } if (itemResolvedValue?.value && separator !== 'oneOf' && isLastElement) {