OpenAPITools / OpenAPITools/openapi-generator
[BUG] scala-cask generates invalid enum entries
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
When generating enums there are several problems.
-
Unlike all the other code this appears to try to use the braceless syntax, but fails as the case statements are not correctly indented. I suspect it would be much simpler to use braces rather that trying to force the indentation levels in the mustache templates
-
A Scala 3 enum should be of the form:-
enum derives RW {
case a,b,c,d
}
rather than having multiple cases. Also the cases in my case(s) ended up as integers, scala requires identifiers
- Although the use of derives RW seems to work elsewhere, when used with enums it gets an is imported twice on the same import line.
openapi-generator version
7.10
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
Start by reproducing the Scala 3 enum output from the scala-cask generator using the reported OpenAPI Generator 7.10 setup. Inspect the mustache templates and generated imports for enum indentation, case identifiers, enum syntax, and duplicate derives RW imports. Done means the generated Scala compiles and produces valid enums with correct imports.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100