We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
Orval version: "7.8.0"
OAS:
openapi: 3.0.2 paths: "/animals": get: parameters: - $ref: '#/components/parameters/AnimalParam' components: parameters: AnimalParam: name: animal in: query schema: oneOf: - $ref: "#/components/schemas/Foo" - type: string enum: - mouse required: false schemas: Foo: type: string nullable: true enum: - cat - dog
Generated types:
import { Foo } from './foo' // eslint-disable-next-line @typescript-eslint/no-redeclare export const AnimalParamParameter = { ...Foo, mouse: 'mouse' } as const
It does not export type for AnimalParamParameter
AnimalParamParameter
Workaround:
components: parameters: AnimalParam: name: animal in: query schema: oneOf: - $ref: "#/components/schemas/Bar" schemas: Foo: nullable: true type: string enum: - cat - dog Bar: nullable: true oneOf: - $ref: "#/components/schemas/Foo" - type: string enum: - mouse
It exports the type as needed
import { Foo } from './foo' // eslint-disable-next-line @typescript-eslint/no-redeclare export const Bar = { ...Foo, mouse: 'mouse' } as const export type Bar = (typeof Bar)[keyof typeof Bar]
import type { Bar } from './bar' export type AnimalParamParameter = Bar
Without the oneOf workaround on AnimalParams which it should not need, I do not get the type exported
oneOf
AnimalParam: name: animal in: query schema: $ref: "#/components/schemas/Bar"
The text was updated successfully, but these errors were encountered:
#2057 will fix this
Sorry, something went wrong.
AllieJonsson
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
Orval version: "7.8.0"
OAS:
Generated types:
It does not export type for
AnimalParamParameter
Workaround:
It exports the type as needed
Without the
oneOf
workaround on AnimalParams which it should not need, I do not get the type exportedThe text was updated successfully, but these errors were encountered: