Skip to content

[BUG] Description Enum constant name prefix has been stripped  #14890

Description

@SUSHIL161

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

When generating the enums client is acutally stripping the enum name.
I have two enum constant TEST_PACKAGE , TEST_RESULT_FILE.
But when openapi generating the yaml into java client it is stripping the TEST_ from name .

YAML FILE

FileType:
  type: string
  description: File type indicates test file or test run result
  enum:
    - TEST_PACKAGE
    - TEST_RESULT_FILE

generated output is

@JsonAdapter(FileType.Adapter.class)
public enum FileType {

PACKAGE("TEST_PACKAGE"),

RESULT_FILE("TEST_RESULT_FILE");
}

However expected output is

@JsonAdapter(FileType.Adapter.class)
public enum FileType {

TEST_PACKAGE("PACKAGE"),

TEST_RESULT_FILE("RESULT_FILE");

openapi-generator version

6.4.0

OpenAPI declaration file content or url

https://github.com/SUSHIL161/openapi/blob/main/openapi.yaml

Generation Details

Url of xml file

https://github.com/SUSHIL161/openapi/blob/main/openaapi.xml

org.openapitools openapi-generator-maven-plugin 6.4.0 generate ${project.basedir}/../openapi/target/classes/openapi.yaml java rest-assured ${project.build.directory}/generated-sources ${project.groupId}.sdk.api ${project.groupId}.sdk.models ${project.groupId}.sdk false false java8-localdatetime java CLIENT false false
Steps to reproduce

https://github.com/SUSHIL161/openapi/blob/main/openapi.yaml
generate java client from above file and check the model class FileType

Related issues/PRs
Suggest a fix

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions