Bug Report Checklist
Description
When upgrading to OpenAPI 3.1, some enums are generated as inner enums.
It would be very useful to be able to rename them to the old names. Unfortunately this is not possible
openapi-generator version
7.11.0
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Given these files:
foo.yaml
openapi: 3.0.4
info:
title: foo API
version: 0.0.1
paths:
/foo:
get:
responses:
200:
description: foo
content:
application/json:
schema:
$ref: 'user.yml#/Response'
and the shared common.yaml
Response:
properties:
id:
type: integer
Running this will generate two files, one being the shared class:
openapi-generator generate -g java -i foo.yaml
tree src/main/java/org/openapitools/client/model
├── AbstractOpenApiSchema.java
├── Response.java
└── Status.java
But if you foo.yaml to openapi: 3.1.0, FooGet200Response will be generated. This file can be renamed using modelNameMappings
openapi-generator generate -g java -i foo.yaml --model-name-mappings _foo_get_200_response=Response
tree src/main/java/org/openapitools/client/model
├── AbstractOpenApiSchema.java
└── Response.java
But inside is an Enum, that cannot be renamed:
grep 'enum ' ./src/main/java/org/openapitools/client/model/FooGet200Response.java
public enum StatusEnum {
Suggest a fix
Bug Report Checklist
Description
When upgrading to OpenAPI 3.1, some enums are generated as inner enums.
It would be very useful to be able to rename them to the old names. Unfortunately this is not possible
openapi-generator version
7.11.0
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Given these files:
foo.yaml
and the shared
common.yamlRunning this will generate two files, one being the shared class:
But if you foo.yaml to
openapi: 3.1.0,FooGet200Responsewill be generated. This file can be renamed using modelNameMappingsBut inside is an Enum, that cannot be renamed:
Suggest a fix