Bug Report Checklist
Description
While generating openapi spec with enums having common prefix, the common prefix is skipped in the enum name. Eg:
ResourceTypeV1:
type: string
description: Defines a resource type to provision, it can be multiple resources e.g. DATABASE or TOPIC
enum:
- RESOURCE_ACCESS_REQUEST
- RESOURCE_ACCESS_GRANT
Class generated:
public enum ResourceTypeV1 {
REQUEST("RESOURCE_ACCESS_REQUEST"),
GRANT("RESOURCE_ACCESS_GRANT");
private String value;
Expected class generated:
public enum ResourceTypeV1 {
RESOURCE_ACCESS_REQUEST("RESOURCE_ACCESS_REQUEST"),
RESOURCE_ACCESS_GRANT("RESOURCE_ACCESS_GRANT");
private String value;
openapi-generator version: 7.6.0
OpenAPI declaration file content or url
Generation Details
Using maven to generate. Below is the configuration for the openapi-generator-maven-plugin
<configuration>
<inputSpec>${project.basedir}/src/main/resources/schema/openapi_rar.yaml</inputSpec>
<generatorName>spring</generatorName>
<packageName>com.maersk.relaystream.provisioning.schema.rar</packageName>
<apiPackage>com.maersk.relaystream.provisioning.generated.api.rar</apiPackage>
<modelPackage>com.maersk.relaystream.provisioning.generated.model.rar</modelPackage>
<configOptions>
<sourceFolder>src/gen/java</sourceFolder>
<ignoreAnyOfInEnum>true</ignoreAnyOfInEnum>
<interfaceOnly>true</interfaceOnly>
<useSpringBoot3>true</useSpringBoot3>
<openApiNullable>false</openApiNullable>
<serializableModel>true</serializableModel>
<containerDefaultToNull>false</containerDefaultToNull>
</configOptions>
</configuration>
Steps to reproduce
- Create an OpenAPI spec having the enum mentioned above
- Generate the class from the spec.
Related issues/PRs
Suggest a fix
Bug Report Checklist
Description
While generating openapi spec with enums having common prefix, the common prefix is skipped in the enum name. Eg:
Class generated:
Expected class generated:
openapi-generator version: 7.6.0
OpenAPI declaration file content or url
Generation Details
Using maven to generate. Below is the configuration for the openapi-generator-maven-plugin
Steps to reproduce
Related issues/PRs
Suggest a fix