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
Minimal input schema:
{ "openapi": "3.0.1", "info": { "title": "bug report" }, "paths": { "/something": { "post": { "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "uploads": { "type": "array", "items": { "allOf": [ { "type": "object", "properties": { "file_type": { "type": "string" } } }, { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": ["a"] } } }, { "type": "object", "properties": { "type": { "type": "string", "enum": ["b"] }, "other": { "type": "string" } } } ] } ] } } } } } } } } } } } }
Output with syntax error:
export const getPostSomethingResponseMock = (overrideResponse: Partial< PostSomething200 > = {}): PostSomething200 => ({uploads: faker.helpers.arrayElement([Array.from({ length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({file_type: faker.helpers.arrayElement([faker.word.sample(), undefined]),{type: faker.helpers.arrayElement([faker.helpers.arrayElement(['a'] as const), undefined])},{other: faker.helpers.arrayElement([faker.word.sample(), undefined]), type: faker.helpers.arrayElement([faker.helpers.arrayElement(['b'] as const), undefined])}})), undefined]), ...overrideResponse})
Tested on orval 6.29.1 and 6.31.0. The code in the schema file and the API file is correct; only the MSW file has this problem.
This seems to only happen with a oneOf nested inside an allOf.
oneOf
allOf
The text was updated successfully, but these errors were encountered:
Similar to this issue: #1508
And this one: #1101
Sorry, something went wrong.
No branches or pull requests
Minimal input schema:
Output with syntax error:
Tested on orval 6.29.1 and 6.31.0. The code in the schema file and the API file is correct; only the MSW file has this problem.
This seems to only happen with a
oneOf
nested inside anallOf
.The text was updated successfully, but these errors were encountered: