-
-
Notifications
You must be signed in to change notification settings - Fork 365
New issue
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
Invalid type files are generated with Null-only enum or Empty enum #1022
Comments
Interesting this was just fixed: #1010 Why are your enums totally null that is not really an enum right? |
Oh and yes PR is welcome |
@melloware
I tried with latest master (sha export type NullOnlyNumberEnum = typeof NullOnlyNumberEnum[keyof typeof NullOnlyNumberEnum] | null;
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const NullOnlyNumberEnum = {
'': ,
// `null : null` is removed, but `'': ,` is still there
} as const;
My API have schemas of objects that have exact schemas:
result:
anyOf:
- type: object
properties:
data: ...
error: # exact null
- type: object
properties:
data: # exact null
error: ... There are not type: object # any type is ok
nullable: true
enum:
- null |
FYI, by Release Note of Openapi, enum is SHOULD NOT empty (means not recommended but valid) in 3.0. |
Cc @lenwhite please review |
What are the steps to reproduce this issue?
npx orval --input ./openapi.yaml --output out.ts
What happens?
An empty enum item not included in spec is generated.
In case of number, a const value is empty and it's invalid typescript.
What were you expecting to happen?
output
Any logs, error output, etc?
No information logs involving the behavior.
Any other comments?
Thanks for developing and maintaining this awesome package! :D
I try to make PR about this issue.
What versions are you using?
Operating System: MacOS 13.0
Package Version: 6.19.1
Browser Version: N/A
The text was updated successfully, but these errors were encountered: