Bug Report Checklist
Description
If you have an enum that start with a digit, (for example 100, 200, 3test), the resulting PS1 will error out.
openapi-generator version
7.14.0
OpenAPI declaration file content or url
https://redfish.dmtf.org/schemas/v1/SerialInterface.v1_3_0.yaml#/components/schemas/SerialInterface_v1_3_0_SerialInterface
Generation Details
PowerShell 7.5, Redfish OpenAPI spec.
Steps to reproduce
open-api-generator -i https://redfish.dmtf.org/schemas/v1/SerialInterface.v1_3_0.yaml#/components/schemas/SerialInterface_v1_3_0_SerialInterface -g powershell
Which will result in a ps1 with an enum.
enum SerialInterface_v1_3_0_BitRate {
1200
2400
4800
9600
19200
38400
57600
115200
230400
}
PowerShell does not like this format.
Related issues/PRs
Suggest a fix
Begin the enum with an underscore (which is how the C# generator works). I'm not sure of the logic to then use the correct value for the resulting API call, however.
enum SerialInterface_v1_3_0_BitRate {
_1200 = 1200
_2400 = 2400
_4800 =4800
_9600 = 9600
_19200 = 19200
_38400 = 38400
_57600 = 57600
_115200 = 115200
_230400 = 230400
}
Alternatively, perhaps an array is better than an actual enum.
Bug Report Checklist
Description
If you have an enum that start with a digit, (for example
100, 200, 3test), the resulting PS1 will error out.openapi-generator version
7.14.0
OpenAPI declaration file content or url
https://redfish.dmtf.org/schemas/v1/SerialInterface.v1_3_0.yaml#/components/schemas/SerialInterface_v1_3_0_SerialInterface
Generation Details
PowerShell 7.5, Redfish OpenAPI spec.
Steps to reproduce
Which will result in a ps1 with an enum.
enum SerialInterface_v1_3_0_BitRate { 1200 2400 4800 9600 19200 38400 57600 115200 230400 }PowerShell does not like this format.
Related issues/PRs
Suggest a fix
Begin the enum with an underscore (which is how the C# generator works). I'm not sure of the logic to then use the correct value for the resulting API call, however.
enum SerialInterface_v1_3_0_BitRate { _1200 = 1200 _2400 = 2400 _4800 =4800 _9600 = 9600 _19200 = 19200 _38400 = 38400 _57600 = 57600 _115200 = 115200 _230400 = 230400 }Alternatively, perhaps an array is better than an actual enum.