openapi-generator
openapi-generator copied to clipboard
[BUG] [Elm] Enums getting extra value with "UnknownEnumVariableName"
Bug Report Checklist
- [X] Have you provided a full/minimal spec to reproduce the issue?
-
Using the full Stripe API spec.
- [X] Have you validated the input using an OpenAPI validator (example)?
-
I used the CLI with
validateand it found no issues. - [x] Have you tested with the latest master to confirm the issue still exists?
-
Yes
- [X] Have you searched for related issues/PRs?
Description
openapi-generator version
Latest master
OpenAPI declaration file content or url
https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.json
Generation Details
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.json -g elm -o ./elm-stripeFix
Some enum types turn into a custom type with a bogus constructor:
type TaxExempt
= TaxExemptUnknownEnumVariableName
| TaxExemptExempt
| TaxExemptNone
| TaxExemptReverse
taxExemptVariants : List TaxExempt
taxExemptVariants =
[ TaxExemptUnknownEnumVariableName
, TaxExemptExempt
, TaxExemptNone
, TaxExemptReverse
]
stringFromTaxExempt : TaxExempt -> String
stringFromTaxExempt model =
case model of
TaxExemptUnknownEnumVariableName ->
""
TaxExemptExempt ->
"exempt"
TaxExemptNone ->
"none"
TaxExemptReverse ->
"reverse"
... but "TaxExemptUnknownEnumVariableName" does not exist, and the spec json does not seem to indicate any other values besides the valid three...