OpenAPITools / OpenAPITools/openapi-generator
[BUG][Elm] Generation crashes with Exception: Property type is missing from getVars
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
-
Using the full Stripe API spec.
- Have you validated the input using an OpenAPI validator (example)?
-
I used the CLI with
validateand it found no issues. - Have you tested with the latest master to confirm the issue still exists?
-
Yes
- Have you searched for related issues/PRs?
- What's the actual output vs expected output?
Description
The elm generator produces partial output and broken code before failing with this error:
Exception: Property type is missing from getVars
at org.openapitools.codegen.DefaultGenerator.processOperation(DefaultGenerator.java:1187)
at org.openapitools.codegen.DefaultGenerator.processPaths(DefaultGenerator.java:1078)
at org.openapitools.codegen.DefaultGenerator.generateApis(DefaultGenerator.java:580)
at org.openapitools.codegen.DefaultGenerator.generate(DefaultGenerator.java:915)
at org.openapitools.codegen.cmd.Generate.execute(Generate.java:465)
at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)
Caused by: java.lang.RuntimeException: Property type is missing from getVars
at org.openapitools.codegen.DefaultCodegen.addRequiredVarsMap(DefaultCodegen.java:7319)
at org.openapitools.codegen.DefaultCodegen.addVarsRequiredVarsAdditionalProps(DefaultCodegen.java:7354)
at org.openapitools.codegen.DefaultCodegen.fromParameter(DefaultCodegen.java:4972)
at org.openapitools.codegen.DefaultCodegen.fromOperation(DefaultCodegen.java:4394)
at org.openapitools.codegen.DefaultGenerator.processOperation(DefaultGenerator.java:1155)
... 6 more
openapi-generator version
6.2.0 (latest via npm)
OpenAPI declaration file content or url
https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.json
Generation Details
Steps to reproduce
generate -i "https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.json" -g elm -o elmStripeAPI
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with the Stripe spec and the generate -i ... -g elm command. Start at DefaultGenerator.processOperation and trace through DefaultCodegen.fromParameter, addRequiredVarsMap, and addVarsRequiredVarsAdditionalProps; done means generation completes without the missing-property exception and produces valid Elm output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elm, java, openapi
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100