OpenAPITools / OpenAPITools/openapi-generator

[BUG] Scala templates use different case styles and formatters for variables

Open
#5,496 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
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?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

UPPERCASE value was handled by most of scala templates with do not modify option, but behaviour was different for akka template where output was uPPERCASE

This behaviour become generic and UPPERCASE variables skipped for formatting rules

https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractScalaCodegen.java#L172

But regarding to https://docs.scala-lang.org/style/naming-conventions.html only camelCase allowed.

Correct way is to convert UPPERCASE into lowercase and keep naming convention in AbstractScala common to all Scala based templates

openapi-generator version

4.3.0-SNAPSHOT

Related issues/PRs

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractScalaCodegen.java around line 172, then compare the naming behavior of the Scala templates, especially akka. Confirm the handling described in the issue and the related PR discussion. Done means UPPERCASE variables become lowercase and other variables are camelized consistently across Scala templates.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, scala
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.