We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There are a couple of issues here.
The output is wrong
export const getListPetsResponseMock = (): PetsArray => Array.from( { length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1, ).map(() => faker.helpers.arrayElement([ { category: faker.helpers.arrayElement([ faker.helpers.arrayElement(['FELINE', 'CANINE'] as const), undefined, ]), id: (() => faker.number.int({ min: 1, max: 99999 }))(), }, { superpowers: faker.helpers.arrayElement([ faker.word.sample(), undefined, ]), }, ]), );
export const getListPetsResponseMock = (): PetsArray => Array.from( { length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1, ).map(() => faker.helpers.arrayElement([ { id: (() => faker.number.int({ min: 1, max: 99999 }))(), category: 'FELINE', superpowers: faker.helpers.arrayElement([ faker.word.sample(), undefined, ]), }, { id: (() => faker.number.int({ min: 1, max: 99999 }))(), category: 'CANINE', }, ]), );
export const getListPetsResponseMock = (): PetsArray => (Array.from({ length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.helpers.arrayElement([id: (() => faker.number.int({ min: 1, max: 99999 }))(),category: faker.helpers.arrayElement([faker.helpers.arrayElement(['FELINE','CANINE'] as const), undefined]),superpowers: faker.helpers.arrayElement([faker.word.sample(), undefined])]))))
The above cannot be formatted due to the output being wrong.
Because there is a discriminator, the expectation is that the generated mock already fills the category.
openapi
The text was updated successfully, but these errors were encountered:
I've tried looking into this issue and see if I could put a PR up but it looks complicated. I might ping on discord over the weekend.
Sorry, something went wrong.
I appear to have also hit this issue, i started to look at the code in orval but didn't quite know where to start
Seemed possible its in the combine.ts file but not sure
msw
anyof
allof
soartec-lab
Successfully merging a pull request may close this issue.
What are the steps to reproduce this issue?
There are a couple of issues here.
anyOf with discriminator and items not using allOf
The output is wrong
What happens?
What were you expecting to happen?
anyOf with discriminator and items using allOf
The output is wrong
What happens?
The above cannot be formatted due to the output being wrong.
What were you expecting to happen?
Because there is a discriminator, the expectation is that the generated mock already fills the category.
Any logs, error output, etc?
Any other comments?
openapi
schema causing the issuepetstore.yaml.zip
The text was updated successfully, but these errors were encountered: