OpenAPITools / OpenAPITools/openapi-generator
[BUG][aspnetcore] Wrong Enum definition
Open
Nobody has claimed this yet.
Issue: Bug
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
It creates the enum successfully. But then if there is a property that is a list of the enum, the generator tries to define the enum again.
openapi-generator version
5.3.0
OpenAPI declaration file content or url
components:
schemas:
Connection:
description: Connection
properties:
id:
maxLength: 80
type: string
name:
maxLength: 80
type: string
outer_vlan_ethertypes:
description: "The ethertype of the outer tag in hexadecimal notation."
example:
- "0x8100"
items:
default: "0x8100"
enum:
- "0x8100"
- "0x88a8"
- "0x9100"
type: string
type: array
title: Connection
type: object
Generation Details

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
Reproduce the ASP.NET Core generation using the OpenAPI declaration in the issue and inspect the generator's enum handling for the Connection schema. Trace why the inline array-item enum is defined again after the enum is created. Done means generation succeeds without a duplicate enum definition for this input.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100